From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 73515426A5; Mon, 2 Oct 2023 20:37:49 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4D4BD402DB; Mon, 2 Oct 2023 20:37:45 +0200 (CEST) Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by mails.dpdk.org (Postfix) with ESMTP id 2822840294 for ; Mon, 2 Oct 2023 20:37:43 +0200 (CEST) Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-1c737d61a00so826635ad.3 for ; Mon, 02 Oct 2023 11:37:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1696271862; x=1696876662; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=IBNHHv5J5if2zN/gmjlGq0NY5Upn+ZeyxK9edcmwPuo=; b=YB8LgHlB0jV0QA0uVkoEQqCi7E0OVECJi/R5gh7I+mKjfbkPncLrtdUm7Bpd/Sxf6H P97L80J5Dr6aRXLRWo8pcgc8mSWp0juQVsHXg/Q/CkuROjA8hUdZEQa35faO4hMkMucA I3CK+lRhzP9yM5H5EiUVIQ/1TYdtFvS4hKKZVtoqYRuDt75d24Za6eljatjX/zj02hTq 4xnw9dzVF7sfCRqHGfIiWWvmzm3+pCoZici+nqFTny/c2vHQ/bjq7WnbSrbItEdD5KZm fFyg6Yor4Qr/+64TKrMApz5EwB6OwXbgAFQggFCi7e1RnBMcAzmQXl3ARDcuerVMSYrx 37mA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696271862; x=1696876662; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IBNHHv5J5if2zN/gmjlGq0NY5Upn+ZeyxK9edcmwPuo=; b=LHvy6QXY3cX632MpBQrzJEAy9/4hqBNUvvVWZ88IDYKrVGTdq82p0G0gqvuk66qb4z 24hmbTrvGbfbskMBXYmJk0q8mWstsZHR+DIP01W1kQJ/aKNX4xiyLEJJ7Nd74Blt+wJn fKvlXdlRrwWN1T76ORcKKwRQ7PAizHwwzkIG3n38eJtR0h5KbabATUBwa3sHKdJqxZcg m2SShJakX9GaAMJrK8ij5CNw2Hzoh6+3jL1ERNrzRU2nVuTPFXcnCUdewPw5Z85lkGwk YjCgJVgmledZleO8DbCcgnfIRmkP8WgPET97FxkxCyo3NGGHC8TTaZavzlsgDCOWdscZ 30hA== X-Gm-Message-State: AOJu0YzYFL0JKOz/bw5mFi/B5VNrvihVoM+RUvVAXv8AMlAHZ1bj7vES SUiQ0Dx7Ez+wG5zVwZJrrMM81nMHLHXGu8UDti0= X-Google-Smtp-Source: AGHT+IEA7W82fnDgMwf6n5qNuZwI+NWajeOjfp4HGT06Om412GDO7uVC7BBFq9t7ePNXksCMZkfREg== X-Received: by 2002:a17:903:22cd:b0:1c6:2dbb:e5f4 with SMTP id y13-20020a17090322cd00b001c62dbbe5f4mr13783943plg.26.1696271862069; Mon, 02 Oct 2023 11:37:42 -0700 (PDT) Received: from hermes.local (204-195-126-68.wavecable.com. [204.195.126.68]) by smtp.gmail.com with ESMTPSA id iz7-20020a170902ef8700b001b9f7bc3e77sm12546595plb.189.2023.10.02.11.37.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 11:37:41 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v2 1/3] test: remove some strings from cmdline_etheraddr tests Date: Mon, 2 Oct 2023 11:37:28 -0700 Message-Id: <20231002183730.301163-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231002183730.301163-1-stephen@networkplumber.org> References: <20230929163611.62691-1-stephen@networkplumber.org> <20231002183730.301163-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Some of the ethernet address formats which were invalid will now become valid inputs when rte_ether_unformat_addr is modified to allow leading zeros. Also, make local variables static. Signed-off-by: Stephen Hemminger --- app/test/test_cmdline_etheraddr.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/app/test/test_cmdline_etheraddr.c b/app/test/test_cmdline_etheraddr.c index 9691c32ba250..166c5716ba9b 100644 --- a/app/test/test_cmdline_etheraddr.c +++ b/app/test/test_cmdline_etheraddr.c @@ -20,7 +20,7 @@ struct ether_addr_str { }; /* valid strings */ -const struct ether_addr_str ether_addr_valid_strs[] = { +static const struct ether_addr_str ether_addr_valid_strs[] = { {"01:23:45:67:89:AB", 0xAB8967452301ULL}, {"4567:89AB:CDEF", 0xEFCDAB896745ULL}, }; @@ -30,7 +30,7 @@ const struct ether_addr_str ether_addr_valid_strs[] = { * end of token, which is either space chars, null char or * a hash sign. */ -const char * ether_addr_garbage_strs[] = { +static const char * const ether_addr_garbage_strs[] = { "00:11:22:33:44:55\0garbage", "00:11:22:33:44:55#garbage", "00:11:22:33:44:55 garbage", @@ -46,14 +46,13 @@ const char * ether_addr_garbage_strs[] = { #define GARBAGE_ETHERADDR 0x554433221100ULL /* corresponding address */ -const char * ether_addr_invalid_strs[] = { +static const char * const ether_addr_invalid_strs[] = { /* valid chars, invalid syntax */ "0123:45:67:89:AB", "01:23:4567:89:AB", "01:23:45:67:89AB", "012:345:678:9AB", "01:23:45:67:89:ABC", - "01:23:45:67:89:A", "01:23:45:67:89", "01:23:45:67:89:AB:CD", /* invalid chars, valid syntax */ @@ -61,10 +60,8 @@ const char * ether_addr_invalid_strs[] = { "INVA:LIDC:HARS", /* misc */ "01 23 45 67 89 AB", - "01.23.45.67.89.AB", "01,23,45,67,89,AB", - "01:23:45\0:67:89:AB", - "01:23:45#:67:89:AB", + "01:23:45:67#:89:AB", "random invalid text", "random text", "", -- 2.39.2