From patchwork Tue Feb 13 14:00:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 128238 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp4283081ljc; Tue, 13 Feb 2018 06:02:25 -0800 (PST) X-Google-Smtp-Source: AH8x224Dy9flWUCmcF44RUqMXWrNL6GEeuclzZhoaDmfRY30OtJD6zstOOakK7Zm1kPaPyDlZoFl X-Received: by 10.200.35.188 with SMTP id q57mr1952206qtq.73.1518530545169; Tue, 13 Feb 2018 06:02:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518530545; cv=none; d=google.com; s=arc-20160816; b=l7vgkScu73e4wpgj1OfgkatBdUxGYbPARDokYALS/jsiR3FzTPFri+/PMec2n8GkfZ FqGT5vQus/+16gsrxNnP0L/seghAW7OMiuQkhTPyTMOUfA59tTuossOl0n3lv8nOPEZE zYZz5HJvxGSjfS5ZG0WYbV/0bEN0TUKvWYIIy5EdPtbsppEPoA132JBfS4o6v8yE8v5y QDws9vMTQJwLjJJL1r3JYJ503Rlx/nbzUJEQt8YRlRYZs8DXvhLEJT0303VtkqKRRC2L QXbabpsZUPFhWxLIrKP8CWhkzhZF/9+B8At3fPOcA1pqdbSJwZ3GTgSuhX28Bt24gYb0 Zpsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=YJ3UPXmlWO9msyHgfgGEuo+GvAtMg2U2KGIvpOkRvoM=; b=Psodq3Xk7/Bd13c4LV3bXvF8dAypV1RArZ73CPnGpOqGRyQGz7WCnWlE10CQ0zHPQJ eUOUZvjgAJ0hxewPDDITh50qtc2U6o6KdQkqTnQOWY40teZM+CIrXp4ixgVVoOUBCGEn bCcDhaIXfv96TGC4U+xraNQJMW2mGMtODR5u86FLNFiBtLolFv0ZubAEZ6sKyetkySoO n7r/WFPSfbmyMhjqVk3ifsrwjON+kLppaZ72TSGM7SsQSBe2hw9qRB1YgY59qO1cC5fq hA3g5CSvPFclgnObtXGjNRlGeOMukrs8PJ0IiPtghVZ+hzA4vJD7r1xAarwMIPF+UaxI RgVw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id u40si1792466qth.23.2018.02.13.06.02.24; Tue, 13 Feb 2018 06:02:25 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id A70E861758; Tue, 13 Feb 2018 14:02:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2 autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 302CA60C5D; Tue, 13 Feb 2018 14:00:35 +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 B62E1608F8; Tue, 13 Feb 2018 14:00:23 +0000 (UTC) Received: from forward101o.mail.yandex.net (forward101o.mail.yandex.net [37.140.190.181]) by lists.linaro.org (Postfix) with ESMTPS id C6E0A61511 for ; Tue, 13 Feb 2018 14:00:14 +0000 (UTC) Received: from mxback14g.mail.yandex.net (mxback14g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:93]) by forward101o.mail.yandex.net (Yandex) with ESMTP id 3E6F31343090 for ; Tue, 13 Feb 2018 17:00:13 +0300 (MSK) Received: from smtp1o.mail.yandex.net (smtp1o.mail.yandex.net [2a02:6b8:0:1a2d::25]) by mxback14g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id Ia8tPvDi9l-0DE8q8de; Tue, 13 Feb 2018 17:00:13 +0300 Received: by smtp1o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 6Ss5leStGE-0CFucFSL; Tue, 13 Feb 2018 17:00:12 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Tue, 13 Feb 2018 17:00:04 +0300 Message-Id: <1518530410-18574-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518530410-18574-1-git-send-email-odpbot@yandex.ru> References: <1518530410-18574-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 472 Subject: [lng-odp] [PATCH v2 1/7] validation: common: remove camel case names X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Petri Savolainen Rename struct fields to not use camel case names. Signed-off-by: Petri Savolainen --- /** Email created from pull request 472 (psavol:master-parser-validation) ** https://github.com/Linaro/odp/pull/472 ** Patch: https://github.com/Linaro/odp/pull/472.patch ** Base sha: 41b3fa2cd994a7ef68290a07dcde5564e4640847 ** Merge commit sha: 38d924655e8119f902e986011a477e1ad9094ab6 **/ test/common/odp_cunit_common.c | 52 +++++++++++----------- test/common/odp_cunit_common.h | 12 ++--- .../validation/api/classification/classification.c | 20 ++++----- test/validation/api/crypto/odp_crypto_test_inp.c | 4 +- test/validation/api/ipsec/ipsec.c | 4 +- test/validation/api/packet/packet.c | 8 ++-- test/validation/api/pool/pool.c | 4 +- 7 files changed, 52 insertions(+), 52 deletions(-) diff --git a/test/common/odp_cunit_common.c b/test/common/odp_cunit_common.c index 6e51388f5..d8a17a75e 100644 --- a/test/common/odp_cunit_common.c +++ b/test/common/odp_cunit_common.c @@ -126,8 +126,8 @@ static odp_suiteinfo_t *cunit_get_suite_info(const char *suite_name) { odp_suiteinfo_t *sinfo; - for (sinfo = global_testsuites; sinfo->pName; sinfo++) - if (strcmp(sinfo->pName, suite_name) == 0) + for (sinfo = global_testsuites; sinfo->name; sinfo++) + if (strcmp(sinfo->name, suite_name) == 0) return sinfo; return NULL; @@ -138,8 +138,8 @@ static odp_testinfo_t *cunit_get_test_info(odp_suiteinfo_t *sinfo, { odp_testinfo_t *tinfo; - for (tinfo = sinfo->pTests; tinfo->pName; tinfo++) - if (strcmp(tinfo->pName, test_name) == 0) + for (tinfo = sinfo->testinfo_tbl; tinfo->name; tinfo++) + if (strcmp(tinfo->name, test_name) == 0) return tinfo; return NULL; @@ -167,14 +167,14 @@ static int _cunit_suite_init(void) return -1; /* execute its init function */ - if (sinfo->pInitFunc) { - ret = sinfo->pInitFunc(); + if (sinfo->init_func) { + ret = sinfo->init_func(); if (ret) return ret; } /* run any configured conditional checks and mark inactive tests */ - for (tinfo = sinfo->pTests; tinfo->pName; tinfo++) { + for (tinfo = sinfo->testinfo_tbl; tinfo->name; tinfo++) { CU_pTest ptest; CU_ErrorCode err; @@ -182,7 +182,7 @@ static int _cunit_suite_init(void) continue; /* test is inactive, mark it as such */ - ptest = CU_get_test_by_name(tinfo->pName, cur_suite); + ptest = CU_get_test_by_name(tinfo->name, cur_suite); if (ptest) err = CU_set_test_active(ptest, CU_FALSE); else @@ -190,7 +190,7 @@ static int _cunit_suite_init(void) if (err != CUE_SUCCESS) { fprintf(stderr, "%s: failed to set test %s inactive\n", - __func__, tinfo->pName); + __func__, tinfo->name); return -1; } } @@ -211,15 +211,15 @@ static int cunit_register_suites(odp_suiteinfo_t testsuites[]) CU_pSuite suite; CU_pTest test; - for (sinfo = testsuites; sinfo->pName; sinfo++) { - suite = CU_add_suite(sinfo->pName, - _cunit_suite_init, sinfo->pCleanupFunc); + for (sinfo = testsuites; sinfo->name; sinfo++) { + suite = CU_add_suite(sinfo->name, + _cunit_suite_init, sinfo->term_func); if (!suite) return CU_get_error(); - for (tinfo = sinfo->pTests; tinfo->pName; tinfo++) { - test = CU_add_test(suite, tinfo->pName, - tinfo->pTestFunc); + for (tinfo = sinfo->testinfo_tbl; tinfo->name; tinfo++) { + test = CU_add_test(suite, tinfo->name, + tinfo->test_func); if (!test) return CU_get_error(); } @@ -235,7 +235,7 @@ static int cunit_update_test(CU_pSuite suite, CU_pTest test = NULL; CU_ErrorCode err; odp_testinfo_t *tinfo; - const char *test_name = updated_tinfo->pName; + const char *test_name = updated_tinfo->name; tinfo = cunit_get_test_info(sinfo, test_name); if (tinfo) @@ -247,7 +247,7 @@ static int cunit_update_test(CU_pSuite suite, return -1; } - err = CU_set_test_func(test, updated_tinfo->pTestFunc); + err = CU_set_test_func(test, updated_tinfo->test_func); if (err != CUE_SUCCESS) { fprintf(stderr, "%s: failed to update test func for %s\n", __func__, test_name); @@ -267,31 +267,31 @@ static int cunit_update_suite(odp_suiteinfo_t *updated_sinfo) odp_testinfo_t *tinfo; /* find previously registered suite with matching name */ - sinfo = cunit_get_suite_info(updated_sinfo->pName); + sinfo = cunit_get_suite_info(updated_sinfo->name); if (sinfo) { /* lookup the associated CUnit suite */ - suite = CU_get_suite_by_name(updated_sinfo->pName, + suite = CU_get_suite_by_name(updated_sinfo->name, CU_get_registry()); } if (!sinfo || !suite) { fprintf(stderr, "%s: unable to find existing suite named %s\n", - __func__, updated_sinfo->pName); + __func__, updated_sinfo->name); return -1; } - sinfo->pInitFunc = updated_sinfo->pInitFunc; - sinfo->pCleanupFunc = updated_sinfo->pCleanupFunc; + sinfo->init_func = updated_sinfo->init_func; + sinfo->term_func = updated_sinfo->term_func; - err = CU_set_suite_cleanupfunc(suite, updated_sinfo->pCleanupFunc); + err = CU_set_suite_cleanupfunc(suite, updated_sinfo->term_func); if (err != CUE_SUCCESS) { fprintf(stderr, "%s: failed to update cleanup func for %s\n", - __func__, updated_sinfo->pName); + __func__, updated_sinfo->name); return -1; } - for (tinfo = updated_sinfo->pTests; tinfo->pName; tinfo++) { + for (tinfo = updated_sinfo->testinfo_tbl; tinfo->name; tinfo++) { int ret; ret = cunit_update_test(suite, sinfo, tinfo); @@ -345,7 +345,7 @@ int odp_cunit_update(odp_suiteinfo_t testsuites[]) int ret = 0; odp_suiteinfo_t *sinfo; - for (sinfo = testsuites; sinfo->pName && ret == 0; sinfo++) + for (sinfo = testsuites; sinfo->name && ret == 0; sinfo++) ret = cunit_update_suite(sinfo); return ret; diff --git a/test/common/odp_cunit_common.h b/test/common/odp_cunit_common.h index 390e8f57b..f6d384321 100644 --- a/test/common/odp_cunit_common.h +++ b/test/common/odp_cunit_common.h @@ -23,16 +23,16 @@ typedef int (*cunit_test_check_active)(void); typedef struct { - const char *pName; - CU_TestFunc pTestFunc; + const char *name; + CU_TestFunc test_func; cunit_test_check_active check_active; } odp_testinfo_t; typedef struct { - const char *pName; - CU_InitializeFunc pInitFunc; - CU_CleanupFunc pCleanupFunc; - odp_testinfo_t *pTests; + const char *name; + CU_InitializeFunc init_func; + CU_CleanupFunc term_func; + odp_testinfo_t *testinfo_tbl; } odp_suiteinfo_t; static inline int odp_cunit_test_inactive(void) { return 0; } diff --git a/test/validation/api/classification/classification.c b/test/validation/api/classification/classification.c index a0d290ec5..ef621f72d 100644 --- a/test/validation/api/classification/classification.c +++ b/test/validation/api/classification/classification.c @@ -12,18 +12,18 @@ #include "classification.h" odp_suiteinfo_t classification_suites[] = { - { .pName = "classification basic", - .pTests = classification_suite_basic, + { .name = "classification basic", + .testinfo_tbl = classification_suite_basic, }, - { .pName = "classification pmr tests", - .pTests = classification_suite_pmr, - .pInitFunc = classification_suite_pmr_init, - .pCleanupFunc = classification_suite_pmr_term, + { .name = "classification pmr tests", + .testinfo_tbl = classification_suite_pmr, + .init_func = classification_suite_pmr_init, + .term_func = classification_suite_pmr_term, }, - { .pName = "classification tests", - .pTests = classification_suite, - .pInitFunc = classification_suite_init, - .pCleanupFunc = classification_suite_term, + { .name = "classification tests", + .testinfo_tbl = classification_suite, + .init_func = classification_suite_init, + .term_func = classification_suite_term, }, ODP_SUITE_INFO_NULL, }; diff --git a/test/validation/api/crypto/odp_crypto_test_inp.c b/test/validation/api/crypto/odp_crypto_test_inp.c index ad9784a69..df1c7b6f5 100644 --- a/test/validation/api/crypto/odp_crypto_test_inp.c +++ b/test/validation/api/crypto/odp_crypto_test_inp.c @@ -1230,14 +1230,14 @@ int crypto_suite_term(void) int i; int first = 1; - for (i = 0; crypto_suite[i].pName; i++) { + for (i = 0; crypto_suite[i].name; i++) { if (crypto_suite[i].check_active && crypto_suite[i].check_active() == ODP_TEST_INACTIVE) { if (first) { first = 0; printf("\n\n Inactive tests:\n"); } - printf(" %s\n", crypto_suite[i].pName); + printf(" %s\n", crypto_suite[i].name); } } return 0; diff --git a/test/validation/api/ipsec/ipsec.c b/test/validation/api/ipsec/ipsec.c index ea3cff052..b16f84ac9 100644 --- a/test/validation/api/ipsec/ipsec.c +++ b/test/validation/api/ipsec/ipsec.c @@ -789,14 +789,14 @@ static int ipsec_suite_term(odp_testinfo_t *suite) if (suite_context.pktio != ODP_PKTIO_INVALID) pktio_stop(suite_context.pktio); - for (i = 0; suite[i].pName; i++) { + for (i = 0; suite[i].name; i++) { if (suite[i].check_active && suite[i].check_active() == ODP_TEST_INACTIVE) { if (first) { first = 0; printf("\n\n Inactive tests:\n"); } - printf(" %s\n", suite[i].pName); + printf(" %s\n", suite[i].name); } } diff --git a/test/validation/api/packet/packet.c b/test/validation/api/packet/packet.c index 78ccbeaef..1188c683c 100644 --- a/test/validation/api/packet/packet.c +++ b/test/validation/api/packet/packet.c @@ -2703,10 +2703,10 @@ odp_testinfo_t packet_suite[] = { }; odp_suiteinfo_t packet_suites[] = { - { .pName = "packet tests", - .pTests = packet_suite, - .pInitFunc = packet_suite_init, - .pCleanupFunc = packet_suite_term, + { .name = "packet tests", + .testinfo_tbl = packet_suite, + .init_func = packet_suite_init, + .term_func = packet_suite_term, }, ODP_SUITE_INFO_NULL, }; diff --git a/test/validation/api/pool/pool.c b/test/validation/api/pool/pool.c index 84c17720d..3a2c74122 100644 --- a/test/validation/api/pool/pool.c +++ b/test/validation/api/pool/pool.c @@ -230,8 +230,8 @@ odp_testinfo_t pool_suite[] = { }; odp_suiteinfo_t pool_suites[] = { - { .pName = "Pool tests", - .pTests = pool_suite, + { .name = "Pool tests", + .testinfo_tbl = pool_suite, }, ODP_SUITE_INFO_NULL, };