test_debug.c (819B)
1 #include <check.h> 2 #include <stdlib.h> 3 #include <llog.h> 4 5 #include "debug.h" 6 7 START_TEST(check_debug_novar) { 8 debug(LLOG_DEBUG, "test", "foo"); 9 debug_x(LLOG_DEBUG, "test", "foo", 1, MORGEL_TYP_STR, 0, "bar", "baz"); 10 debug_x(LLOG_DEBUG, "test", "foo", 1, MORGEL_TYP_BIN, 3, "inky", "pinky"); 11 debug_x(LLOG_DEBUG, "test", "foo", 1, MORGEL_TYP_NUM, 0, "xyzzy", 42); 12 } 13 END_TEST 14 15 Suite * common_suite(void) { 16 Suite *s; 17 TCase *tc; 18 19 s = suite_create("debug"); 20 tc = tcase_create("touch"); 21 tcase_add_test(tc, check_debug_novar); 22 suite_add_tcase(s, tc); 23 24 return s; 25 } 26 27 int main(void) { 28 int n_fail; 29 30 Suite *s; 31 SRunner *sr; 32 33 s = common_suite(); 34 sr = srunner_create(s); 35 36 srunner_run_all(sr, CK_VERBOSE); 37 n_fail = srunner_ntests_failed(sr); 38 srunner_free(sr); 39 40 return (n_fail == 0) ? EXIT_SUCCESS : EXIT_FAILURE; 41 }