26#define _CRT_NON_CONFORMING_SWPRINTFS
41 static const unsigned __ind_bytes = 0xffc00000;
42 return *(
const float *)&__ind_bytes;
44#define IND __port_ind()
56static unsigned int (
__cdecl *p__set_output_format)(
unsigned int);
112 {
"%+#23.15e",
"+7.894561230000000e+008", 0, DOUBLE_ARG, 0, 0, 789456123 },
113 {
"%-#23.15e",
"7.894561230000000e+008 ", 0, DOUBLE_ARG, 0, 0, 789456123 },
114 {
"%#23.15e",
" 7.894561230000000e+008", 0, DOUBLE_ARG, 0, 0, 789456123 },
115 {
"%#1.1g",
"8.e+008", 0, DOUBLE_ARG, 0, 0, 789456123 },
116 {
"%I64d",
"-8589934591", 0, ULONGLONG_ARG, 0, ((
ULONGLONG)0xffffffff)*0xffffffff },
117 {
"%+8I64d",
" +100", 0, ULONGLONG_ARG, 0, 100 },
118 {
"%+.8I64d",
"+00000100", 0, ULONGLONG_ARG, 0, 100 },
119 {
"%+10.8I64d",
" +00000100", 0, ULONGLONG_ARG, 0, 100 },
120 {
"%_1I64d",
"_1I64d", 0, ULONGLONG_ARG, 0, 100 },
121 {
"%-1.5I64d",
"-00100", 0, ULONGLONG_ARG, 0, -100 },
122 {
"%5I64d",
" 100", 0, ULONGLONG_ARG, 0, 100 },
123 {
"%5I64d",
" -100", 0, ULONGLONG_ARG, 0, -100 },
124 {
"%-5I64d",
"100 ", 0, ULONGLONG_ARG, 0, 100 },
125 {
"%-5I64d",
"-100 ", 0, ULONGLONG_ARG, 0, -100 },
126 {
"%-.5I64d",
"00100", 0, ULONGLONG_ARG, 0, 100 },
127 {
"%-.5I64d",
"-00100", 0, ULONGLONG_ARG, 0, -100 },
128 {
"%-8.5I64d",
"00100 ", 0, ULONGLONG_ARG, 0, 100 },
129 {
"%-8.5I64d",
"-00100 ", 0, ULONGLONG_ARG, 0, -100 },
130 {
"%05I64d",
"00100", 0, ULONGLONG_ARG, 0, 100 },
131 {
"%05I64d",
"-0100", 0, ULONGLONG_ARG, 0, -100 },
132 {
"% I64d",
" 100", 0, ULONGLONG_ARG, 0, 100 },
133 {
"% I64d",
"-100", 0, ULONGLONG_ARG, 0, -100 },
134 {
"% 5I64d",
" 100", 0, ULONGLONG_ARG, 0, 100 },
135 {
"% 5I64d",
" -100", 0, ULONGLONG_ARG, 0, -100 },
136 {
"% .5I64d",
" 00100", 0, ULONGLONG_ARG, 0, 100 },
137 {
"% .5I64d",
"-00100", 0, ULONGLONG_ARG, 0, -100 },
138 {
"% 8.5I64d",
" 00100", 0, ULONGLONG_ARG, 0, 100 },
139 {
"% 8.5I64d",
" -00100", 0, ULONGLONG_ARG, 0, -100 },
140 {
"%.0I64d",
"", 0, ULONGLONG_ARG },
141 {
"%#+21.18I64x",
" 0x00ffffffffffffff9c", 0, ULONGLONG_ARG, 0, -100 },
142 {
"%#.25I64o",
"0001777777777777777777634", 0, ULONGLONG_ARG, 0, -100 },
143 {
"%#+24.20I64o",
" 01777777777777777777634", 0, ULONGLONG_ARG, 0, -100 },
144 {
"%#+18.21I64X",
"0X00000FFFFFFFFFFFFFF9C", 0, ULONGLONG_ARG, 0, -100 },
145 {
"%#+20.24I64o",
"001777777777777777777634", 0, ULONGLONG_ARG, 0, -100 },
146 {
"%#+25.22I64u",
" 0018446744073709551615", 0, ULONGLONG_ARG, 0, -1 },
147 {
"%#+25.22I64u",
" 0018446744073709551615", 0, ULONGLONG_ARG, 0, -1 },
148 {
"%#+30.25I64u",
" 0000018446744073709551615", 0, ULONGLONG_ARG, 0, -1 },
149 {
"%+#25.22I64d",
" -0000000000000000000001", 0, ULONGLONG_ARG, 0, -1 },
150 {
"%#-8.5I64o",
"00144 ", 0, ULONGLONG_ARG, 0, 100 },
151 {
"%#-+ 08.5I64d",
"+00100 ", 0, ULONGLONG_ARG, 0, 100 },
153 "00000000000000000000000000000000000000000000000000000000000000000000000000000001",
154 0, ULONGLONG_ARG, 0, 1 },
156 " 00000000000000000000000000000000000000000000000000000000000000000000000000000001",
157 0, ULONGLONG_ARG, 0, 1 },
159 " 00000000000000000000000000000000000000000000000000000000000000000000000000000001",
161 {
"%I",
"I", 0, INT_ARG, 1 },
162 {
"%Iq",
"Iq", 0, INT_ARG, 1 },
163 {
"%Ihd",
"Ihd", 0, INT_ARG, 1 },
164 {
"%I0d",
"I0d", 0, INT_ARG, 1 },
165 {
"%I64D",
"D", 0, ULONGLONG_ARG, 0, -1 },
166 {
"%zx",
"1",
"zx", INT_ARG, 1 },
167 {
"%z",
"z", 0, INT_ARG, 1 },
168 {
"%tx",
"1",
"tx", INT_ARG, 1 },
169 {
"%t",
"t", 0, INT_ARG, 1 },
170 {
"% d",
" 1", 0, INT_ARG, 1 },
171 {
"%+ d",
"+1", 0, INT_ARG, 1 },
172 {
"%S",
"wide", 0, PTR_ARG, 0, 0, 0,
L"wide" },
173 {
"%04c",
"0001", 0, INT_ARG,
'1' },
174 {
"%-04c",
"1 ", 0, INT_ARG,
'1' },
175 {
"%#012x",
"0x0000000001", 0, INT_ARG, 1 },
176 {
"%#012x",
"000000000000", 0, INT_ARG, 0 },
177 {
"%#04.8x",
"0x00000001", 0, INT_ARG, 1 },
178 {
"%#04.8x",
"00000000", 0, INT_ARG, 0 },
179 {
"%#-08.2x",
"0x01 ", 0, INT_ARG, 1 },
180 {
"%#-08.2x",
"00 ", 0, INT_ARG, 0 },
181 {
"%#.0x",
"0x1", 0, INT_ARG, 1 },
182 {
"%#.0x",
"", 0, INT_ARG, 0 },
183 {
"%#08o",
"00000001", 0, INT_ARG, 1 },
184 {
"%#o",
"01", 0, INT_ARG, 1 },
185 {
"%#o",
"0", 0, INT_ARG, 0 },
186 {
"%04s",
"0foo", 0, PTR_ARG, 0, 0, 0,
"foo" },
187 {
"%.1s",
"f", 0, PTR_ARG, 0, 0, 0,
"foo" },
188 {
"hello",
"hello", 0, NO_ARG },
189 {
"%ws",
"wide", 0, PTR_ARG, 0, 0, 0,
L"wide" },
190 {
"%-10ws",
"wide ", 0, PTR_ARG, 0, 0, 0,
L"wide" },
191 {
"%10ws",
" wide", 0, PTR_ARG, 0, 0, 0,
L"wide" },
192 {
"%#+ -03whlls",
"wide", 0, PTR_ARG, 0, 0, 0,
L"wide" },
193 {
"%w0s",
"0s", 0, PTR_ARG, 0, 0, 0,
L"wide" },
194 {
"%w-s",
"-s", 0, PTR_ARG, 0, 0, 0,
L"wide" },
195 {
"%ls",
"wide", 0, PTR_ARG, 0, 0, 0,
L"wide" },
196 {
"%Ls",
"not wide", 0, PTR_ARG, 0, 0, 0,
"not wide" },
197 {
"%b",
"b", 0, NO_ARG },
198 {
"%3c",
" a", 0, INT_ARG,
'a' },
199 {
"%3d",
"1234", 0, INT_ARG, 1234 },
200 {
"%3h",
"", 0, NO_ARG },
201 {
"%k%m%q%r%t%v%y%z",
"kmqrtvyz", 0, NO_ARG },
202 {
"%-1d",
"2", 0, INT_ARG, 2 },
203 {
"%2.4f",
"8.6000", 0, DOUBLE_ARG, 0, 0, 8.6 },
204 {
"%0f",
"0.600000", 0, DOUBLE_ARG, 0, 0, 0.6 },
205 {
"%.0f",
"1", 0, DOUBLE_ARG, 0, 0, 0.6 },
206 {
"%2.4e",
"8.6000e+000", 0, DOUBLE_ARG, 0, 0, 8.6 },
207 {
"% 2.4e",
" 8.6000e+000", 0, DOUBLE_ARG, 0, 0, 8.6 },
208 {
"% 014.4e",
" 008.6000e+000", 0, DOUBLE_ARG, 0, 0, 8.6 },
209 {
"% 2.4e",
"-8.6000e+000", 0, DOUBLE_ARG, 0, 0, -8.6 },
210 {
"%+2.4e",
"+8.6000e+000", 0, DOUBLE_ARG, 0, 0, 8.6 },
211 {
"%2.4g",
"8.6", 0, DOUBLE_ARG, 0, 0, 8.6 },
212 {
"%-i",
"-1", 0, INT_ARG, -1 },
213 {
"%-i",
"1", 0, INT_ARG, 1 },
214 {
"%+i",
"+1", 0, INT_ARG, 1 },
215 {
"%o",
"12", 0, INT_ARG, 10 },
216 {
"%s",
"(null)", 0, PTR_ARG, 0, 0, 0,
NULL },
217 {
"%s",
"%%%%", 0, PTR_ARG, 0, 0, 0,
"%%%%" },
218 {
"%u",
"4294967295", 0, INT_ARG, -1 },
219 {
"%w",
"", 0, INT_ARG, -1 },
220 {
"%h",
"", 0, INT_ARG, -1 },
221 {
"%j",
"",
"j", ULONGLONG_ARG, 0, -1 },
222 {
"%jd",
"-1",
"jd", ULONGLONG_ARG, 0, -1 },
223 {
"%F",
"", 0, INT_ARG, -1 },
224 {
"%N",
"", 0, INT_ARG, -1 },
225 {
"%H",
"H", 0, INT_ARG, -1 },
226 {
"x%cx",
"xXx", 0, INT_ARG, 0x100+
'X' },
227 {
"%%0",
"%0", 0, NO_ARG },
228 {
"%hx",
"2345", 0, INT_ARG, 0x12345 },
229 {
"%hhx",
"123", 0, INT_ARG, 0x123 },
230 {
"%hhx",
"2345", 0, INT_ARG, 0x12345 },
231 {
"%lf",
"-1.#IND00", 0, DOUBLE_ARG, 0, 0,
IND },
232 {
"%lf",
"1.#QNAN0", 0, DOUBLE_ARG, 0, 0,
NAN },
233 {
"%lf",
"1.#INF00", 0, DOUBLE_ARG, 0, 0,
INFINITY },
234 {
"%le",
"-1.#IND00e+000", 0, DOUBLE_ARG, 0, 0,
IND },
235 {
"%le",
"1.#QNAN0e+000", 0, DOUBLE_ARG, 0, 0,
NAN },
236 {
"%le",
"1.#INF00e+000", 0, DOUBLE_ARG, 0, 0,
INFINITY },
237 {
"%lg",
"-1.#IND", 0, DOUBLE_ARG, 0, 0,
IND },
238 {
"%lg",
"1.#QNAN", 0, DOUBLE_ARG, 0, 0,
NAN },
239 {
"%lg",
"1.#INF", 0, DOUBLE_ARG, 0, 0,
INFINITY },
240 {
"%010.2lf",
"-000001.#J", 0, DOUBLE_ARG, 0, 0,
IND },
241 {
"%010.2lf",
"0000001.#R", 0, DOUBLE_ARG, 0, 0,
NAN },
242 {
"%010.2lf",
"0000001.#J", 0, DOUBLE_ARG, 0, 0,
INFINITY },
243 {
"%c",
"a", 0, INT_ARG,
'a' },
244 {
"%c",
"\x82", 0, INT_ARG, 0xa082 },
245 {
"%C",
"a", 0, INT_ARG,
'a' },
246 {
"%C",
"", 0, INT_ARG, 0x3042 },
247 {
"a%Cb",
"ab", 0, INT_ARG, 0x3042 },
248 {
"%lld",
"-8589934591",
"1", ULONGLONG_ARG, 0, ((
ULONGLONG)0xffffffff)*0xffffffff },
249 {
"%I32d",
"1",
"I32d", INT_ARG, 1 },
250 {
"%.0f",
"-2", 0, DOUBLE_ARG, 0, 0, -1.5 },
251 {
"%.0f",
"-1", 0, DOUBLE_ARG, 0, 0, -0.5 },
252 {
"%.0f",
"1", 0, DOUBLE_ARG, 0, 0, 0.5 },
253 {
"%.0f",
"2", 0, DOUBLE_ARG, 0, 0, 1.5 },
254 {
"%.30f",
"0.333333333333333310000000000000", 0, TODO_FLAG | DOUBLE_ARG, 0, 0, 1.0/3.0 },
255 {
"%.30lf",
"1.414213562373095100000000000000", 0, TODO_FLAG | DOUBLE_ARG, 0, 0,
sqrt(2) },
256 {
"%f",
"3.141593", 0, DOUBLE_ARG, 0, 0, 3.141592653590000 },
257 {
"%.10f",
"3.1415926536", 0, DOUBLE_ARG, 0, 0, 3.141592653590000 },
258 {
"%.11f",
"3.14159265359", 0, DOUBLE_ARG, 0, 0, 3.141592653590000 },
259 {
"%.15f",
"3.141592653590000", 0, DOUBLE_ARG, 0, 0, 3.141592653590000 },
260 {
"%.15f",
"3.141592653589793", 0, DOUBLE_ARG, 0, 0,
M_PI },
261 {
"%.13f",
"37.8662615745371", 0, DOUBLE_ARG, 0, 0, 37.866261574537077 },
262 {
"%.14f",
"37.86626157453708", 0, DOUBLE_ARG, 0, 0, 37.866261574537077 },
263 {
"%.15f",
"37.866261574537077", 0, DOUBLE_ARG, 0, 0, 37.866261574537077 },
264 {
"%g",
"0.0005", 0, DOUBLE_ARG, 0, 0, 0.0005 },
265 {
"%g",
"5e-005", 0, DOUBLE_ARG, 0, 0, 0.00005 },
266 {
"%g",
"5e-006", 0, DOUBLE_ARG, 0, 0, 0.000005 },
267 {
"%g",
"1e+015", 0, DOUBLE_ARG, 0, 0, 999999999999999.0 },
268 {
"%g",
"1e+015", 0, DOUBLE_ARG, 0, 0, 1000000000000000.0 },
269 {
"%.15g",
"0.0005", 0, DOUBLE_ARG, 0, 0, 0.0005 },
270 {
"%.15g",
"5e-005", 0, DOUBLE_ARG, 0, 0, 0.00005 },
271 {
"%.15g",
"5e-006", 0, DOUBLE_ARG, 0, 0, 0.000005 },
272 {
"%.15g",
"999999999999999", 0, DOUBLE_ARG, 0, 0, 999999999999999.0 },
273 {
"%.15g",
"1e+015", 0, DOUBLE_ARG, 0, 0, 1000000000000000.0 },
307 "%d) buffer = \"%s\"\n",
i,
buffer);
311 if (
sizeof(
void *) == 8)
313 r = p_sprintf(
buffer,
"%p", (
void *)57);
315 ok(
r==16,
"return count wrong\n");
317 r = p_sprintf(
buffer,
"%#020p", (
void *)57);
318 ok(!
strcmp(
buffer,
" 0X0000000000000039"),
"Pointer formatted incorrectly\n");
319 ok(
r==20,
"return count wrong\n");
321 r = p_sprintf(
buffer,
"%Fp", (
void *)57);
323 ok(
r==16,
"return count wrong\n");
325 r = p_sprintf(
buffer,
"%Np", (
void *)57);
327 ok(
r==16,
"return count wrong\n");
329 r = p_sprintf(
buffer,
"%#-020p", (
void *)57);
330 ok(!
strcmp(
buffer,
"0X0000000000000039 "),
"Pointer formatted incorrectly\n");
331 ok(
r==20,
"return count wrong\n");
333 r = p_sprintf(
buffer,
"%Ix %d", (
size_t)0x12345678123456,1);
335 ok(
r==16,
"return count wrong\n");
337 r = p_sprintf(
buffer,
"%p", 0);
339 ok(
r==16,
"return count wrong\n");
343 r = p_sprintf(
buffer,
"%p", (
void *)57);
345 ok(
r==8,
"return count wrong\n");
347 r = p_sprintf(
buffer,
"%#012p", (
void *)57);
348 ok(!
strcmp(
buffer,
" 0X00000039"),
"Pointer formatted incorrectly\n");
349 ok(
r==12,
"return count wrong\n");
351 r = p_sprintf(
buffer,
"%Fp", (
void *)57);
353 ok(
r==8,
"return count wrong\n");
355 r = p_sprintf(
buffer,
"%Np",(
void *)57);
357 ok(
r==8,
"return count wrong\n");
359 r = p_sprintf(
buffer,
"%#-012p", (
void *)57);
360 ok(!
strcmp(
buffer,
"0X00000039 "),
"Pointer formatted incorrectly\n");
361 ok(
r==12,
"return count wrong\n");
363 r = p_sprintf(
buffer,
"%Ix %d", 0x123456, 1);
365 ok(
r==8,
"return count wrong\n");
367 r = p_sprintf(
buffer,
"%p", 0);
369 ok(
r==8,
"return count wrong\n");
372 r = p_sprintf(
buffer,
"%.*s", 1,
"foo");
374 ok(
r==1,
"return count wrong\n");
376 r = p_sprintf(
buffer,
"%*s", -5,
"foo");
378 ok(
r==5,
"return count wrong\n");
381 r = p_sprintf(
buffer,
"asdf%n", &
x );
386 ok(
x == 0,
"should not write to x: %d\n",
x);
390 ok(
x == 4,
"should write to x: %d\n",
x);
392 ok(
r==4,
"return count wrong: %d\n",
r);
395 r = p_sprintf(
buffer,
"%S",
L"\x3042");
399 win_skip(
"Japanese_Japan.932 locale not available\n");
403 r = p_sprintf(
buffer,
"%c", 0xa082);
404 ok(
r==1,
"r = %d\n",
r);
407 r = p_sprintf(
buffer,
"%C", 0x3042);
408 ok(
r==2,
"r = %d\n",
r);
413 ok(
r==14,
"r = %d\n",
r);
418 r = p_sprintf(
buffer,
"%*1d", 1, 3);
419 ok(
r==11,
"r = %d\n",
r);
422 r = p_sprintf(
buffer,
"%0*0d", 1, 2);
423 ok(
r==10,
"r = %d\n",
r);
426 r = p_sprintf(
buffer,
"% *2d", 0, 7);
427 ok(
r==2,
"r = %d\n",
r);
434 double pnumber = 789456123;
435 const char string[] =
"string";
449 struct snprintf_test {
454 const struct snprintf_test
tests[] = {{
"short", 5},
459 const int bufsiz =
sizeof buffer;
467 const int n = p_snprintf(
buffer, bufsiz,
fmt);
468 const int valid =
n < 0 ? bufsiz : (
n == bufsiz ?
n :
n+1);
470 ok (
n ==
expect,
"\"%s\": expected %d, returned %d\n",
486 ok(
ret == 12,
"ftell returned %d\n",
ret);
491 ok(
ret == 26,
"ftell returned %d\n",
ret);
496 ok(
ret == 42,
"ftell returned %d\n",
ret);
500 fp =
fopen(
"fprintf.tst",
"rb");
504 ok(
ret == 12,
"ftell returned %d\n",
ret);
520 fp =
fopen(
"fprintf.tst",
"wt");
525 ok(
ret == 13,
"ftell returned %d\n",
ret);
530 ok(
ret == 28,
"ftell returned %d\n",
ret);
535 ok(
ret == 37,
"ftell returned %d\n",
ret);
539 fp =
fopen(
"fprintf.tst",
"rb");
543 ok(
ret == 13,
"ftell returned %d\n",
ret);
568 ok( -3 ==
dec,
"dec wrong %d\n",
dec);
569 ok( 0 ==
sign,
"sign wrong\n");
573 ok( -3 ==
dec,
"dec wrong %d\n",
dec);
574 ok( 0 ==
sign,
"sign wrong\n");
578 ok( -3 ==
dec,
"dec wrong %d\n",
dec);
579 ok( 0 ==
sign,
"sign wrong\n");
584 ok( 3 ==
dec,
"dec wrong %d\n",
dec);
585 ok( 1 ==
sign,
"sign wrong\n");
589 ok( 3 ==
dec,
"dec wrong\n");
590 ok( 0 ==
sign,
"sign wrong\n");
595 ok( 0 ==
dec,
"dec wrong %d\n",
dec);
596 ok( 0 ==
sign,
"sign wrong\n");
600 ok( 0 ==
dec,
"dec wrong %d\n",
dec);
601 ok( 0 ==
sign,
"sign wrong\n");
605 ok( 0 ==
dec,
"dec wrong %d\n",
dec);
606 ok( 0 ==
sign,
"sign wrong\n");
611 ok( 3 ==
dec,
"dec wrong %d\n",
dec);
612 ok( 1 ==
sign,
"sign wrong\n");
616 ok( 3 ==
dec,
"dec wrong %d\n",
dec);
617 ok( 1 ==
sign,
"sign wrong\n");
621 ok( 3 ==
dec,
"dec wrong %d\n",
dec);
622 ok( 1 ==
sign,
"sign wrong\n");
626 ok( 3 ==
dec,
"dec wrong %d\n",
dec);
627 ok( 1 ==
sign,
"sign wrong\n");
632 ok( 3 ==
dec,
"dec wrong %d\n",
dec);
633 ok( 0 ==
sign,
"sign wrong\n");
638 ok( -1 ==
dec,
"dec wrong %d\n",
dec);
639 ok( 0 ==
sign,
"sign wrong\n");
643 ok( -2 ==
dec,
"dec wrong %d\n",
dec);
644 ok( 0 ==
sign,
"sign wrong\n");
648 ok( 0 ==
dec,
"dec wrong %d\n",
dec);
649 ok( 0 ==
sign,
"sign wrong\n");
653 ok( 1 ==
dec,
"dec wrong %d\n",
dec);
654 ok( 0 ==
sign,
"sign wrong\n");
668 { 45.0, 2,
"45",
"4500", 2, 2, 0 },
669 { 0.0001, 1,
"1",
"", -3, -3, 0 },
670 { 0.0001, 10,
"1000000000",
"1000000", -3, -3, 0 },
671 { -111.0001, 5,
"11100",
"11100010", 3, 3, 1 },
672 { 111.0001, 5,
"11100",
"11100010", 3, 3, 0 },
673 { 3333.3, 2,
"33",
"333330", 4, 4, 0 },
674 {999999999999.9, 3,
"100",
"999999999999900", 13, 12, 0 },
675 { 0.0, 5,
"00000",
"00000", 0, 0, 0 },
676 { 0.0, 0,
"",
"", 0, 0, 0 },
677 { 0.0, -1,
"",
"", 0, 0, 0 },
678 { -0.0, 5,
"00000",
"00000", 0, 0, 1 },
679 { -0.0, 0,
"",
"", 0, 0, 1 },
680 { -0.0, -1,
"",
"", 0, 0, 1 },
681 { -123.0001, 0,
"",
"123", 3, 3, 1 },
682 { -123.0001, -1,
"",
"12", 3, 3, 1 },
683 { -123.0001, -2,
"",
"1", 3, 3, 1 },
684 { -123.0001, -3,
"",
"", 3, 3, 1 },
685 { 99.99, 1,
"1",
"1000", 3, 3, 0 },
686 { 0.0063, 2,
"63",
"1", -2, -1, 0 },
687 { 0.0063, 3,
"630",
"6", -2, -2, 0 },
688 { 0.09999999996, 2,
"10",
"10", 0, 0, 0 },
689 { 0.6, 1,
"6",
"6", 0, 0, 0 },
690 { 0.6, 0,
"",
"1", 1, 1, 0 },
691 { 0.4, 0,
"",
"", 0, 0, 0 },
692 { 0.49, 0,
"",
"", 0, 0, 0 },
693 { 0.51, 0,
"",
"1", 1, 1, 0 },
694 {
NAN, 2,
"1$",
"1#R", 1, 1, 0 },
695 {
NAN, 5,
"1#QNB",
"1#QNAN", 1, 1, 0 },
696 { -
NAN, 2,
"1$",
"1#J", 1, 1, 1 },
697 { -
NAN, 5,
"1#IND",
"1#IND0", 1, 1, 1 },
698 {
INFINITY, 2,
"1$",
"1#J", 1, 1, 0 },
699 {
INFINITY, 5,
"1#INF",
"1#INF0", 1, 1, 0 },
700 { -
INFINITY, 2,
"1$",
"1#J", 1, 1, 1 },
701 { -
INFINITY, 5,
"1#INF",
"1#INF0", 1, 1, 1 },
702 { 1.0, 30,
"100000000000000000000000000000",
703 "1000000000000000000000000000000", 1, 1, 0},
704 { 123456789012345678901.0, 30,
"123456789012345680000000000000",
705 "123456789012345680000000000000000000000000000000000", 21, 21, 0},
721 "%d) _ecvt() bad return, got '%s' expected '%s'\n",
i,
str,
724 "%d) _ecvt() decimal point wrong, got %d expected %d\n",
i,
decpt,
726 if (((
i == 10) || (
i == 11) || (
i == 12)) && (
_winver < 0x600))
728 skip(
"broken on win 2003\n");
732 "%d) _ecvt() sign wrong, got %d expected %d\n",
i,
sign,
742 "%d) _fcvt() bad return, got '%s' expected '%s'\n",
i,
str,
745 "%d) _fcvt() decimal point wrong, got %d expected %d\n",
i,
decpt,
747 if (((
i == 10) || (
i == 11) || (
i == 12)) && (
_winver < 0x600))
749 skip(
"broken on win 2003\n");
753 "%d) _fcvt() sign wrong, got %d expected %d\n",
i,
sign,
763 ok(
err == 0,
"_ecvt_s() failed with error code %d\n",
err);
765 "%d) _ecvt_s() bad return, got '%s' expected '%s'\n",
i,
str,
768 "%d) _ecvt_s() decimal point wrong, got %d expected %d\n",
i,
decpt,
771 "%d) _ecvt_s() sign wrong, got %d expected %d\n",
i,
sign,
777 win_skip(
"_ecvt_s not available\n");
786 err = p__fcvt_s(
NULL, 0, 0.0, 0, &
i, &
i);
789 err = p__fcvt_s(
str, 0, 0.0, 0, &
i, &
i);
794 err = p__fcvt_s(
str, -1, 0.0, 0, &
i, &
i);
795 ok(
err == 0,
"got %d, expected 0\n",
err);
796 ok(
str[0] == 0,
"got %c, expected 0\n",
str[0]);
797 ok(
str[1] == 0,
"got %c, expected 0\n",
str[1]);
808 ok(!
err,
"%d) _fcvt_s() failed with error code %d\n",
i,
err);
810 "%d) _fcvt_s() bad return, got '%s' expected '%s'. test %d\n",
i,
str,
813 "%d) _fcvt_s() decimal point wrong, got %d expected %d\n",
i,
decpt,
816 "%d) _fcvt_s() sign wrong, got %d expected %d\n",
i,
sign,
822 win_skip(
"_fcvt_s not available\n");
842 ok(
ret == 11,
"got %d expected 11\n",
ret );
844 ok( !
strcmp(
buf,
"onetwothree"),
"got %s expected 'onetwothree'\n",
buf );
847 ok(
ret == -1,
"got %d, expected -1\n",
ret );
918 if (!p_vswprintf || !p__vswprintf || !p__vswprintf_l ||!p__vswprintf_c
919 || !p__vswprintf_c_l || !p__vswprintf_p_l)
921 win_skip(
"_vswprintf or vswprintf not available\n");
926 ok(
ret == 10,
"got %d, expected 10\n",
ret);
931 ok(
ret == 10,
"got %d, expected 10\n",
ret);
936 ok(
ret == 10,
"got %d, expected 10\n",
ret);
941 ok(
ret == 10,
"got %d, expected 10\n",
ret);
946 ok(
ret == -1,
"got %d, expected -1\n",
ret);
951 ok(
ret == 10,
"got %d, expected 10\n",
ret);
956 ok(
ret == 10,
"got %d, expected 10\n",
ret);
976 win_skip(
"_vscprintf not available\n");
981 ok(
ret == 8,
"got %d expected 8\n",
ret );
1000 win_skip(
"_vscwprintf not available\n");
1005 ok(
ret == 8,
"got %d expected 8\n",
ret );
1021 wchar_t buffer[14] = { 0 };
1024 if (!p__vsnwprintf_s)
1026 win_skip(
"_vsnwprintf_s not available\n");
1032 ok(
ret == 6,
"length wrong, expect=6, got=%d\n",
ret);
1036 ok(
ret == 6,
"length wrong, expect=6, got=%d\n",
ret);
1040 ok(
ret == 6,
"length wrong, expect=6, got=%d\n",
ret);
1045 ok(
ret == -1,
"length wrong, expect=-1, got=%d\n",
ret);
1049 ok(
ret == -1,
"length wrong, expect=-1, got=%d\n",
ret);
1053 ok(
ret == -1,
"length wrong, expect=-1, got=%d\n",
ret);
1073 if(!p__vsprintf_p) {
1074 win_skip(
"vsprintf_p not available\n");
1104 if (!p__get_output_format || !p__set_output_format)
1106 win_skip(
"_get_output_format or _set_output_format is not available\n");
1110 ret = p__get_output_format();
1113 c = p_sprintf(
buf,
"%E", 1.23);
1114 ok(
c == 13,
"c = %d\n",
c);
1120 c = p_sprintf(
buf,
"%E", 1.23);
1121 ok(
c == 12,
"c = %d\n",
c);
1124 ret = p__get_output_format();
_STLP_DECLSPEC complex< float > _STLP_CALL sqrt(const complex< float > &)
ios_base &_STLP_CALL dec(ios_base &__s)
int strcmp(const char *String1, const char *String2)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
ACPI_SIZE strlen(const char *String)
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
#define GetProcAddress(x, y)
#define WideCharToMultiByte
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
GLint GLint GLint GLint GLint x
GLuint GLuint GLsizei count
GLuint GLuint GLsizei GLenum type
GLdouble GLdouble GLdouble r
GLenum GLuint GLenum GLsizei const GLchar * buf
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define _TWO_DIGIT_EXPONENT
_Check_return_ _CRTIMP int __cdecl fscanf(_Inout_ FILE *_File, _In_z_ _Scanf_format_string_ const char *_Format,...)
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
_Check_return_ _CRTIMP FILE *__cdecl fopen(_In_z_ const char *_Filename, _In_z_ const char *_Mode)
_CRTIMP int __cdecl _vsnwprintf(wchar_t *_Dest, size_t _Count, const wchar_t *_Format, va_list _Args)
_Check_return_opt_ _CRTIMP char *__cdecl fgets(_Out_writes_z_(_MaxCount) char *_Buf, _In_ int _MaxCount, _Inout_ FILE *_File)
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
_Check_return_opt_ _CRTIMP int __cdecl fwprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const wchar_t *_Format,...)
_Check_return_ _CRTIMP long __cdecl ftell(_Inout_ FILE *_File)
_Check_return_ _CRTIMP char *__cdecl _ecvt(_In_ double _Val, _In_ int _NumOfDigits, _Out_ int *_PtDec, _Out_ int *_PtSign)
_Check_return_ _CRTIMP char *__cdecl _fcvt(_In_ double _Val, _In_ int _NumOfDec, _Out_ int *_PtDec, _Out_ int *_PtSign)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
_CONST_RETURN wchar_t *__cdecl wcsstr(_In_z_ const wchar_t *_Str, _In_z_ const wchar_t *_SubStr)
static struct test_info tests[]
static PEXPLICIT_ACCESSW *static HMODULE hmod
#define todo_wine_if(is_todo)
static int WINAPIV _vsnwprintf_wrapper(wchar_t *str, size_t len, const wchar_t *format,...)
static void test_vsnwprintf_s(void)
static void test_vsnwprintf(void)
static int WINAPIV _vscwprintf_wrapper(const wchar_t *format,...)
static int WINAPIV vswprintf_wrapper(wchar_t *str, const wchar_t *format,...)
static void test_swprintf(void)
static const wchar_t void * locale
static int WINAPIV _vsprintf_p_wrapper(char *str, size_t sizeOfBuffer, const char *format,...)
static int WINAPIV _vswprintf_p_l_wrapper(wchar_t *str, size_t size, const wchar_t *format, void *locale,...)
static void test_sprintf(void)
static int WINAPIV _vswprintf_l_wrapper(wchar_t *str, const wchar_t *format, void *locale,...)
static float __port_ind(void)
static void test__get_output_format(void)
static size_t size_t count
static void test_vsprintf_p(void)
static size_t sizeOfBuffer
static size_t size_t const wchar_t * format
static static const char va_list
static void test_vscprintf(void)
static struct @1693 test_cvt_testcases[]
static void test_fprintf(void)
static size_t double int int int * sign
static int WINAPIV _vsnwprintf_s_wrapper(wchar_t *str, size_t sizeOfBuffer, size_t count, const wchar_t *format,...)
static int WINAPIV _vswprintf_c_l_wrapper(wchar_t *str, size_t size, const wchar_t *format, void *locale,...)
static void test_snprintf(void)
static int WINAPIV _vswprintf_wrapper(wchar_t *str, const wchar_t *format,...)
static void test_vscwprintf(void)
static size_t double int ndigits
static void test_vswprintf(void)
static size_t double int int * decpt
static size_t double number
static int WINAPIV _vswprintf_c_wrapper(wchar_t *str, size_t size, const wchar_t *format,...)
static void test_fcvt(void)
static int WINAPIV _vscprintf_wrapper(const char *format,...)
static void test_xcvt(void)
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out