1 TESTPRINT( 4, "%hhd", CHAR_MIN );
2 TESTPRINT( 3, "%hhd", CHAR_MAX );
3 TESTPRINT( 1, "%hhd", 0 );
4 TESTPRINT( 6, "%hd", SHRT_MIN );
5 TESTPRINT( 5, "%hd", SHRT_MAX );
6 TESTPRINT( 1, "%hd", 0 );
7 TESTPRINT( 11, "%d", INT_MIN );
8 TESTPRINT( 10, "%d", INT_MAX );
9 TESTPRINT( 1, "%d", 0 );
10 TESTPRINT( 11, "%ld", LONG_MIN );
11 TESTPRINT( 10, "%ld", LONG_MAX );
12 TESTPRINT( 1, "%ld", 0l );
13 TESTPRINT( 20, "%lld", LLONG_MIN );
14 TESTPRINT( 19, "%lld", LLONG_MAX );
15 TESTPRINT( 100, "%lld", 0ll ) );
16 TESTPRINT( 3, "%hhu", UCHAR_MAX );
17 TESTPRINT( 3, "%hhu", (unsigned char)-1 );
18 TESTPRINT( 5, "%hu", USHRT_MAX );
19 TESTPRINT( 5, "%hu", (unsigned short)-1 );
20 TESTPRINT( 10, "%u", UINT_MAX );
21 TESTPRINT( 10, "%u", -1u );
22 TESTPRINT( 10, "%lu", ULONG_MAX );
23 TESTPRINT( 10, "%lu", -1ul );
24 TESTPRINT( 20, "%llu", ULLONG_MAX );
25 TESTPRINT( 20, "%llu", -1ull );
26 TESTPRINT( 8, "%X", UINT_MAX );
27 TESTPRINT( 10, "%#X", -1u );
28 TESTPRINT( 8, "%x", UINT_MAX );
29 TESTPRINT( 10, "%#x", -1u );
30 TESTPRINT( 11, "%o", UINT_MAX );
31 TESTPRINT( 12, "%#o", -1u );
32 /* TODO: TESTPRINT( 5, "%.0#o", 0 ); */
33 TESTPRINT( 11, "%+d", INT_MIN );
34 TESTPRINT( 11, "%+d", INT_MAX );
35 TESTPRINT( 2, "%+d", 0 );
36 TESTPRINT( 10, "%+u", UINT_MAX );
37 TESTPRINT( 10, "%+u", -1u );
38 TESTPRINT( 11, "% d", INT_MIN );
39 TESTPRINT( 11, "% d", INT_MAX );
40 TESTPRINT( 2, "% d", 0 );
41 TESTPRINT( 10, "% u", UINT_MAX );
42 TESTPRINT( 10, "% u", -1u );
43 TESTPRINT( 11, "%9d", INT_MIN );
44 TESTPRINT( 10, "%9d", INT_MAX );
45 TESTPRINT( 11, "%10d", INT_MIN );
46 TESTPRINT( 10, "%10d", INT_MAX );
47 TESTPRINT( 11, "%11d", INT_MIN );
48 TESTPRINT( 11, "%11d", INT_MAX );
49 TESTPRINT( 12, "%12d", INT_MIN );
50 TESTPRINT( 12, "%12d", INT_MAX );
51 TESTPRINT( 11, "%-9d", INT_MIN );
52 TESTPRINT( 10, "%-9d", INT_MAX );
53 TESTPRINT( 11, "%-10d", INT_MIN );
54 TESTPRINT( 10, "%-10d", INT_MAX );
55 TESTPRINT( 11, "%-11d", INT_MIN );
56 TESTPRINT( 11, "%-11d", INT_MAX );
57 TESTPRINT( 12, "%-12d", INT_MIN );
58 TESTPRINT( 12, "%-12d", INT_MAX );
59 TESTPRINT( 11, "%09d", INT_MIN );
60 TESTPRINT( 10, "%09d", INT_MAX );
61 TESTPRINT( 11, "%010d", INT_MIN );
62 TESTPRINT( 10, "%010d", INT_MAX );
63 TESTPRINT( 11, "%011d", INT_MIN );
64 TESTPRINT( 11, "%011d", INT_MAX );
65 TESTPRINT( 12, "%012d", INT_MIN );
66 TESTPRINT( 12, "%012d", INT_MAX );
67 TESTPRINT( 11, "%-09d", INT_MIN );
68 TESTPRINT( 10, "%-09d", INT_MAX );
69 TESTPRINT( 11, "%-010d", INT_MIN );
70 TESTPRINT( 10, "%-010d", INT_MAX );
71 TESTPRINT( 11, "%-011d", INT_MIN );
72 TESTPRINT( 11, "%-011d", INT_MAX );
73 TESTPRINT( 12, "%-012d", INT_MIN );
74 TESTPRINT( 12, "%-012d", INT_MAX );
75 TESTPRINT( 30, "%030.20d", INT_MAX );
76 TESTPRINT( 8, "%.6x", UINT_MAX );
77 TESTPRINT( 10, "%#6.3x", UINT_MAX );
78 TESTPRINT( 10, "%#3.6x", UINT_MAX );
79 TESTPRINT( 11, "%.6d", INT_MIN );
80 TESTPRINT( 11, "%6.3d", INT_MIN );
81 TESTPRINT( 11, "%3.6d", INT_MIN );
82 TESTPRINT( 10, "%#0.6x", UINT_MAX );
83 TESTPRINT( 10, "%#06.3x", UINT_MAX );
84 TESTPRINT( 10, "%#03.6x", UINT_MAX );
85 TESTPRINT( 10, "%#0.6d", INT_MAX );
86 TESTPRINT( 10, "%#06.3d", INT_MAX );
87 TESTPRINT( 10, "%#03.6d", INT_MAX );
88 TESTPRINT( 11, "%#+.6d", INT_MAX );
89 TESTPRINT( 11, "%#+6.3d", INT_MAX );
90 TESTPRINT( 11, "%#+3.6d", INT_MAX );
91 TESTPRINT( 11, "%+0.6d", INT_MAX );
92 TESTPRINT( 11, "%+06.3d", INT_MAX );
93 TESTPRINT( 11, "%+03.6d", INT_MAX );
94 TESTPRINT( 12, "- %d", INT_MAX );
95 TESTPRINT( 26, "- %d %% %d", INT_MAX, INT_MIN );
96 TESTPRINT( 1, "%c", 'x' );
97 TESTPRINT( 6, "%s", "abcdef" );
98 TESTPRINT( 10, "%p", (void *)0xdeadbeef );
101 TESTPRINT( 9, "123456%n789%n", &val1, &val2 );
102 TESTCASE( val1 == 6 );
103 TESTCASE( val2 == 9 );
105 // 985 bytes from buffer
106 TESTCASE( memcmp( read "-1281270-32768327670-214748364821474836470-214748364821474836470-922337203685477580892233720368547758070255255655356553542949672954294967295429496729542949672951844674407370955161518446744073709551615FFFFFFFF0XFFFFFFFFffffffff0xffffffff37777777777037777777777-2147483648+2147483647+042949672954294967295-2147483648 2147483647 042949672954294967295-21474836482147483647-21474836482147483647-2147483648 2147483647 -2147483648 2147483647-21474836482147483647-21474836482147483647-21474836482147483647 -2147483648 2147483647 -21474836482147483647-21474836482147483647-214748364802147483647-02147483648002147483647-21474836482147483647-21474836482147483647-21474836482147483647 -2147483648 2147483647 00000000002147483647ffffffff0xffffffff0xffffffff-2147483648-2147483648-21474836480xffffffff0xffffffff0xffffffff214748364721474836472147483647+2147483647+2147483647+2147483647+2147483647+2147483647+2147483647- 2147483647- 2147483647 % -2147483648xabcdef0xdeadbeef123456789", 985 ) == 0 );