File: x_output

package info (click to toggle)
check 0.15.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,404 kB
  • sloc: ansic: 11,759; sh: 5,258; makefile: 334
file content (43 lines) | stat: -rw-r--r-- 784 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
 * DO NOT EDIT THIS FILE. Generated by checkmk.
 * Edit the original source file "in" instead.
 */

#include <check.h>

#line 1 "in"
/* A complete test example */

#include <stdio.h>



START_TEST(the_test)
{
#line 10
    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;
}