On 11/20/2014 08:18 PM, Madhusudan Venugopal wrote:
int main(void)
{
- CU_pSuite ptr_suite = NULL;
- /* initialize the CUnit test registry */
+ CU_pSuite p_suite;
+ CU_pTest ret;
+
if (CUE_SUCCESS != CU_initialize_registry())
return CU_get_error();
- /* add a suite to the registry */
- ptr_suite = CU_add_suite(__FILE__, init, finalise);
- if (NULL == ptr_suite) {
+
+ p_suite = CU_add_suite(__FILE__, init, NULL);
+ if (!p_suite) {
CU_cleanup_registry();
return CU_get_error();
}
- /* add the tests to the suite */
- if (NULL == CU_ADD_TEST(ptr_suite, test_odp_init_global)) {
+
+ ret = CU_ADD_TEST(p_suite, test_odp_init_global);
+ if (!ret) {
CU_cleanup_registry();
return CU_get_error();
}
- /* Run all tests using the CUnit Basic interface */
+
+ ret = CU_ADD_TEST(p_suite, odp_init_local_singlethread_sunnyday);
+ if (!ret) {
+ CU_cleanup_registry();
+ return CU_get_error();
+ }
+
+ ret = CU_ADD_TEST(p_suite, odp_init_local_thread_per_core_sunnyday);
+ if (!ret) {
+ CU_cleanup_registry();
+ return CU_get_error();
+ }
If there are more than a two tests, then CU_register_suites() API looks
cleaner than adding tests one by one.
_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp