Tue, 28 Sep 2021 18:05:52 +0200
remove error handling from tests
test/test_allocator.c | file | annotate | diff | comparison | revisions | |
test/test_list.c | file | annotate | diff | comparison | revisions | |
test/test_tree.c | file | annotate | diff | comparison | revisions |
1.1 --- a/test/test_allocator.c Tue Sep 28 18:03:10 2021 +0200 1.2 +++ b/test/test_allocator.c Tue Sep 28 18:05:52 2021 +0200 1.3 @@ -80,22 +80,13 @@ 1.4 } 1.5 1.6 suite = CU_add_suite("default allocator", NULL, NULL); 1.7 - if (NULL == suite) { 1.8 - CU_cleanup_registry(); 1.9 - return CU_get_error(); 1.10 - } 1.11 1.12 - if ( 1.13 - !CU_add_test(suite, "default allocator available", test_default_allocator_available) || 1.14 - !CU_add_test(suite, "test of malloc()", test_default_malloc)|| 1.15 - !CU_add_test(suite, "test of realloc()", test_default_realloc) || 1.16 - !CU_add_test(suite, "test of realloc() via cxReallocate", test_default_reallocate) || 1.17 - !CU_add_test(suite, "test of calloc()", test_default_calloc) || 1.18 - !CU_add_test(suite, "test of free()", test_default_free) 1.19 - ) { 1.20 - CU_cleanup_registry(); 1.21 - return CU_get_error(); 1.22 - } 1.23 + CU_add_test(suite, "default allocator available", test_default_allocator_available); 1.24 + CU_add_test(suite, "test of malloc()", test_default_malloc); 1.25 + CU_add_test(suite, "test of realloc()", test_default_realloc); 1.26 + CU_add_test(suite, "test of realloc() via cxReallocate", test_default_reallocate); 1.27 + CU_add_test(suite, "test of calloc()", test_default_calloc); 1.28 + CU_add_test(suite, "test of free()", test_default_free); 1.29 1.30 CU_basic_set_mode(UCX_CU_BRM); 1.31
2.1 --- a/test/test_list.c Tue Sep 28 18:03:10 2021 +0200 2.2 +++ b/test/test_list.c Tue Sep 28 18:05:52 2021 +0200 2.3 @@ -173,34 +173,10 @@ 2.4 } 2.5 2.6 suite = CU_add_suite("linked list suite", NULL, NULL); 2.7 - if (NULL == suite) { 2.8 - CU_cleanup_registry(); 2.9 - return CU_get_error(); 2.10 - } 2.11 - 2.12 - if ( 2.13 - !CU_add_test(suite, "linked list: create and destroy", test_linked_list_create) || 2.14 - !CU_add_test(suite, "linked list: get node at index", test_linked_list_at) || 2.15 - !CU_add_test(suite, "linked list: add", test_cx_linked_list_add) 2.16 - ) { 2.17 - CU_cleanup_registry(); 2.18 - return CU_get_error(); 2.19 - } 2.20 - 2.21 - suite = CU_add_suite("array suite", NULL, NULL); 2.22 - if (NULL == suite) { 2.23 - CU_cleanup_registry(); 2.24 - return CU_get_error(); 2.25 - } 2.26 - 2.27 - /* 2.28 - if ( 2.29 - !CU_add_test(suite, "array...", test_array...) 2.30 - ) { 2.31 - CU_cleanup_registry(); 2.32 - return CU_get_error(); 2.33 - } 2.34 - */ 2.35 + 2.36 + CU_add_test(suite, "linked list: create and destroy", test_linked_list_create); 2.37 + CU_add_test(suite, "linked list: get node at index", test_linked_list_at); 2.38 + CU_add_test(suite, "linked list: add", test_cx_linked_list_add); 2.39 2.40 CU_basic_set_mode(UCX_CU_BRM); 2.41
3.1 --- a/test/test_tree.c Tue Sep 28 18:03:10 2021 +0200 3.2 +++ b/test/test_tree.c Tue Sep 28 18:05:52 2021 +0200 3.3 @@ -167,23 +167,9 @@ 3.4 } 3.5 3.6 suite = CU_add_suite("tree suite", NULL, NULL); 3.7 - if (NULL == suite) { 3.8 - CU_cleanup_registry(); 3.9 - return CU_get_error(); 3.10 - } 3.11 3.12 - if ( 3.13 - !CU_add_test(suite, "ll add tree node", test_cx_tree_add_node) 3.14 - ) { 3.15 - CU_cleanup_registry(); 3.16 - return CU_get_error(); 3.17 - } 3.18 - if ( 3.19 - !CU_add_test(suite, "ll add tree child node", test_cx_tree_add_child_node) 3.20 - ) { 3.21 - CU_cleanup_registry(); 3.22 - return CU_get_error(); 3.23 - } 3.24 + CU_add_test(suite, "ll add tree node", test_cx_tree_add_node); 3.25 + CU_add_test(suite, "ll add tree child node", test_cx_tree_add_child_node); 3.26 3.27 3.28 CU_basic_set_mode(UCX_CU_BRM);