27 */ |
27 */ |
28 |
28 |
29 #include "cx/test.h" |
29 #include "cx/test.h" |
30 |
30 |
31 CxTestSuite *cx_test_suite_utils(void); |
31 CxTestSuite *cx_test_suite_utils(void); |
|
32 CxTestSuite *cx_test_suite_hash_key(void); |
32 |
33 |
33 #define run_tests(suite) cx_test_run_stdout(suite); success += (suite)->success; failure += (suite)->failure |
34 #define run_tests(suite) cx_test_run_stdout(suite); success += (suite)->success; failure += (suite)->failure |
34 |
35 |
35 int main(void) { |
36 int main(void) { |
36 printf("UCX Tests\n---------\n"); |
37 printf("UCX Tests\n---------\n"); |
37 |
38 |
38 unsigned success = 0, failure = 0; |
39 unsigned success = 0, failure = 0; |
39 |
40 |
40 // create test suites |
41 // create test suites |
41 CxTestSuite |
42 CxTestSuite |
42 *utils = cx_test_suite_utils(); |
43 *utils = cx_test_suite_utils(), |
|
44 *hash_key = cx_test_suite_hash_key(); |
43 |
45 |
44 // run tests |
46 // run tests |
45 run_tests(utils); |
47 run_tests(utils); |
|
48 run_tests(hash_key); |
46 |
49 |
47 // print overall result |
50 // print overall result |
48 printf("\n\n*** OVERALL RESULT ***\n"); |
51 printf("=== OVERALL RESULT ===\n"); |
49 printf(" Total: %u\n Success: %u\n Failure: %u\n", |
52 printf(" Total: %u\n Success: %u\n Failure: %u\n", |
50 success + failure, success, failure); |
53 success + failure, success, failure); |
51 |
54 |
52 cx_test_suite_free(utils); |
55 cx_test_suite_free(utils); |
|
56 cx_test_suite_free(hash_key); |
53 |
57 |
54 return failure > 0 ? 1 : 0; |
58 return failure > 0 ? 1 : 0; |
55 } |
59 } |
56 |
60 |