lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | #include <stdio.h> |
| 2 | #include <string.h> |
| 3 | #include <stdlib.h> |
| 4 | |
| 5 | static const char expected[] = "\ |
| 6 | \n\ |
| 7 | a\n\ |
| 8 | abbcd55\ |
| 9 | \n\ |
| 10 | a\n\ |
| 11 | abbcd55\ |
| 12 | \n\ |
| 13 | a\n\ |
| 14 | abbcd55\ |
| 15 | \n\ |
| 16 | a\n\ |
| 17 | abbcd55\ |
| 18 | \n\ |
| 19 | a\n\ |
| 20 | abbcd55\ |
| 21 | \n\ |
| 22 | a\n\ |
| 23 | abbcd55\ |
| 24 | \n\ |
| 25 | a\n\ |
| 26 | abbcd55\ |
| 27 | \n\ |
| 28 | a\n\ |
| 29 | abbcd55\ |
| 30 | \n\ |
| 31 | a\n\ |
| 32 | abbcd55\ |
| 33 | \n\ |
| 34 | a\n\ |
| 35 | abbcd55\ |
| 36 | \n\ |
| 37 | a\n\ |
| 38 | abbcd55\ |
| 39 | \n\ |
| 40 | a\n\ |
| 41 | abbcd55\ |
| 42 | \n\ |
| 43 | a\n\ |
| 44 | abbcd55%%%%%%%%%%%%%%%%%%%%%%%%%%\n"; |
| 45 | |
| 46 | static int |
| 47 | do_test (void) |
| 48 | { |
| 49 | char *buf = malloc (strlen (expected) + 1); |
| 50 | snprintf (buf, strlen (expected) + 1, |
| 51 | "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d" |
| 52 | "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d" |
| 53 | "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d" |
| 54 | "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d" |
| 55 | "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d" |
| 56 | "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d" |
| 57 | "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d" |
| 58 | "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d" |
| 59 | "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d" |
| 60 | "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d" |
| 61 | "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d" |
| 62 | "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d" |
| 63 | "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d" |
| 64 | "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n", |
| 65 | "a", "b", "c", "d", 5); |
| 66 | return strcmp (buf, expected) != 0; |
| 67 | } |
| 68 | |
| 69 | #define TEST_FUNCTION do_test () |
| 70 | #include "../test-skeleton.c" |