Signed-off-by: Maxim Uvarov <[email protected]>
---
 test/validation/odp_pktio.c | 50 ++++++++++++++++++++++-----------------------
 1 file changed, 24 insertions(+), 26 deletions(-)

diff --git a/test/validation/odp_pktio.c b/test/validation/odp_pktio.c
index 67dd8d0..cfdf3f8 100644
--- a/test/validation/odp_pktio.c
+++ b/test/validation/odp_pktio.c
@@ -108,14 +108,34 @@ static void test_pktio_promisc(void)
        return;
 }
 
+static CU_TestInfo test_mac[] = {
+       {"mac", test_pktio_mac },
+       CU_TEST_INFO_NULL,
+};
+
+static CU_TestInfo test_mtu[] = {
+       {"mtu", test_pktio_mtu },
+       CU_TEST_INFO_NULL,
+};
+
+static CU_TestInfo test_promisc[] = {
+       {"promisc", test_pktio_promisc },
+       CU_TEST_INFO_NULL,
+};
+
+CU_SuiteInfo suites[] = {
+       { "MAC" , NULL, NULL, NULL, NULL, test_mac },
+       { "MTU" , NULL, NULL, NULL, NULL, test_mtu },
+       { "PROMISC" , NULL, NULL, NULL, NULL, test_promisc },
+       CU_SUITE_INFO_NULL,
+};
+
 int main(void)
 {
        odp_shm_t shm;
        void *pool_base;
        odp_buffer_pool_t pool;
        odp_queue_t out_queue;
-       CU_pSuite ptr_suite;
-       CU_pTest ptest;
 
        if (odp_init_global(NULL, NULL)) {
                printf("ODP global init failed.\n");
@@ -180,30 +200,8 @@ int main(void)
        if (CUE_SUCCESS != CU_initialize_registry())
                return CU_get_error();
 
-       /* add a suite to the registry */
-       ptr_suite = CU_add_suite(__FILE__, NULL, NULL);
-       if (NULL == ptr_suite) {
-               CU_cleanup_registry();
-               return CU_get_error();
-       }
-
-       ptest = CU_ADD_TEST(ptr_suite, test_pktio_mtu);
-       if (NULL == ptest) {
-               CU_cleanup_registry();
-               return CU_get_error();
-       }
-
-       ptest = CU_ADD_TEST(ptr_suite, test_pktio_promisc);
-       if (NULL == ptest) {
-               CU_cleanup_registry();
-               return CU_get_error();
-       }
-
-       ptest = CU_ADD_TEST(ptr_suite, test_pktio_mac);
-       if (NULL == ptest) {
-               CU_cleanup_registry();
-               return CU_get_error();
-       }
+       /* register suites */
+       CU_register_suites(suites);
 
        /* Run all tests using the CUnit Basic interface */
        CU_basic_set_mode(CU_BRM_VERBOSE);
-- 
1.8.5.1.163.gd7aced9


_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to