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