8 size_t instances
= 16384;
9 #define X0 "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d"
10 const char *item
= "\na\nabbcd55";
11 #define X3 X0 X0 X0 X0 X0 X0 X0 X0
12 #define X6 X3 X3 X3 X3 X3 X3 X3 X3
13 #define X9 X6 X6 X6 X6 X6 X6 X6 X6
14 #define X12 X9 X9 X9 X9 X9 X9 X9 X9
15 #define X14 X12 X12 X12 X12
16 #define TRAILER "%%%%%%%%%%%%%%%%%%%%%%%%%%"
17 #define TRAILER2 TRAILER TRAILER
18 size_t length
= instances
* strlen (item
) + strlen (TRAILER
) + 1;
20 char *buf
= malloc (length
+ 1);
21 snprintf (buf
, length
+ 1,
23 "a", "b", "c", "d", 5);
27 for (i
= 0; i
< instances
; ++i
)
30 for (expected
= item
; *expected
; ++expected
)
34 printf ("mismatch at offset %zu (%zu): expected %d, got %d\n",
35 (size_t) (p
- buf
), i
, *expected
& 0xFF, *p
& 0xFF);
41 if (strcmp (p
, TRAILER
"\n") != 0)
43 printf ("mismatch at trailer: [%s]\n", p
);
49 #define TEST_FUNCTION do_test ()
50 #include "../test-skeleton.c"