| 1 |
/* |
| 2 |
* DO NOT EDIT THIS FILE. Generated by checkmk. |
| 3 |
* Edit the original source file "in" instead. |
| 4 |
*/ |
| 5 |
|
| 6 |
#include <check.h> |
| 7 |
|
| 8 |
#line 1 "in" |
| 9 |
/* Test that repeated suites/tcases are only disallowed when they've |
| 10 |
* actually been used in defining a test. */ |
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
#line 8 |
| 15 |
/* But no test... */ |
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
START_TEST(quuux) |
| 20 |
{ |
| 21 |
#line 15 |
| 22 |
const char msg[] = "Howdy doody!\n"; |
| 23 |
int nc = printf(msg); |
| 24 |
|
| 25 |
fail_unless(nc == sizeof msg - 1); |
| 26 |
|
| 27 |
} |
| 28 |
END_TEST |
| 29 |
|
| 30 |
|
| 31 |
START_TEST(huh) |
| 32 |
{ |
| 33 |
#line 25 |
| 34 |
fail_unless(ALLOWED_AFTER_ALL); |
| 35 |
} |
| 36 |
END_TEST |
| 37 |
|
| 38 |
int main(void) |
| 39 |
{ |
| 40 |
Suite *s1 = suite_create("Baz"); |
| 41 |
TCase *tc1_1 = tcase_create("Quux"); |
| 42 |
Suite *s2 = suite_create("Foo"); |
| 43 |
TCase *tc2_1 = tcase_create("Bar"); |
| 44 |
SRunner *sr = srunner_create(s1); |
| 45 |
int nf; |
| 46 |
|
| 47 |
suite_add_tcase(s1, tc1_1); |
| 48 |
tcase_add_test(tc1_1, quuux); |
| 49 |
suite_add_tcase(s2, tc2_1); |
| 50 |
tcase_add_test(tc2_1, huh); |
| 51 |
|
| 52 |
srunner_add_suite(sr, s2); |
| 53 |
|
| 54 |
srunner_run_all(sr, CK_ENV); |
| 55 |
nf = srunner_ntests_failed(sr); |
| 56 |
srunner_free(sr); |
| 57 |
|
| 58 |
return nf == 0 ? 0 : 1; |
| 59 |
} |