# HG changeset patch # User Mike Becker # Date 1613298673 -3600 # Node ID 2842f729caaba9d109204564210963698303125e # Parent 76b76f0f046b64b149cfe12d7497732f52f7771a add first test suite to test_linked_list.c diff -r 76b76f0f046b -r 2842f729caab test/test_linked_list.c --- 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 +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; }