remove error handling from tests

Tue, 28 Sep 2021 18:05:52 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Tue, 28 Sep 2021 18:05:52 +0200
changeset 443
d6d8712e15bc
parent 442
310019ddfe4e
child 444
cb944fa1852a

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
--- a/test/test_allocator.c	Tue Sep 28 18:03:10 2021 +0200
+++ b/test/test_allocator.c	Tue Sep 28 18:05:52 2021 +0200
@@ -80,22 +80,13 @@
     }
 
     suite = CU_add_suite("default allocator", NULL, NULL);
-    if (NULL == suite) {
-        CU_cleanup_registry();
-        return CU_get_error();
-    }
 
-    if (
-            !CU_add_test(suite, "default allocator available", test_default_allocator_available) ||
-            !CU_add_test(suite, "test of malloc()", test_default_malloc)||
-            !CU_add_test(suite, "test of realloc()", test_default_realloc) ||
-            !CU_add_test(suite, "test of realloc() via cxReallocate", test_default_reallocate) ||
-            !CU_add_test(suite, "test of calloc()", test_default_calloc) ||
-            !CU_add_test(suite, "test of free()", test_default_free)
-            ) {
-        CU_cleanup_registry();
-        return CU_get_error();
-    }
+    CU_add_test(suite, "default allocator available", test_default_allocator_available);
+    CU_add_test(suite, "test of malloc()", test_default_malloc);
+    CU_add_test(suite, "test of realloc()", test_default_realloc);
+    CU_add_test(suite, "test of realloc() via cxReallocate", test_default_reallocate);
+    CU_add_test(suite, "test of calloc()", test_default_calloc);
+    CU_add_test(suite, "test of free()", test_default_free);
 
     CU_basic_set_mode(UCX_CU_BRM);
 
--- a/test/test_list.c	Tue Sep 28 18:03:10 2021 +0200
+++ b/test/test_list.c	Tue Sep 28 18:05:52 2021 +0200
@@ -173,34 +173,10 @@
     }
 
     suite = CU_add_suite("linked list suite", NULL, NULL);
-    if (NULL == suite) {
-        CU_cleanup_registry();
-        return CU_get_error();
-    }
-
-    if (
-            !CU_add_test(suite, "linked list: create and destroy", test_linked_list_create) ||
-            !CU_add_test(suite, "linked list: get node at index", test_linked_list_at) ||
-            !CU_add_test(suite, "linked list: add", test_cx_linked_list_add)
-            ) {
-        CU_cleanup_registry();
-        return CU_get_error();
-    }
-
-    suite = CU_add_suite("array suite", NULL, NULL);
-    if (NULL == suite) {
-        CU_cleanup_registry();
-        return CU_get_error();
-    }
-
-    /*
-    if (
-            !CU_add_test(suite, "array...", test_array...)
-            ) {
-        CU_cleanup_registry();
-        return CU_get_error();
-    }
-    */
+    
+    CU_add_test(suite, "linked list: create and destroy", test_linked_list_create);
+    CU_add_test(suite, "linked list: get node at index", test_linked_list_at);
+    CU_add_test(suite, "linked list: add", test_cx_linked_list_add);
 
     CU_basic_set_mode(UCX_CU_BRM);
 
--- a/test/test_tree.c	Tue Sep 28 18:03:10 2021 +0200
+++ b/test/test_tree.c	Tue Sep 28 18:05:52 2021 +0200
@@ -167,23 +167,9 @@
     }
 
     suite = CU_add_suite("tree suite", NULL, NULL);
-    if (NULL == suite) {
-        CU_cleanup_registry();
-        return CU_get_error();
-    }
 
-    if (
-            !CU_add_test(suite, "ll add tree node", test_cx_tree_add_node)
-            ) {
-        CU_cleanup_registry();
-        return CU_get_error();
-    }
-    if (
-            !CU_add_test(suite, "ll add tree child node", test_cx_tree_add_child_node)
-            ) {
-        CU_cleanup_registry();
-        return CU_get_error();
-    }
+    CU_add_test(suite, "ll add tree node", test_cx_tree_add_node);
+    CU_add_test(suite, "ll add tree child node", test_cx_tree_add_child_node);
     
     
     CU_basic_set_mode(UCX_CU_BRM);

mercurial