This source file includes following definitions.
- test_function
- main
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 #include <config.h>
20
21 #include <stdio.h>
22
23 #include "signature.h"
24 SIGNATURE_CHECK (dprintf, int, (int, const char *, ...));
25
26 #include <stddef.h>
27 #include <stdint.h>
28 #include <string.h>
29
30 #include "infinity.h"
31 #include "macros.h"
32
33 static void
34 test_function (int (*my_dprintf) (int, const char *, ...))
35 {
36
37
38
39
40
41 my_dprintf (fileno (stdout), "%ju %d\n", (uintmax_t) 12345671, 33, 44, 55);
42
43 my_dprintf (fileno (stdout), "%zu %d\n", (size_t) 12345672, 33, 44, 55);
44
45 my_dprintf (fileno (stdout), "%tu %d\n", (ptrdiff_t) 12345673, 33, 44, 55);
46
47
48
49
50
51 my_dprintf (fileno (stdout), "%a %d\n", 0.0, 33, 44, 55);
52
53
54 my_dprintf (fileno (stdout), "%a %d\n", Infinityd (), 33, 44, 55);
55
56
57 my_dprintf (fileno (stdout), "%a %d\n", - Infinityd (), 33, 44, 55);
58
59
60 my_dprintf (fileno (stdout), "%010a %d\n", Infinityd (), 33, 44, 55);
61
62
63
64
65 my_dprintf (fileno (stdout), "%f %d\n", 12.75, 33, 44, 55);
66
67
68 my_dprintf (fileno (stdout), "%f %d\n", 1234567.0, 33, 44, 55);
69
70
71 my_dprintf (fileno (stdout), "%f %d\n", -0.03125, 33, 44, 55);
72
73
74 my_dprintf (fileno (stdout), "%f %d\n", 0.0, 33, 44, 55);
75
76
77 my_dprintf (fileno (stdout), "%015f %d\n", 1234.0, 33, 44, 55);
78
79
80 my_dprintf (fileno (stdout), "%.f %d\n", 1234.0, 33, 44, 55);
81
82
83 my_dprintf (fileno (stdout), "%.2f %d\n", 999.95, 33, 44, 55);
84
85
86 my_dprintf (fileno (stdout), "%.2f %d\n", 999.996, 33, 44, 55);
87
88
89 my_dprintf (fileno (stdout), "%Lf %d\n", 12.75L, 33, 44, 55);
90
91
92 my_dprintf (fileno (stdout), "%Lf %d\n", 1234567.0L, 33, 44, 55);
93
94
95 my_dprintf (fileno (stdout), "%Lf %d\n", -0.03125L, 33, 44, 55);
96
97
98 my_dprintf (fileno (stdout), "%Lf %d\n", 0.0L, 33, 44, 55);
99
100
101 my_dprintf (fileno (stdout), "%015Lf %d\n", 1234.0L, 33, 44, 55);
102
103
104 my_dprintf (fileno (stdout), "%.Lf %d\n", 1234.0L, 33, 44, 55);
105
106
107 my_dprintf (fileno (stdout), "%.2Lf %d\n", 999.95L, 33, 44, 55);
108
109
110 my_dprintf (fileno (stdout), "%.2Lf %d\n", 999.996L, 33, 44, 55);
111
112
113
114
115 my_dprintf (fileno (stdout), "%F %d\n", 12.75, 33, 44, 55);
116
117
118 my_dprintf (fileno (stdout), "%F %d\n", 1234567.0, 33, 44, 55);
119
120
121 my_dprintf (fileno (stdout), "%F %d\n", -0.03125, 33, 44, 55);
122
123
124 my_dprintf (fileno (stdout), "%F %d\n", 0.0, 33, 44, 55);
125
126
127 my_dprintf (fileno (stdout), "%015F %d\n", 1234.0, 33, 44, 55);
128
129
130 my_dprintf (fileno (stdout), "%.F %d\n", 1234.0, 33, 44, 55);
131
132
133 my_dprintf (fileno (stdout), "%.2F %d\n", 999.95, 33, 44, 55);
134
135
136 my_dprintf (fileno (stdout), "%.2F %d\n", 999.996, 33, 44, 55);
137
138
139 my_dprintf (fileno (stdout), "%LF %d\n", 12.75L, 33, 44, 55);
140
141
142 my_dprintf (fileno (stdout), "%LF %d\n", 1234567.0L, 33, 44, 55);
143
144
145 my_dprintf (fileno (stdout), "%LF %d\n", -0.03125L, 33, 44, 55);
146
147
148 my_dprintf (fileno (stdout), "%LF %d\n", 0.0L, 33, 44, 55);
149
150
151 my_dprintf (fileno (stdout), "%015LF %d\n", 1234.0L, 33, 44, 55);
152
153
154 my_dprintf (fileno (stdout), "%.LF %d\n", 1234.0L, 33, 44, 55);
155
156
157 my_dprintf (fileno (stdout), "%.2LF %d\n", 999.95L, 33, 44, 55);
158
159
160 my_dprintf (fileno (stdout), "%.2LF %d\n", 999.996L, 33, 44, 55);
161
162
163
164 my_dprintf (fileno (stdout), "%2$d %1$d\n", 33, 55);
165 }
166
167 int
168 main (int argc, char *argv[])
169 {
170 test_function (dprintf);
171 return 0;
172 }