From patchwork Tue Jun 23 09:21:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 50205 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A91FE21575 for ; Tue, 23 Jun 2015 09:23:33 +0000 (UTC) Received: by wiws10 with SMTP id s10sf3283713wiw.2 for ; Tue, 23 Jun 2015 02:23:32 -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=Cq8N6xjmQAOeZjSwJ9w9um+aRtmJgtZgSP8JmPXdXlAqFkDl23xjDIBlEDPPORlrJK i4DFhqHGXb6JzouVNY1J5m5c08IaUh9QW3hVAyf3pi+BDZ0zxhHjaH/Rx1PUOPA0AVDX Fk/tvR4L+1AL6+/+aypPb53Ar+Mbf6QdtQzqxPi+vxJeNF+1ADRWdeIT5vu96aQRXxx7 DPtovw/L4CRTyj+1KlRK0KFu88uI2ep4Pgyg/n0JW2aI3Ic0+AMt5cFzD9hFQIt307SR yBk41Zv4YdOuvyVs7XoHxBJK3Aoh7YsT5YqqXU7S1dJ3gSp4FkmjHVqa+jR3dtAeV3ii 3SdQ== X-Gm-Message-State: ALoCoQlWDkIV2R+22BO/BU2dtmZTYIaKNg4jBiipjw6B2lnC3QCxEVk8ATMNaL4+iQ4m0sQ3HONd X-Received: by 10.112.9.100 with SMTP id y4mr31489357lba.20.1435051412935; Tue, 23 Jun 2015 02:23:32 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.136 with SMTP id q8ls24040laj.91.gmail; Tue, 23 Jun 2015 02:23:32 -0700 (PDT) X-Received: by 10.152.23.167 with SMTP id n7mr34274315laf.108.1435051412641; Tue, 23 Jun 2015 02:23:32 -0700 (PDT) Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com. [209.85.217.174]) by mx.google.com with ESMTPS id k11si18816884lbz.74.2015.06.23.02.23.32 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Jun 2015 02:23:32 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.174 as permitted sender) client-ip=209.85.217.174; Received: by lbbvz5 with SMTP id vz5so2747895lbb.0 for ; Tue, 23 Jun 2015 02:23:32 -0700 (PDT) X-Received: by 10.152.36.102 with SMTP id p6mr6742274laj.19.1435051412534; Tue, 23 Jun 2015 02:23:32 -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 hn6csp2938722lbb; Tue, 23 Jun 2015 02:23:31 -0700 (PDT) X-Received: by 10.52.53.10 with SMTP id x10mr30003916vdo.36.1435051410561; Tue, 23 Jun 2015 02:23:30 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id ru14si21224827vdb.79.2015.06.23.02.23.29; Tue, 23 Jun 2015 02:23:30 -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 8EEA361F50; Tue, 23 Jun 2015 09:23:29 +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 1183F61F4E; Tue, 23 Jun 2015 09:22: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 C0E5761EFC; Tue, 23 Jun 2015 09:21:53 +0000 (UTC) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com [209.85.217.170]) by lists.linaro.org (Postfix) with ESMTPS id 54FD361EEA for ; Tue, 23 Jun 2015 09:21:51 +0000 (UTC) Received: by lbnk3 with SMTP id k3so2712756lbn.1 for ; Tue, 23 Jun 2015 02:21:50 -0700 (PDT) X-Received: by 10.152.25.227 with SMTP id f3mr33304954lag.67.1435051310278; Tue, 23 Jun 2015 02:21:50 -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 lf2sm3666258lac.39.2015.06.23.02.21.48 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 23 Jun 2015 02:21:49 -0700 (PDT) From: Christophe Milard To: anders.roxell@linaro.org, mike.holmes@linaro.org, stuart.haslam@linaro.org, maxim.uvarov@linaro.org Date: Tue, 23 Jun 2015 11:21:28 +0200 Message-Id: <1435051290-24369-4-git-send-email-christophe.milard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1435051290-24369-1-git-send-email-christophe.milard@linaro.org> References: <1435051290-24369-1-git-send-email-christophe.milard@linaro.org> X-Topics: Classification patch Cc: lng-odp@lists.linaro.org Subject: [lng-odp] [PATCHv3 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.174 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, };