add first test suite to test_linked_list.c

Sun, 14 Feb 2021 11:31:13 +0100

author
Mike Becker <universe@uap-core.de>
date
Sun, 14 Feb 2021 11:31:13 +0100
changeset 411
2842f729caab
parent 410
76b76f0f046b
child 412
af766caea48d

add first test suite to test_linked_list.c

test/test_linked_list.c file | annotate | diff | comparison | revisions
--- a/test/test_linked_list.c	Sun Feb 14 11:30:47 2021 +0100
+++ b/test/test_linked_list.c	Sun Feb 14 11:31:13 2021 +0100
@@ -27,9 +27,40 @@
  */
 
 #include "cx/linked_list.h"
+#include "test_config.h"
 
-#include <CUnit/Basic.h>
+void test_linked_list_wrap() {
+    CU_FAIL("test not implemented")
+}
 
 int main() {
-    return 0;
+    CU_pSuite suite = NULL;
+
+    if (CUE_SUCCESS != CU_initialize_registry()) {
+        return CU_get_error();
+    }
+
+    suite = CU_add_suite("linked list creation", NULL, NULL);
+    if (NULL == suite) {
+        CU_cleanup_registry();
+        return CU_get_error();
+    }
+
+    if (
+            !CU_add_test(suite, "wrapping of custom linked list", test_linked_list_wrap)
+            ) {
+        CU_cleanup_registry();
+        return CU_get_error();
+    }
+
+    CU_basic_set_mode(UCX_CU_BRM);
+
+    int exitcode;
+    if (CU_basic_run_tests()) {
+        exitcode = CU_get_error();
+    } else {
+        exitcode = CU_get_number_of_failures() == 0 ? 0 : 1;
+    }
+    CU_cleanup_registry();
+    return exitcode;
 }

mercurial