From patchwork Sat Jun 29 07:57:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Couder X-Patchwork-Id: 11023739 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3A6CC14F6 for ; Sat, 29 Jun 2019 07:58:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3B5A02885F for ; Sat, 29 Jun 2019 07:58:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2CFD728868; Sat, 29 Jun 2019 07:58:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D15802885F for ; Sat, 29 Jun 2019 07:58:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726883AbfF2H6F (ORCPT ); Sat, 29 Jun 2019 03:58:05 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:54194 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726789AbfF2H6F (ORCPT ); Sat, 29 Jun 2019 03:58:05 -0400 Received: by mail-wm1-f67.google.com with SMTP id x15so11176954wmj.3 for ; Sat, 29 Jun 2019 00:58:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=BFCjoiNgYyHJWueooxUJEOfBSpQyuBpjHK0yCHajNPI=; b=VLBJHA777XakOwCsEZXKVRh9wQj/gyh2dRTBibZ5Y4cv9zprTf0Lph20EMcLfhKp04 ebcMw58Ih2vl4SSRgrE6JOY8zB6jev2omWyS5jwTBtRsAzbZz5/0hWMoQznYiJER2HAR 9FJL4iSjGF8CbCxa7IDk7KNFU+aKrghxbqZCvlV/PNZSGsSxEsZWWmqeOP4JS5+fO2TX LmTe9of4iioOsOktkTJE+0v24jNB7E3B6F6aq/FMrq0bNvOhTdP/65pfVmK3dGcEjyPD VRWalO/DZO7KWez01+yQZWSNVHtLG6vFHvlAAzUrI8+EQ2PBip4qQbdfBgbN3rpXGP3v 0dhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=BFCjoiNgYyHJWueooxUJEOfBSpQyuBpjHK0yCHajNPI=; b=ZV4Ol0zTn8MWuzw4nqZxgZTbPINswJLueENiV1VP3Fs/T+Aav+FlmkDm6Nq7a3bLgq w/NtQFU7CHJKmtWKzdLUfgNk38svMfZE0hC0SkOcUHu//OAhRsX1EsyI8ItQHt4Y9q1K rdNsRkQjC4yeLdEWIK1y2QQvniC07IIQzvOz0df48SMDGHvet+Te49JguhpF4smmTEf9 A1ZFyX8pcM7K7js+B8LwME5ZoGJKozT61D6TSVx66m6I4IlnNLbT10H6Oet6/6a8xTmt tt9yFqhZtSLshxqnFYh1cPz2eS6OSFf1fAYaNqmgm/RUi8lxrrMnQQxRNfTXtgGGOf8n 8UNw== X-Gm-Message-State: APjAAAUgQAPDHk2HMt677lsPLQqn8laAeWa7qW+qj41bCJoMzadwedLB CbUYQ5iRO4oSSXKUoVe+AiKC9Mn0Ugg= X-Google-Smtp-Source: APXvYqw6MBs0S/yFb2ew3ALhICzbr167SEyDjiYeN4pbhDzZMN1qL4raJmiPH2/cAf0egKbLcxj6rQ== X-Received: by 2002:a1c:6c08:: with SMTP id h8mr10449080wmc.62.1561795082399; Sat, 29 Jun 2019 00:58:02 -0700 (PDT) Received: from localhost.localdomain ([2a04:cec0:10df:46ae:1d3b:9b5f:d57a:703b]) by smtp.gmail.com with ESMTPSA id z5sm4155330wrh.16.2019.06.29.00.58.01 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 29 Jun 2019 00:58:01 -0700 (PDT) From: Christian Couder X-Google-Original-From: Christian Couder To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= , Jonathan Tan , =?utf-8?q?SZEDER_G=C3=A1bor?= , Jeff King , Derrick Stolee , Christian Couder Subject: [PATCH 1/2] test-oidmap: remove 'add' subcommand Date: Sat, 29 Jun 2019 09:57:46 +0200 Message-Id: <20190629075747.32586-1-chriscool@tuxfamily.org> X-Mailer: git-send-email 2.22.0.464.g81fc6c5d4a.dirty MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The 'add' subcommand is useless as it is mostly identical to the 'put' subcommand, so let's remove it. Helped-by: Derrick Stolee Signed-off-by: Christian Couder --- This and 2/2 follow this discussion about test coverage: https://public-inbox.org/git/CAP8UFD3VFdCUwDBTb9en22FO7HnWc4vgQ4h0hhariCB=om4b8A@mail.gmail.com/ t/helper/test-oidmap.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/t/helper/test-oidmap.c b/t/helper/test-oidmap.c index 7036588175..0acf99931e 100644 --- a/t/helper/test-oidmap.c +++ b/t/helper/test-oidmap.c @@ -47,21 +47,7 @@ int cmd__oidmap(int argc, const char **argv) if (p1) p2 = strtok(NULL, DELIM); - if (!strcmp("add", cmd) && p1 && p2) { - - if (get_oid(p1, &oid)) { - printf("Unknown oid: %s\n", p1); - continue; - } - - /* create entry with oidkey from p1, value = p2 */ - FLEX_ALLOC_STR(entry, name, p2); - oidcpy(&entry->entry.oid, &oid); - - /* add to oidmap */ - oidmap_put(&map, entry); - - } else if (!strcmp("put", cmd) && p1 && p2) { + if (!strcmp("put", cmd) && p1 && p2) { if (get_oid(p1, &oid)) { printf("Unknown oid: %s\n", p1); From patchwork Sat Jun 29 07:57:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Couder X-Patchwork-Id: 11023741 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CD1EE746 for ; Sat, 29 Jun 2019 07:58:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CF9D72885F for ; Sat, 29 Jun 2019 07:58:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C397228868; Sat, 29 Jun 2019 07:58:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7962D2885F for ; Sat, 29 Jun 2019 07:58:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726889AbfF2H6G (ORCPT ); Sat, 29 Jun 2019 03:58:06 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:55604 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726857AbfF2H6G (ORCPT ); Sat, 29 Jun 2019 03:58:06 -0400 Received: by mail-wm1-f68.google.com with SMTP id a15so11166002wmj.5 for ; Sat, 29 Jun 2019 00:58:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Kc8zMZN3bA2YxVhkJ8+muZH5APk9C5cMnlMclUJzX5Q=; b=UuFMIb+m4/IVffQbI3UUcJbiJ9wUOTfXrr4MuO9NU5qOkEl8T70inB/mUEUKJn7nRP s4TipyxsaQbKqK01dF6ZPvYoigf9S/a0CY9LGYVpou6CXl+AWLaEqRDA09XWE5/VqH54 Cw7jLD6g8J+q2s2xTHlqgoqACzLS32s2iIGywtwOkTE6bAxehVxLW0A2dQ+IamuRkqbQ VME6VR3enOu3h6cDDJtPILa+uHjWKoRqjBVfOZyMWQ3ueVzwvsC47G4b7hr6JIGtNP4j 5+7dMxCT/AF+unnUO+3clQB8c8JdmNyoPGkZ+uLKq+/MImdU6Y5dxQdhCDIhE+OWeLvQ xkow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Kc8zMZN3bA2YxVhkJ8+muZH5APk9C5cMnlMclUJzX5Q=; b=AHnlHkRucVomH3MaHw04DFs/2kyuR/3du2hY3udcYiJacr5kItBDc6530idA2WR7nP NVkldKg2px8RFa9J14+vEHRsl1PMUwhvI755JP6q7gEcYyUzrDHY/K4FAI/6A9txdqKn rgOS2LVJCgJMs0KXQoG3awpQj+PFxXw1jFeIJwUcnaxqi6DeDtYWlUuNuvf+ngFOJHFL 9ifIMJ0+RZ+xQ3gQW0ZcppVrG1r114s1Jyl4kUXxQI4dCFWdHae+A5ZpRsJCcNMoAIyn 3Vb4mJdcWrKEzsQsCsyLQNmdTgBv/tZ6Vqx/UlGhKm0UYsTnMsIBrsXlGP/MPoUYuT8m fZ1Q== X-Gm-Message-State: APjAAAVhmNAmtWQWn+o3fstvLH8+tqpRlYCy5+acdwyyNdZA85/rh+PH 5pkQWt5csdVrishBwftyZLCtAKjIIcQ= X-Google-Smtp-Source: APXvYqwuCZQa2OWpA15hVka4qKdTvIU0bj5pHobkCcX+ws2ADeBAOiXVAe5h9LSMj2MQ8LmxvmQhIA== X-Received: by 2002:a1c:44d7:: with SMTP id r206mr10283296wma.164.1561795083626; Sat, 29 Jun 2019 00:58:03 -0700 (PDT) Received: from localhost.localdomain ([2a04:cec0:10df:46ae:1d3b:9b5f:d57a:703b]) by smtp.gmail.com with ESMTPSA id z5sm4155330wrh.16.2019.06.29.00.58.02 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 29 Jun 2019 00:58:03 -0700 (PDT) From: Christian Couder X-Google-Original-From: Christian Couder To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= , Jonathan Tan , =?utf-8?q?SZEDER_G=C3=A1bor?= , Jeff King , Derrick Stolee , Christian Couder Subject: [PATCH 2/2] t0016: add 'remove' subcommand test Date: Sat, 29 Jun 2019 09:57:47 +0200 Message-Id: <20190629075747.32586-2-chriscool@tuxfamily.org> X-Mailer: git-send-email 2.22.0.464.g81fc6c5d4a.dirty In-Reply-To: <20190629075747.32586-1-chriscool@tuxfamily.org> References: <20190629075747.32586-1-chriscool@tuxfamily.org> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Testing the 'remove' subcommand was forgotten when t0016 was created. Let's fix that. Helped-by: Derrick Stolee Signed-off-by: Christian Couder --- t/t0016-oidmap.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/t/t0016-oidmap.sh b/t/t0016-oidmap.sh index af17264ce3..bbe719e950 100755 --- a/t/t0016-oidmap.sh +++ b/t/t0016-oidmap.sh @@ -67,6 +67,24 @@ Unknown oid: invalidOid ' +test_expect_success 'remove' ' + +test_oidmap "put one 1 +put two 2 +put three 3 +remove one +remove two +remove invalidOid +remove four" "NULL +NULL +NULL +1 +2 +Unknown oid: invalidOid +NULL" + +' + test_expect_success 'iterate' ' test_oidmap "put one 1