test/main.c

changeset 28
1666cbeb1db8
parent 27
22644e2572bc
child 29
bce0d7f2912b
equal deleted inserted replaced
27:22644e2572bc 28:1666cbeb1db8
62 } 62 }
63 63
64 int main(int argc, char **argv) { 64 int main(int argc, char **argv) {
65 printf("UCX Tests\n---------\n"); 65 printf("UCX Tests\n---------\n");
66 66
67 printf("\nUcxTestSuite Tests (1 failure is intended!)\n"); 67 printf("\nUcxTestSuite tests (1 failure is intended!)\n");
68 UcxTestSuite* suite = ucx_test_suite_new(); 68 UcxTestSuite* suite = ucx_test_suite_new();
69 ucx_test_register(suite, testTestSuitePositive); 69 ucx_test_register(suite, testTestSuitePositive);
70 ucx_test_register(suite, testTestSuiteNegative); 70 ucx_test_register(suite, testTestSuiteNegative);
71 ucx_test_run(suite, stdout); 71 ucx_test_run(suite, stdout);
72 if (suite->failure == 1 && suite->success == 1) { 72 if (suite->failure == 1 && suite->success == 1) {
73 ucx_test_suite_free(suite); 73 ucx_test_suite_free(suite);
74 74
75 printf("\nLibrary function tests\n");
75 suite = ucx_test_suite_new(); 76 suite = ucx_test_suite_new();
76 /* UcxList Tests */ 77 /* UcxList Tests */
77 ucx_test_register(suite, test_ucx_list_append); 78 ucx_test_register(suite, test_ucx_list_append);
78 ucx_test_register(suite, test_ucx_list_prepend); 79 ucx_test_register(suite, test_ucx_list_prepend);
79 ucx_test_register(suite, test_ucx_list_equals); 80 ucx_test_register(suite, test_ucx_list_equals);
94 ucx_test_register(suite, test_ucx_dlist_last); 95 ucx_test_register(suite, test_ucx_dlist_last);
95 ucx_test_register(suite, test_ucx_dlist_get); 96 ucx_test_register(suite, test_ucx_dlist_get);
96 ucx_test_register(suite, test_ucx_dlist_remove); 97 ucx_test_register(suite, test_ucx_dlist_remove);
97 ucx_test_register(suite, test_ucx_dlist_clone); 98 ucx_test_register(suite, test_ucx_dlist_clone);
98 99
99 /* TODO: replace these tests with "real" tests */ 100 /* UcxMemPool Tests */
100 printf("\nUcxMemPool Tests\n"); 101 ucx_test_register(suite, test_ucx_mempool_new);
101 if(mpool_tests()) { 102 ucx_test_register(suite, test_ucx_mempool_malloc);
102 fprintf(stderr, "mpool_tests failed\n"); 103 ucx_test_register(suite, test_ucx_mempool_malloc_with_chcap);
103 } 104 ucx_test_register(suite, test_ucx_mempool_calloc);
105 ucx_test_register(suite, test_ucx_mempool_set_destr);
106 ucx_test_register(suite, test_ucx_mempool_reg_destr);
107 ucx_test_register(suite, test_ucx_mempool_realloc);
104 108
105 printf("\nUcxMap Tests\n"); 109 printf("\nUcxMap Tests\n");
106 if(map_tests()) { 110 if(map_tests()) {
107 fprintf(stderr, "map_tests failed\n"); 111 fprintf(stderr, "map_tests failed\n");
108 } 112 }

mercurial