1/* Multiple everything... */
2
3#include <stdlib.h>
4#include <errno.h>
5#include <stdio.h>
6
7void print_message(const char *msg, size_t msgsz)
8{
9    int nc;
10
11    nc = printf("%s", msg);
12    fail_unless(nc == msgsz, "failed to print completely: %s",
13                strerror(errno));
14}
15
16# suite A Suite
17
18# tcase A Test Case
19
20# test hello_world
21    const char msg[] = "Hello, world!\n";
22    print_message(msg, sizeof msg - 1);
23
24# test neverending_story
25    const char msg[] = "Bastian Balthazar Bux\n";
26    print_message(msg, sizeof msg - 1);
27
28# tcase Another Test Case
29
30# test math_problem
31    fail_unless(1 + 1 == 2, "Something's broken...");
32
33# suite Another Suite
34
35# tcase A Test Case for Another Suite
36
37# test more_math
38    fail_unless(2/2 == 1, "Another weird math result");
39
40# tcase A Basket Case
41
42# test weave
43    int i;
44    const char msg[] = "###\n";
45
46    for (i=0; i != 3; ++i)
47        print_message(row, sizeof row - 1);
48