From patchwork Tue Feb 13 10:00:06 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: 128206 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp4084130ljc; Tue, 13 Feb 2018 02:01:32 -0800 (PST) X-Google-Smtp-Source: AH8x226/JPRSbQ8duu0YA5m2ABWgG/mf+DpeuyG+2ZAYGhkch4MFrYyCgFXZ2dUuHs2zTJukteEn X-Received: by 10.200.24.152 with SMTP id s24mr963023qtj.239.1518516092592; Tue, 13 Feb 2018 02:01:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518516092; cv=none; d=google.com; s=arc-20160816; b=0ma26jMrfXNg20IXgArN+QBrdHtbQjuTc1b++oQ9plOeJ9SEiKZv+lO3c/FnY+sjiq JhqKW0a/AcU9VgW3Ux2wgbD5nrA+gX4YFpfERczfNNv7bCjj6BbMh3UeDOWtQJxH7MfK BAUPpzgOBEGU0QSPydSjOlJEs8QUXVRnZHs2go8yyytjlUL945B69WAfh2Ffqp0pqI6z eY7frkhz+vg3HQVyzvY1ZDPaZStNztxqoMOlewlZjtAefQcLyjagIGxS6RDWKyVEnG1d GA6G7NQWnIMiKn61krma807xR5/YyfP9Q7rLlCsrEn2tDUbr4Prui1mnZwMLKw+PCe+m imGA== 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=jtMWplpXZLaiSye7l/n3VHQNlFk1HcUSlC96BPNAnAM=; b=ZenUMP7RUwp3xoyLVPJWaaM7pjCNHl+lC/M0r87IzZveAx2SSTMO9WuKzLMyTX23pA xTnKfjXqerucjULj4sHNRJYoItBkaW/4h0W4bIYbeir+lHJevuZLzlBFbksSc3KzOI+w ryY/RTCwRLlXLFm5OmUWLqQPlcZgiB+cqeDueeoFBbRkCEOtoxVw8YYHPdC8gBAnSs4t 2tc11g/J6xg+wmIDMniMCZO3GRcaoi6zP7MGwQirAJl6gviC81lWOs0BpvQLMWbUp83L Z9KgnLkjEPm8v5cMmjI0W5ZfoOrmoVqpaMGoZnQWaBLLbVeKRj1U7dD8JMmqpQVwrv8E w9qw== 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 m5si709598qkf.78.2018.02.13.02.01.32; Tue, 13 Feb 2018 02:01:32 -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 3F12361519; Tue, 13 Feb 2018 10:01:32 +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_H3, RCVD_IN_MSPIKE_WL 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 C1E88609D9; Tue, 13 Feb 2018 10:00:31 +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 3284E61773; Tue, 13 Feb 2018 10:00:15 +0000 (UTC) Received: from forward102j.mail.yandex.net (forward102j.mail.yandex.net [5.45.198.243]) by lists.linaro.org (Postfix) with ESMTPS id 183446172B for ; Tue, 13 Feb 2018 10:00:12 +0000 (UTC) Received: from mxback8j.mail.yandex.net (mxback8j.mail.yandex.net [IPv6:2a02:6b8:0:1619::111]) by forward102j.mail.yandex.net (Yandex) with ESMTP id 1AF735603952 for ; Tue, 13 Feb 2018 13:00:11 +0300 (MSK) Received: from smtp4j.mail.yandex.net (smtp4j.mail.yandex.net [2a02:6b8:0:1619::15:6]) by mxback8j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id uq5TmEtGjd-0A6OlZLc; Tue, 13 Feb 2018 13:00:11 +0300 Received: by smtp4j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 6ASWNO8Dvc-0AaWDWRY; Tue, 13 Feb 2018 13:00:10 +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 13:00:06 +0300 Message-Id: <1518516009-30109-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518516009-30109-1-git-send-email-odpbot@yandex.ru> References: <1518516009-30109-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 472 Subject: [lng-odp] [PATCH v1 1/4] 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: aa702da6919f7e56a6ed59d3120233c97590b4f1 **/ 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, };