@@ -8,9 +8,6 @@
#include "odp_cunit_common.h"
#include "buffer.h"
-/* Helper macro for CU_TestInfo initialization */
-#define _CU_TEST_INFO(test_func) {#test_func, test_func}
-
static odp_pool_t raw_pool;
static odp_buffer_t raw_buffer = ODP_BUFFER_INVALID;
static const size_t raw_buffer_size = 1500;
@@ -4,6 +4,7 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <odp_cunit_common.h>
#include "odp_classification_testsuites.h"
#define PMR_SET_NUM 5
@@ -11,9 +11,6 @@
#include <CUnit/CUnit.h>
#include <CUnit/Basic.h>
-/* Helper macro for CU_TestInfo initialization */
-#define _CU_TEST_INFO(test_func) {#test_func, test_func}
-
extern CU_TestInfo classification_suite[];
extern CU_TestInfo classification_suite_basic[];
@@ -21,6 +21,9 @@
/* the function, called by module main(), to run the testsuites: */
int odp_cunit_run(CU_SuiteInfo testsuites[]);
+/* the macro used to have test names (strings) matching function symbols */
+#define _CU_TEST_INFO(test_func) {#test_func, test_func}
+
typedef struct {
uint32_t foo;
uint32_t bar;
@@ -10,9 +10,6 @@
#include "odp_cunit_common.h"
#include "packet.h"
-/* Helper macro for CU_TestInfo initialization */
-#define _CU_TEST_INFO(test_func) {#test_func, test_func}
-
#define PACKET_BUF_LEN ODP_CONFIG_PACKET_SEG_LEN_MIN
/* Reserve some tailroom for tests */
#define PACKET_TAILROOM_RESERVE 4
@@ -99,8 +99,6 @@ static void pool_test_lookup_info_print(void)
CU_ASSERT(odp_pool_destroy(pool) == 0);
}
-#define _CU_TEST_INFO(test_func) {#test_func, test_func}
-
static CU_TestInfo pool_suite[] = {
_CU_TEST_INFO(pool_test_create_destroy_buffer),
_CU_TEST_INFO(pool_test_create_destroy_packet),
@@ -8,9 +8,6 @@
#include <odp_cunit_common.h>
#include "random.h"
-/* Helper macro for CU_TestInfo initialization */
-#define _CU_TEST_INFO(test_func) {#test_func, test_func}
-
static void random_test_get_size(void)
{
int32_t ret;
@@ -10,9 +10,6 @@
#include <test_debug.h>
#include "thread.h"
-/* Helper macro for CU_TestInfo initialization */
-#define _CU_TEST_INFO(test_func) {#test_func, test_func}
-
/* Test thread entry and exit synchronization barriers */
odp_barrier_t bar_entry;
odp_barrier_t bar_exit;
The macro _CU_TEST_INFO (used ensure a match between test function names and test names (strings)) is now defined in .../common/odp_cunit_common.h as it is common to many API module tests. Local definitions are also removed. Signed-off-by: Christophe Milard <christophe.milard@linaro.org> --- test/validation/buffer/buffer.c | 3 --- test/validation/classification/odp_classification_basic.c | 1 + test/validation/classification/odp_classification_testsuites.h | 3 --- test/validation/common/odp_cunit_common.h | 3 +++ test/validation/packet/packet.c | 3 --- test/validation/pool/pool.c | 2 -- test/validation/random/random.c | 3 --- test/validation/thread/thread.c | 3 --- 8 files changed, 4 insertions(+), 17 deletions(-)