From patchwork Mon Jun 22 16:31:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 50179 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f72.google.com (mail-wg0-f72.google.com [74.125.82.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 57F5721594 for ; Mon, 22 Jun 2015 16:33:41 +0000 (UTC) Received: by wgbhy7 with SMTP id hy7sf45384575wgb.3 for ; Mon, 22 Jun 2015 09:33:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :mime-version:content-type:content-transfer-encoding:errors-to :sender:x-original-sender:x-original-authentication-results :mailing-list; bh=LGdrvTAgbjz551Uux7AsAqutWDdZ8pm2pKZ+L2kitZw=; b=Lwz0fVOyQLNh1i1hRGScqqQ2lTkb0JHEb3HD/eao+0qkB/wazR6h4PraPgkaYwRGNN NIYcEYRjxjwXSUoJIOxiyYb4xlvQsK+ZE91NongeNR2aA937TbiPk6fXVXQY2CLF5xLJ z34UobA18CF0R3cWArKktoPJJu8nq8sWw0NMOS3w7+SywLJEQ/OkfnTB/w1eYV+2/J6P ts2rpRTQ4D4MBhpkqVMieYKyPfTlDqpZTFAw841YF/rZz/Q1WMUGmziAZOwLLaS05xb6 mWGPOeoK3YZNS5AjSp2bWymbRfAjFdxodleMfHBoLn/aKaRCBtOocT3ZYwgzU80jLzxr XTFg== X-Gm-Message-State: ALoCoQnbGjXaaJ9Wl5Zw9RovQ3am0U/v/Sb1fdYfz0QaaqcT4f5MskdLctoIfNo2LRSJkLVEYl52 X-Received: by 10.180.87.201 with SMTP id ba9mr16549672wib.3.1434990820541; Mon, 22 Jun 2015 09:33:40 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.8.1 with SMTP id n1ls791402laa.87.gmail; Mon, 22 Jun 2015 09:33:40 -0700 (PDT) X-Received: by 10.152.43.37 with SMTP id t5mr30218601lal.96.1434990820377; Mon, 22 Jun 2015 09:33:40 -0700 (PDT) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com. [209.85.217.177]) by mx.google.com with ESMTPS id ap4si14399084lac.21.2015.06.22.09.33.40 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Jun 2015 09:33:40 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) client-ip=209.85.217.177; Received: by lbbpo10 with SMTP id po10so12642808lbb.3 for ; Mon, 22 Jun 2015 09:33:40 -0700 (PDT) X-Received: by 10.152.6.69 with SMTP id y5mr30508654lay.72.1434990820133; Mon, 22 Jun 2015 09:33:40 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp2504422lbb; Mon, 22 Jun 2015 09:33:39 -0700 (PDT) X-Received: by 10.140.133.18 with SMTP id 18mr40493518qhf.84.1434990818655; Mon, 22 Jun 2015 09:33:38 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id f100si10666710qkf.89.2015.06.22.09.33.38; Mon, 22 Jun 2015 09:33:38 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Received: by lists.linaro.org (Postfix, from userid 109) id E77FA61E25; Mon, 22 Jun 2015 16:33:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from ip-10-142-244-252.ec2.internal (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id D78E661E04; Mon, 22 Jun 2015 16:32:02 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id BFA8F61DFC; Mon, 22 Jun 2015 16:31:57 +0000 (UTC) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com [209.85.215.48]) by lists.linaro.org (Postfix) with ESMTPS id C497661B62 for ; Mon, 22 Jun 2015 16:31:28 +0000 (UTC) Received: by lagi2 with SMTP id i2so23822451lag.2 for ; Mon, 22 Jun 2015 09:31:27 -0700 (PDT) X-Received: by 10.152.44.193 with SMTP id g1mr31015025lam.15.1434990687469; Mon, 22 Jun 2015 09:31:27 -0700 (PDT) Received: from erachmi-VirtualBox.ki.sw.ericsson.se (c-83-233-90-46.cust.bredband2.com. [83.233.90.46]) by mx.google.com with ESMTPSA id t15sm4780337lbk.0.2015.06.22.09.31.25 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 22 Jun 2015 09:31:26 -0700 (PDT) From: Christophe Milard To: anders.roxell@linaro.org, mike.holmes@linaro.org, stuart.haslam@linaro.org, maxim.uvarov@linaro.org Date: Mon, 22 Jun 2015 18:31:07 +0200 Message-Id: <1434990669-22399-4-git-send-email-christophe.milard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1434990669-22399-1-git-send-email-christophe.milard@linaro.org> References: <1434990669-22399-1-git-send-email-christophe.milard@linaro.org> X-Topics: Classification patch Cc: lng-odp@lists.linaro.org Subject: [lng-odp] [PATCHv2 3/5] validation: renaming in odp_classification.c X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: christophe.milard@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Renaming of things which may be, one day, exported in a lib. This renaming is important, as it creates consistency between test symbols, which is needed if things get eventually exported in the lib. Also, tests are often created from other tests: Fixing the first exemples will help geting future tests better. Things that are candidate to be exported in the lib in the future have been named as follows: -Tests, i.e. functions which are used in CUNIT testsuites are named: _test_* -Test arrays, i.e. arrays of CU_TestInfo, listing the test functions belonging to a suite, are called: _suite[_*] where the possible suffix can be used if many suites are declared. -CUNIT suite init and termination functions are called: _suite[_*]_init() and _suite[_*]_term() respectively. -Suite arrays, i.e. arrays of CU_SuiteInfo used in executables are called: _suites[_*] where the possible suffix identifies the executable using it, if many. -Main function(s), are called: _main[_*] where the possible suffix identifies the executable using it Signed-off-by: Christophe Milard --- .../classification/odp_classification_basic.c | 34 +++++++++++----------- .../classification/odp_classification_tests.c | 30 +++++++++---------- .../classification/odp_classification_testsuites.h | 8 ++--- test/validation/odp_classification.c | 8 ++--- 4 files changed, 40 insertions(+), 40 deletions(-) diff --git a/test/validation/classification/odp_classification_basic.c b/test/validation/classification/odp_classification_basic.c index b327e35..99202ee 100644 --- a/test/validation/classification/odp_classification_basic.c +++ b/test/validation/classification/odp_classification_basic.c @@ -8,7 +8,7 @@ #define PMR_SET_NUM 5 -static void classification_create_cos(void) +static void classification_test_create_cos(void) { odp_cos_t cos; char name[ODP_COS_NAME_LEN]; @@ -19,7 +19,7 @@ static void classification_create_cos(void) odp_cos_destroy(cos); } -static void classification_destroy_cos(void) +static void classification_test_destroy_cos(void) { odp_cos_t cos; char name[ODP_COS_NAME_LEN]; @@ -33,7 +33,7 @@ static void classification_destroy_cos(void) CU_ASSERT(retval < 0); } -static void classification_create_pmr_match(void) +static void classification_test_create_pmr_match(void) { odp_pmr_t pmr; uint16_t val; @@ -46,7 +46,7 @@ static void classification_create_pmr_match(void) odp_pmr_destroy(pmr); } -static void classification_destroy_pmr(void) +static void classification_test_destroy_pmr(void) { odp_pmr_t pmr; uint16_t val; @@ -62,7 +62,7 @@ static void classification_destroy_pmr(void) CU_ASSERT(retval < 0); } -static void classification_cos_set_queue(void) +static void classification_test_cos_set_queue(void) { int retval; char cosname[ODP_COS_NAME_LEN]; @@ -87,7 +87,7 @@ static void classification_cos_set_queue(void) odp_queue_destroy(queue_cos); } -static void classification_cos_set_drop(void) +static void classification_test_cos_set_drop(void) { int retval; char cosname[ODP_COS_NAME_LEN]; @@ -103,7 +103,7 @@ static void classification_cos_set_drop(void) odp_cos_destroy(cos_drop); } -static void classification_pmr_match_set_create(void) +static void classification_test_pmr_match_set_create(void) { odp_pmr_set_t pmr_set; int retval; @@ -127,7 +127,7 @@ static void classification_pmr_match_set_create(void) CU_ASSERT(retval == 0); } -static void classification_pmr_match_set_destroy(void) +static void classification_test_pmr_match_set_destroy(void) { odp_pmr_set_t pmr_set; int retval; @@ -153,14 +153,14 @@ static void classification_pmr_match_set_destroy(void) CU_ASSERT(retval == 0); } -CU_TestInfo classification_basic[] = { - _CU_TEST_INFO(classification_create_cos), - _CU_TEST_INFO(classification_destroy_cos), - _CU_TEST_INFO(classification_create_pmr_match), - _CU_TEST_INFO(classification_destroy_pmr), - _CU_TEST_INFO(classification_cos_set_queue), - _CU_TEST_INFO(classification_cos_set_drop), - _CU_TEST_INFO(classification_pmr_match_set_create), - _CU_TEST_INFO(classification_pmr_match_set_destroy), +CU_TestInfo classification_suite_basic[] = { + _CU_TEST_INFO(classification_test_create_cos), + _CU_TEST_INFO(classification_test_destroy_cos), + _CU_TEST_INFO(classification_test_create_pmr_match), + _CU_TEST_INFO(classification_test_destroy_pmr), + _CU_TEST_INFO(classification_test_cos_set_queue), + _CU_TEST_INFO(classification_test_cos_set_drop), + _CU_TEST_INFO(classification_test_pmr_match_set_create), + _CU_TEST_INFO(classification_test_pmr_match_set_destroy), CU_TEST_INFO_NULL, }; diff --git a/test/validation/classification/odp_classification_tests.c b/test/validation/classification/odp_classification_tests.c index 9bc4c1d..502105e 100644 --- a/test/validation/classification/odp_classification_tests.c +++ b/test/validation/classification/odp_classification_tests.c @@ -267,7 +267,7 @@ odp_packet_t create_packet(bool vlan) return pkt; } -int classification_tests_init(void) +int classification_suite_init(void) { odp_pool_t pool; odp_pool_param_t param; @@ -323,7 +323,7 @@ int classification_tests_init(void) return 0; } -int classification_tests_finalize(void) +int classification_suite_term(void) { int i; int retcode = 0; @@ -564,7 +564,7 @@ void test_pktio_error_cos(void) odp_packet_free(pkt); } -static void classification_pktio_set_skip(void) +static void classification_test_pktio_set_skip(void) { int retval; size_t offset = 5; @@ -581,7 +581,7 @@ static void classification_pktio_set_skip(void) CU_ASSERT(retval == 0); } -static void classification_pktio_set_headroom(void) +static void classification_test_pktio_set_headroom(void) { size_t headroom; int retval; @@ -793,7 +793,7 @@ void test_pktio_pmr_match_set_cos(void) odp_packet_free(pkt); } -static void classification_pmr_terms_avail(void) +static void classification_test_pmr_terms_avail(void) { int retval; /* Since this API called at the start of the suite the return value @@ -802,7 +802,7 @@ static void classification_pmr_terms_avail(void) CU_ASSERT(retval > 0); } -static void classification_pmr_terms_cap(void) +static void classification_test_pmr_terms_cap(void) { unsigned long long retval; /* Need to check different values for different platforms */ @@ -810,7 +810,7 @@ static void classification_pmr_terms_cap(void) CU_ASSERT(retval | (1 << ODP_PMR_IPPROTO)); } -static void classification_pktio_configure(void) +static void classification_test_pktio_configure(void) { /* Configure the Different CoS for the pktio interface */ if (TEST_DEFAULT) @@ -827,7 +827,7 @@ static void classification_pktio_configure(void) configure_pktio_pmr_match_set_cos(); } -static void classification_pktio_test(void) +static void classification_test_pktio_test(void) { /* Test Different CoS on the pktio interface */ if (TEST_DEFAULT) @@ -844,12 +844,12 @@ static void classification_pktio_test(void) test_pktio_pmr_match_set_cos(); } -CU_TestInfo classification_tests[] = { - _CU_TEST_INFO(classification_pmr_terms_avail), - _CU_TEST_INFO(classification_pktio_set_skip), - _CU_TEST_INFO(classification_pktio_set_headroom), - _CU_TEST_INFO(classification_pmr_terms_cap), - _CU_TEST_INFO(classification_pktio_configure), - _CU_TEST_INFO(classification_pktio_test), +CU_TestInfo classification_suite[] = { + _CU_TEST_INFO(classification_test_pmr_terms_avail), + _CU_TEST_INFO(classification_test_pktio_set_skip), + _CU_TEST_INFO(classification_test_pktio_set_headroom), + _CU_TEST_INFO(classification_test_pmr_terms_cap), + _CU_TEST_INFO(classification_test_pktio_configure), + _CU_TEST_INFO(classification_test_pktio_test), CU_TEST_INFO_NULL, }; diff --git a/test/validation/classification/odp_classification_testsuites.h b/test/validation/classification/odp_classification_testsuites.h index c4c9ecd..f603f30 100644 --- a/test/validation/classification/odp_classification_testsuites.h +++ b/test/validation/classification/odp_classification_testsuites.h @@ -14,11 +14,11 @@ /* Helper macro for CU_TestInfo initialization */ #define _CU_TEST_INFO(test_func) {#test_func, test_func} -extern CU_TestInfo classification_tests[]; -extern CU_TestInfo classification_basic[]; +extern CU_TestInfo classification_suite[]; +extern CU_TestInfo classification_suite_basic[]; -int classification_tests_init(void); -int classification_tests_finalize(void); +int classification_suite_init(void); +int classification_suite_term(void); odp_packet_t create_packet(bool vlan); void configure_pktio_default_cos(void); diff --git a/test/validation/odp_classification.c b/test/validation/odp_classification.c index 31c885d..69cdd4b 100644 --- a/test/validation/odp_classification.c +++ b/test/validation/odp_classification.c @@ -10,12 +10,12 @@ static CU_SuiteInfo classification_suites[] = { { .pName = "classification basic", - .pTests = classification_basic, + .pTests = classification_suite_basic, }, { .pName = "classification tests", - .pTests = classification_tests, - .pInitFunc = classification_tests_init, - .pCleanupFunc = classification_tests_finalize, + .pTests = classification_suite, + .pInitFunc = classification_suite_init, + .pCleanupFunc = classification_suite_term, }, CU_SUITE_INFO_NULL, };