fix tables
[nobug.git] / tests / test_nobug_coverage.c
blobb9051611eb43521e5e4be0bf185b49268c383454
1 #include "test.h"
2 #include "nobug.h"
5 NOBUG_DEFINE_FLAG(coverage);
8 int second()
10 return COVERAGE_GOODBAD (coverage, 1, 0);
13 int
14 first()
16 if (COVERAGE_GOODBAD (coverage, 1, 0))
17 return second();
18 else
19 return 1;
24 TESTS_BEGIN
25 NOBUG_INIT_FLAG(coverage);
28 TEST(basic)
30 COVERAGE_FAULT (coverage, return 1);
31 printf("%s\n", COVERAGE_GOODBAD (coverage, "success", "fail"));
33 first();
35 return 0;
39 TEST(disabled)
42 COVERAGE_FAULT (coverage, return 1);
44 COVERAGE_DISABLE;
46 first();
48 COVERAGE_ENABLE;
50 printf("%s\n", COVERAGE_GOODBAD (coverage, "success", "fail"));
52 return 0;
55 TESTS_END