mirror of
https://github.com/ioacademy-jikim/debugging
synced 2025-06-10 01:16:12 +00:00
42 lines
762 B
Plaintext
42 lines
762 B
Plaintext
/*
|
|
* DO NOT EDIT THIS FILE. Generated by checkmk.
|
|
* Edit the original source file "in" instead.
|
|
*/
|
|
|
|
#include <check.h>
|
|
|
|
/* A complete test example */
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
START_TEST(the_test)
|
|
{
|
|
int nc;
|
|
const char msg[] = "\n\n Hello, world!\n";
|
|
|
|
nc = printf("%s", msg);
|
|
fail_unless(nc == (sizeof msg
|
|
- 1) /* for terminating NUL. */
|
|
);
|
|
}
|
|
END_TEST
|
|
|
|
int main(void)
|
|
{
|
|
Suite *s1 = suite_create("The Suite");
|
|
TCase *tc1_1 = tcase_create("The Test Case");
|
|
SRunner *sr = srunner_create(s1);
|
|
int nf;
|
|
|
|
suite_add_tcase(s1, tc1_1);
|
|
tcase_add_test(tc1_1, the_test);
|
|
|
|
srunner_run_all(sr, CK_ENV);
|
|
nf = srunner_ntests_failed(sr);
|
|
srunner_free(sr);
|
|
|
|
return nf == 0 ? 0 : 1;
|
|
}
|