[v2,1/7] validation: common: remove camel case names

Message ID 1518530410-18574-2-git-send-email-odpbot@yandex.ru
State New
Headers show
Series
  • [v2,1/7] validation: common: remove camel case names
Related show

Commit Message

Github ODP bot Feb. 13, 2018, 2 p.m.
From: Petri Savolainen <petri.savolainen@linaro.org>


Rename struct fields to not use camel case names.

Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org>

---
/** 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(-)

Patch

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,
 };