29#define WIN32_NO_STATUS
87static int (
WINAPIV *psscanf)(
const char *,
const char *, ...);
111 ok(
hntdll != 0,
"LoadLibrary failed\n");
112#define X(name) p##name = (void *)GetProcAddress( hntdll, #name );
176#define LARGE_STRI_BUFFER_LENGTH 67
187 {10, 123,
"123\0---------------------------------------------------------------", 0x77},
189 { 2, 0x80000000U,
"10000000000000000000000000000000\0----------------------------------", 0x67},
190 { 2, -2147483647,
"10000000000000000000000000000001\0----------------------------------", 0x67},
191 { 2, -65537,
"11111111111111101111111111111111\0----------------------------------", 0x67},
192 { 2, -65536,
"11111111111111110000000000000000\0----------------------------------", 0x67},
193 { 2, -65535,
"11111111111111110000000000000001\0----------------------------------", 0x67},
194 { 2, -32768,
"11111111111111111000000000000000\0----------------------------------", 0x67},
195 { 2, -32767,
"11111111111111111000000000000001\0----------------------------------", 0x67},
196 { 2, -2,
"11111111111111111111111111111110\0----------------------------------", 0x67},
197 { 2, -1,
"11111111111111111111111111111111\0----------------------------------", 0x67},
198 { 2, 0,
"0\0-----------------------------------------------------------------", 0x77},
199 { 2, 1,
"1\0-----------------------------------------------------------------", 0x77},
200 { 2, 10,
"1010\0--------------------------------------------------------------", 0x77},
201 { 2, 100,
"1100100\0-----------------------------------------------------------", 0x77},
202 { 2, 1000,
"1111101000\0--------------------------------------------------------", 0x77},
203 { 2, 10000,
"10011100010000\0----------------------------------------------------", 0x77},
204 { 2, 32767,
"111111111111111\0---------------------------------------------------", 0x77},
205 { 2, 32768,
"1000000000000000\0--------------------------------------------------", 0x77},
206 { 2, 65535,
"1111111111111111\0--------------------------------------------------", 0x77},
207 { 2, 100000,
"11000011010100000\0-------------------------------------------------", 0x77},
208 { 2, 234567,
"111001010001000111\0------------------------------------------------", 0x77},
209 { 2, 300000,
"1001001001111100000\0-----------------------------------------------", 0x77},
210 { 2, 524287,
"1111111111111111111\0-----------------------------------------------", 0x77},
211 { 2, 524288,
"10000000000000000000\0----------------------------------------------", 0x67},
212 { 2, 1000000,
"11110100001001000000\0----------------------------------------------", 0x67},
213 { 2, 10000000,
"100110001001011010000000\0------------------------------------------", 0x67},
214 { 2, 100000000,
"101111101011110000100000000\0---------------------------------------", 0x67},
215 { 2, 1000000000,
"111011100110101100101000000000\0------------------------------------", 0x67},
216 { 2, 1073741823,
"111111111111111111111111111111\0------------------------------------", 0x67},
217 { 2, 2147483646,
"1111111111111111111111111111110\0-----------------------------------", 0x67},
218 { 2, 2147483647,
"1111111111111111111111111111111\0-----------------------------------", 0x67},
219 { 2, 2147483648U,
"10000000000000000000000000000000\0----------------------------------", 0x67},
220 { 2, 2147483649U,
"10000000000000000000000000000001\0----------------------------------", 0x67},
221 { 2, 4294967294U,
"11111111111111111111111111111110\0----------------------------------", 0x67},
222 { 2, 0xFFFFFFFF,
"11111111111111111111111111111111\0----------------------------------", 0x67},
224 { 8, 0x80000000U,
"20000000000\0-------------------------------------------------------", 0x77},
225 { 8, -2147483647,
"20000000001\0-------------------------------------------------------", 0x77},
226 { 8, -2,
"37777777776\0-------------------------------------------------------", 0x77},
227 { 8, -1,
"37777777777\0-------------------------------------------------------", 0x77},
228 { 8, 0,
"0\0-----------------------------------------------------------------", 0x77},
229 { 8, 1,
"1\0-----------------------------------------------------------------", 0x77},
230 { 8, 2147483646,
"17777777776\0-------------------------------------------------------", 0x77},
231 { 8, 2147483647,
"17777777777\0-------------------------------------------------------", 0x77},
232 { 8, 2147483648U,
"20000000000\0-------------------------------------------------------", 0x77},
233 { 8, 2147483649U,
"20000000001\0-------------------------------------------------------", 0x77},
234 { 8, 4294967294U,
"37777777776\0-------------------------------------------------------", 0x77},
235 { 8, 4294967295U,
"37777777777\0-------------------------------------------------------", 0x77},
237 {10, 0x80000000U,
"-2147483648\0-------------------------------------------------------", 0x33},
238 {10, 0x80000000U,
"2147483648\0--------------------------------------------------------", 0x44},
239 {10, -2147483647,
"-2147483647\0-------------------------------------------------------", 0x33},
240 {10, -2147483647,
"2147483649\0--------------------------------------------------------", 0x44},
241 {10, -2,
"-2\0----------------------------------------------------------------", 0x33},
242 {10, -2,
"4294967294\0--------------------------------------------------------", 0x44},
243 {10, -1,
"-1\0----------------------------------------------------------------", 0x33},
244 {10, -1,
"4294967295\0--------------------------------------------------------", 0x44},
245 {10, 0,
"0\0-----------------------------------------------------------------", 0x77},
246 {10, 1,
"1\0-----------------------------------------------------------------", 0x77},
247 {10, 12,
"12\0----------------------------------------------------------------", 0x77},
248 {10, 123,
"123\0---------------------------------------------------------------", 0x77},
249 {10, 1234,
"1234\0--------------------------------------------------------------", 0x77},
250 {10, 12345,
"12345\0-------------------------------------------------------------", 0x77},
251 {10, 123456,
"123456\0------------------------------------------------------------", 0x77},
252 {10, 1234567,
"1234567\0-----------------------------------------------------------", 0x77},
253 {10, 12345678,
"12345678\0----------------------------------------------------------", 0x77},
254 {10, 123456789,
"123456789\0---------------------------------------------------------", 0x77},
255 {10, 2147483646,
"2147483646\0--------------------------------------------------------", 0x77},
256 {10, 2147483647,
"2147483647\0--------------------------------------------------------", 0x77},
257 {10, 2147483648U,
"-2147483648\0-------------------------------------------------------", 0x33},
258 {10, 2147483648U,
"2147483648\0--------------------------------------------------------", 0x44},
259 {10, 2147483649U,
"-2147483647\0-------------------------------------------------------", 0x33},
260 {10, 2147483649U,
"2147483649\0--------------------------------------------------------", 0x44},
261 {10, 4294967294U,
"-2\0----------------------------------------------------------------", 0x33},
262 {10, 4294967294U,
"4294967294\0--------------------------------------------------------", 0x44},
263 {10, 4294967295U,
"-1\0----------------------------------------------------------------", 0x33},
264 {10, 4294967295U,
"4294967295\0--------------------------------------------------------", 0x44},
266 {16, 0,
"0\0-----------------------------------------------------------------", 0x77},
267 {16, 1,
"1\0-----------------------------------------------------------------", 0x77},
268 {16, 2147483646,
"7ffffffe\0----------------------------------------------------------", 0x77},
269 {16, 2147483647,
"7fffffff\0----------------------------------------------------------", 0x77},
270 {16, 0x80000000,
"80000000\0----------------------------------------------------------", 0x77},
271 {16, 0x80000001,
"80000001\0----------------------------------------------------------", 0x77},
272 {16, 0xFFFFFFFE,
"fffffffe\0----------------------------------------------------------", 0x77},
273 {16, 0xFFFFFFFF,
"ffffffff\0----------------------------------------------------------", 0x77},
275 { 2, 32768,
"1000000000000000\0--------------------------------------------------", 0x77},
276 { 2, 65536,
"10000000000000000\0-------------------------------------------------", 0x77},
277 { 2, 131072,
"100000000000000000\0------------------------------------------------", 0x77},
278 {16, 0xffffffff,
"ffffffff\0----------------------------------------------------------", 0x77},
279 {16, 0xa,
"a\0-----------------------------------------------------------------", 0x77},
280 {16, 0,
"0\0-----------------------------------------------------------------", 0x77},
281 {20, 3368421,
"111111\0------------------------------------------------------------", 0x77},
282 {36, 62193781,
"111111\0------------------------------------------------------------", 0x77},
283 {37, 71270178,
"111111\0------------------------------------------------------------", 0x77},
298 "(test %d): _itoa(%d, [out], %d) has result %p, expected: %p\n",
301 "(test %d): _itoa(%d, [out], %d) assigns string \"%s\", expected: \"%s\"\n",
317 "(test %d): _ltoa(%ld, [out], %d) has result %p, expected: %p\n",
320 "(test %d): _ltoa(%ld, [out], %d) assigns string \"%s\", expected: \"%s\"\n",
336 "(test %d): _ultoa(%lu, [out], %d) has result %p, expected: %p\n",
339 "(test %d): _ultoa(%lu, [out], %d) assigns string \"%s\", expected: \"%s\"\n",
378 dest_wstr[
pos] =
'-';
383 unicode_string.
Buffer = dest_wstr;
386 pRtlUnicodeStringToAnsiString(&ansi_str, &unicode_string, 1);
388 "(test %d): _itow(%d, [out], %d) has result %p, expected: %p\n",
391 "(test %d): _itow(%d, [out], %d) assigns string \"%s\", expected: \"%s\"\n",
393 pRtlFreeAnsiString(&ansi_str);
413 dest_wstr[
pos] =
'-';
418 unicode_string.
Buffer = dest_wstr;
422 pRtlUnicodeStringToAnsiString(&ansi_str, &unicode_string, 1);
424 "(test %d): _ltow(%ld, [out], %d) has result %p, expected: %p\n",
427 "(test %d): _ltow(%ld, [out], %d) assigns string \"%s\", expected: \"%s\"\n",
429 pRtlFreeAnsiString(&ansi_str);
449 dest_wstr[
pos] =
'-';
454 unicode_string.
Buffer = dest_wstr;
458 pRtlUnicodeStringToAnsiString(&ansi_str, &unicode_string, 1);
460 "(test %d): _ultow(%lu, [out], %d) has result %p, expected: %p\n",
463 "(test %d): _ultow(%lu, [out], %d) assigns string \"%s\", expected: \"%s\"\n",
465 pRtlFreeAnsiString(&ansi_str);
490 "(test a): _itow(%ld, NULL, 10) has result %p, expected: NULL\n",
498 "(test b): _ltow(%ld, NULL, 10) has result %p, expected: NULL\n",
506 "(test c): _ultow(%ld, NULL, 10) has result %p, expected: NULL\n",
511#define ULL(a,b) (((ULONGLONG)(a) << 32) | (b))
522 {10, 123,
"123\0---------------------------------------------------------------", 0x33},
524 { 2, 0x80000000U,
"10000000000000000000000000000000\0----------------------------------", 0x33},
525 { 2, -2147483647,
"1111111111111111111111111111111110000000000000000000000000000001\0--", 0x33},
526 { 2, -65537,
"1111111111111111111111111111111111111111111111101111111111111111\0--", 0x33},
527 { 2, -65536,
"1111111111111111111111111111111111111111111111110000000000000000\0--", 0x33},
528 { 2, -65535,
"1111111111111111111111111111111111111111111111110000000000000001\0--", 0x33},
529 { 2, -32768,
"1111111111111111111111111111111111111111111111111000000000000000\0--", 0x33},
530 { 2, -32767,
"1111111111111111111111111111111111111111111111111000000000000001\0--", 0x33},
531 { 2, -2,
"1111111111111111111111111111111111111111111111111111111111111110\0--", 0x33},
532 { 2, -1,
"1111111111111111111111111111111111111111111111111111111111111111\0--", 0x33},
533 { 2, 0,
"0\0-----------------------------------------------------------------", 0x33},
534 { 2, 1,
"1\0-----------------------------------------------------------------", 0x33},
535 { 2, 10,
"1010\0--------------------------------------------------------------", 0x33},
536 { 2, 100,
"1100100\0-----------------------------------------------------------", 0x33},
537 { 2, 1000,
"1111101000\0--------------------------------------------------------", 0x33},
538 { 2, 10000,
"10011100010000\0----------------------------------------------------", 0x33},
539 { 2, 32767,
"111111111111111\0---------------------------------------------------", 0x33},
540 { 2, 32768,
"1000000000000000\0--------------------------------------------------", 0x33},
541 { 2, 65535,
"1111111111111111\0--------------------------------------------------", 0x33},
542 { 2, 100000,
"11000011010100000\0-------------------------------------------------", 0x33},
543 { 2, 234567,
"111001010001000111\0------------------------------------------------", 0x33},
544 { 2, 300000,
"1001001001111100000\0-----------------------------------------------", 0x33},
545 { 2, 524287,
"1111111111111111111\0-----------------------------------------------", 0x33},
546 { 2, 524288,
"10000000000000000000\0----------------------------------------------", 0x33},
547 { 2, 1000000,
"11110100001001000000\0----------------------------------------------", 0x33},
548 { 2, 10000000,
"100110001001011010000000\0------------------------------------------", 0x33},
549 { 2, 100000000,
"101111101011110000100000000\0---------------------------------------", 0x33},
550 { 2, 1000000000,
"111011100110101100101000000000\0------------------------------------", 0x33},
551 { 2, 1073741823,
"111111111111111111111111111111\0------------------------------------", 0x33},
552 { 2, 2147483646,
"1111111111111111111111111111110\0-----------------------------------", 0x33},
553 { 2, 2147483647,
"1111111111111111111111111111111\0-----------------------------------", 0x33},
554 { 2, 2147483648U,
"10000000000000000000000000000000\0----------------------------------", 0x33},
555 { 2, 2147483649U,
"10000000000000000000000000000001\0----------------------------------", 0x33},
556 { 2, 4294967294U,
"11111111111111111111111111111110\0----------------------------------", 0x33},
557 { 2, 0xFFFFFFFF,
"11111111111111111111111111111111\0----------------------------------", 0x33},
558 { 2,
ULL(0x1,0xffffffff),
"111111111111111111111111111111111\0---------------------------------", 0x33},
559 { 2, ((
ULONGLONG)100000)*100000,
"1001010100000010111110010000000000\0--------------------------------", 0x33},
560 { 2,
ULL(0x3,0xffffffff),
"1111111111111111111111111111111111\0--------------------------------", 0x33},
561 { 2,
ULL(0x7,0xffffffff),
"11111111111111111111111111111111111\0-------------------------------", 0x33},
562 { 2,
ULL(0xf,0xffffffff),
"111111111111111111111111111111111111\0------------------------------", 0x33},
563 { 2, ((
ULONGLONG)100000)*1000000,
"1011101001000011101101110100000000000\0-----------------------------", 0x33},
564 { 2,
ULL(0x1f,0xffffffff),
"1111111111111111111111111111111111111\0-----------------------------", 0x33},
565 { 2,
ULL(0x3f,0xffffffff),
"11111111111111111111111111111111111111\0----------------------------", 0x33},
566 { 2,
ULL(0x7f,0xffffffff),
"111111111111111111111111111111111111111\0---------------------------", 0x33},
567 { 2,
ULL(0xff,0xffffffff),
"1111111111111111111111111111111111111111\0--------------------------", 0x33},
569 { 8, 0x80000000U,
"20000000000\0-------------------------------------------------------", 0x33},
570 { 8, -2147483647,
"1777777777760000000001\0--------------------------------------------", 0x33},
571 { 8, -2,
"1777777777777777777776\0--------------------------------------------", 0x33},
572 { 8, -1,
"1777777777777777777777\0--------------------------------------------", 0x33},
573 { 8, 0,
"0\0-----------------------------------------------------------------", 0x33},
574 { 8, 1,
"1\0-----------------------------------------------------------------", 0x33},
575 { 8, 2147483646,
"17777777776\0-------------------------------------------------------", 0x33},
576 { 8, 2147483647,
"17777777777\0-------------------------------------------------------", 0x33},
577 { 8, 2147483648U,
"20000000000\0-------------------------------------------------------", 0x33},
578 { 8, 2147483649U,
"20000000001\0-------------------------------------------------------", 0x33},
579 { 8, 4294967294U,
"37777777776\0-------------------------------------------------------", 0x33},
580 { 8, 4294967295U,
"37777777777\0-------------------------------------------------------", 0x33},
582 {10, 0x80000000U,
"2147483648\0--------------------------------------------------------", 0x33},
583 {10, -2147483647,
"-2147483647\0-------------------------------------------------------", 0x55},
584 {10, -2147483647,
"-18446744071562067969\0---------------------------------------------", 0x00},
585 {10, -2147483647,
"18446744071562067969\0----------------------------------------------", 0x22},
586 {10, -2,
"-2\0----------------------------------------------------------------", 0x55},
587 {10, -2,
"-18446744073709551614\0---------------------------------------------", 0x00},
588 {10, -2,
"18446744073709551614\0----------------------------------------------", 0x22},
589 {10, -1,
"-1\0----------------------------------------------------------------", 0x55},
590 {10, -1,
"-18446744073709551615\0---------------------------------------------", 0x00},
591 {10, -1,
"18446744073709551615\0----------------------------------------------", 0x22},
592 {10, 0,
"0\0-----------------------------------------------------------------", 0x33},
593 {10, 1,
"1\0-----------------------------------------------------------------", 0x33},
594 {10, 12,
"12\0----------------------------------------------------------------", 0x33},
595 {10, 123,
"123\0---------------------------------------------------------------", 0x33},
596 {10, 1234,
"1234\0--------------------------------------------------------------", 0x33},
597 {10, 12345,
"12345\0-------------------------------------------------------------", 0x33},
598 {10, 123456,
"123456\0------------------------------------------------------------", 0x33},
599 {10, 1234567,
"1234567\0-----------------------------------------------------------", 0x33},
600 {10, 12345678,
"12345678\0----------------------------------------------------------", 0x33},
601 {10, 123456789,
"123456789\0---------------------------------------------------------", 0x33},
602 {10, 2147483646,
"2147483646\0--------------------------------------------------------", 0x33},
603 {10, 2147483647,
"2147483647\0--------------------------------------------------------", 0x33},
604 {10, 2147483648U,
"2147483648\0--------------------------------------------------------", 0x33},
605 {10, 2147483649U,
"2147483649\0--------------------------------------------------------", 0x33},
606 {10, 4294967294U,
"4294967294\0--------------------------------------------------------", 0x33},
607 {10, 4294967295U,
"4294967295\0--------------------------------------------------------", 0x33},
608 {10,
ULL(0x2,0xdfdc1c35),
"12345678901\0-------------------------------------------------------", 0x33},
609 {10,
ULL(0xe5,0xf4c8f374),
"987654321012\0------------------------------------------------------", 0x33},
610 {10,
ULL(0x1c0,0xfc161e3e),
"1928374656574\0-----------------------------------------------------", 0x33},
611 {10,
ULL(0xbad,0xcafeface),
"12841062955726\0----------------------------------------------------", 0x33},
612 {10,
ULL(0x5bad,0xcafeface),
"100801993177806\0---------------------------------------------------", 0x33},
613 {10,
ULL(0xaface,0xbeefcafe),
"3090515640699646\0--------------------------------------------------", 0x33},
614 {10,
ULL(0xa5beef,0xabcdcafe),
"46653307746110206\0-------------------------------------------------", 0x33},
615 {10,
ULL(0x1f8cf9b,0xf2df3af1),
"142091656963767025\0------------------------------------------------", 0x33},
616 {10,
ULL(0x0fffffff,0xffffffff),
"1152921504606846975\0-----------------------------------------------", 0x33},
617 {10,
ULL(0x7fffffff,0xffffffff),
"9223372036854775807\0-----------------------------------------------", 0x33},
618 {10,
ULL(0x80000000,0x00000000),
"-9223372036854775808\0----------------------------------------------", 0x11},
619 {10,
ULL(0x80000000,0x00000000),
"9223372036854775808\0-----------------------------------------------", 0x22},
620 {10,
ULL(0x80000000,0x00000001),
"-9223372036854775807\0----------------------------------------------", 0x55},
621 {10,
ULL(0x80000000,0x00000001),
"-9223372036854775809\0----------------------------------------------", 0x00},
622 {10,
ULL(0x80000000,0x00000001),
"9223372036854775809\0-----------------------------------------------", 0x22},
623 {10,
ULL(0x80000000,0x00000002),
"-9223372036854775806\0----------------------------------------------", 0x55},
624 {10,
ULL(0x80000000,0x00000002),
"-9223372036854775810\0----------------------------------------------", 0x00},
625 {10,
ULL(0x80000000,0x00000002),
"9223372036854775810\0-----------------------------------------------", 0x22},
626 {10,
ULL(0xffffffff,0xfffffffe),
"-2\0----------------------------------------------------------------", 0x55},
627 {10,
ULL(0xffffffff,0xfffffffe),
"-18446744073709551614\0---------------------------------------------", 0x00},
628 {10,
ULL(0xffffffff,0xfffffffe),
"18446744073709551614\0----------------------------------------------", 0x22},
629 {10,
ULL(0xffffffff,0xffffffff),
"-1\0----------------------------------------------------------------", 0x55},
630 {10,
ULL(0xffffffff,0xffffffff),
"-18446744073709551615\0---------------------------------------------", 0x00},
631 {10,
ULL(0xffffffff,0xffffffff),
"18446744073709551615\0----------------------------------------------", 0x22},
633 {16, 0,
"0\0-----------------------------------------------------------------", 0x33},
634 {16, 1,
"1\0-----------------------------------------------------------------", 0x33},
635 {16, 2147483646,
"7ffffffe\0----------------------------------------------------------", 0x33},
636 {16, 2147483647,
"7fffffff\0----------------------------------------------------------", 0x33},
637 {16, 0x80000000,
"80000000\0----------------------------------------------------------", 0x33},
638 {16, 0x80000001,
"80000001\0----------------------------------------------------------", 0x33},
639 {16, 0xFFFFFFFE,
"fffffffe\0----------------------------------------------------------", 0x33},
640 {16, 0xFFFFFFFF,
"ffffffff\0----------------------------------------------------------", 0x33},
641 {16,
ULL(0x1,0x00000000),
"100000000\0---------------------------------------------------------", 0x33},
642 {16,
ULL(0xbad,0xdeadbeef),
"baddeadbeef\0-------------------------------------------------------", 0x33},
643 {16,
ULL(0x80000000,0x00000000),
"8000000000000000\0--------------------------------------------------", 0x33},
644 {16,
ULL(0xfedcba98,0x76543210),
"fedcba9876543210\0--------------------------------------------------", 0x33},
645 {16,
ULL(0xffffffff,0x80000001),
"ffffffff80000001\0--------------------------------------------------", 0x33},
646 {16,
ULL(0xffffffff,0xfffffffe),
"fffffffffffffffe\0--------------------------------------------------", 0x33},
647 {16,
ULL(0xffffffff,0xffffffff),
"ffffffffffffffff\0--------------------------------------------------", 0x33},
649 { 2, 32768,
"1000000000000000\0--------------------------------------------------", 0x33},
650 { 2, 65536,
"10000000000000000\0-------------------------------------------------", 0x33},
651 { 2, 131072,
"100000000000000000\0------------------------------------------------", 0x33},
652 {16, 0xffffffff,
"ffffffff\0----------------------------------------------------------", 0x33},
653 {16, 0xa,
"a\0-----------------------------------------------------------------", 0x33},
654 {16, 0,
"0\0-----------------------------------------------------------------", 0x33},
655 {20, 3368421,
"111111\0------------------------------------------------------------", 0x33},
656 {36, 62193781,
"111111\0------------------------------------------------------------", 0x33},
657 {37, 71270178,
"111111\0------------------------------------------------------------", 0x33},
658 {99,
ULL(0x2,0x3c9e468c),
"111111\0------------------------------------------------------------", 0x33},
671 "(test %d): _i64toa(%s, [out], %d) has result %p, expected: %p\n",
677 "(test %d): _i64toa(%s, [out], %d) assigns string \"%s\", expected: \"%s\"\n",
684 "(test %d): _i64toa(%s, [out], %d) assigns string \"%s\", expected: \"%s\"\n",
700 "(test %d): _ui64toa(%s, [out], %d) has result %p, expected: %p\n",
703 "(test %d): _ui64toa(%s, [out], %d) assigns string \"%s\", expected: \"%s\"\n",
717 if (p_ui64toa !=
NULL) {
741 dest_wstr[
pos] =
'-';
746 unicode_string.
Buffer = dest_wstr;
749 pRtlUnicodeStringToAnsiString(&ansi_str, &unicode_string, 1);
751 "(test %d): _i64tow(0x%s, [out], %d) has result %p, expected: %p\n",
761 "(test %d): _i64tow(0x%s, [out], %d) assigns string \"%s\", expected: \"%s\"\n",
768 "(test %d): _i64tow(0x%s, [out], %d) assigns string \"%s\", expected: \"%s\"\n",
772 pRtlFreeAnsiString(&ansi_str);
791 dest_wstr[
pos] =
'-';
796 unicode_string.
Buffer = dest_wstr;
799 pRtlUnicodeStringToAnsiString(&ansi_str, &unicode_string, 1);
801 "(test %d): _ui64tow(0x%s, [out], %d) has result %p, expected: %p\n",
805 "(test %d): _ui64tow(0x%s, [out], %d) assigns string \"%s\", expected: \"%s\"\n",
808 pRtlFreeAnsiString(&ansi_str);
832 "(test d): _i64tow(0x%s, NULL, 10) has result %p, expected: NULL\n",
841 "(test e): _ui64tow(0x%s, NULL, 10) has result %p, expected: NULL\n",
854 {
"1011101100", 1011101100 },
855 {
"1234567", 1234567 },
894 {
" \n \r \t214", 214 },
895 {
" \n \r \t+214", 214 },
896 {
" \n \r \t-214", -214 },
905 {
"-9999999999", -1410065407 },
906 {
"-2147483649", 2147483647 },
907 {
"-2147483648", 0x80000000 },
908 {
"-2147483647", -2147483647 },
912 {
"2147483646", 2147483646 },
913 {
"2147483647", 2147483647 },
914 {
"2147483648", 2147483648UL },
915 {
"2147483649", 2147483649UL },
916 {
"4294967294", 4294967294UL },
917 {
"4294967295", 4294967295UL },
919 {
"9999999999", 1410065407 },
921 {
"b1011101100", 0 },
922 {
"-b1011101100", 0 },
923 {
"b10123456789", 0 },
924 {
"0b1011101100", 0 },
925 {
"-0b1011101100", 0 },
926 {
"0b10123456789", 0 },
927 {
"-0b10123456789", 0 },
941 {
"0d1011101100", 0 },
947 {
"-0xFEDCBA00", 0 },
965 pRtlCreateUnicodeStringFromAsciiz(&uni,
str2long[test_num].
str);
968 "(test %d): call failed: _wtoi(\"%s\") has result %d, expected: %ld\n",
970 pRtlFreeUnicodeString(&uni);
982 "(test %d): call failed: _atoi(\"%s\") has result %d, expected: %ld\n",
995 "(test %d): call failed: _atol(\"%s\") has result %d, expected: %ld\n",
1007 pRtlCreateUnicodeStringFromAsciiz(&uni,
str2long[test_num].
str);
1010 "(test %d): call failed: _wtol(\"%s\") has result %ld, expected: %ld\n",
1012 pRtlFreeUnicodeString(&uni);
1014 result = p_wtol(
L"\t\xa0\n 12" );
1016 result = p_wtol(
L"\x3000 12" );
1028 {
"1011101100", 1011101100 },
1029 {
"1234567", 1234567 },
1068 {
" \n \r \t214", 214 },
1069 {
" \n \r \t+214", 214 },
1070 {
" \n \r \t-214", -214 },
1079 {
"-99999999999999999999", -
ULL(0x6bc75e2d,0x630fffff), -1 },
1080 {
"-9223372036854775809",
ULL(0x7fffffff,0xffffffff), -1 },
1081 {
"-9223372036854775808",
ULL(0x80000000,0x00000000) },
1082 {
"-9223372036854775807", -
ULL(0x7fffffff,0xffffffff) },
1083 {
"-9999999999", -
ULL(0x00000002,0x540be3ff) },
1084 {
"-2147483649", -
ULL(0x00000000,0x80000001) },
1085 {
"-2147483648", -
ULL(0x00000000,0x80000000) },
1086 {
"-2147483647", -2147483647 },
1090 {
"2147483646", 2147483646 },
1091 {
"2147483647", 2147483647 },
1092 {
"2147483648",
ULL(0x00000000,0x80000000) },
1093 {
"2147483649",
ULL(0x00000000,0x80000001) },
1094 {
"4294967294",
ULL(0x00000000,0xfffffffe) },
1095 {
"4294967295",
ULL(0x00000000,0xffffffff) },
1096 {
"4294967296",
ULL(0x00000001,0x00000000) },
1097 {
"9999999999",
ULL(0x00000002,0x540be3ff) },
1098 {
"9223372036854775806",
ULL(0x7fffffff,0xfffffffe) },
1099 {
"9223372036854775807",
ULL(0x7fffffff,0xffffffff) },
1100 {
"9223372036854775808",
ULL(0x80000000,0x00000000), 1 },
1101 {
"9223372036854775809",
ULL(0x80000000,0x00000001), 1 },
1102 {
"18446744073709551614",
ULL(0xffffffff,0xfffffffe), 1 },
1103 {
"18446744073709551615",
ULL(0xffffffff,0xffffffff), 1 },
1104 {
"18446744073709551616", 0, 1 },
1105 {
"99999999999999999999",
ULL(0x6bc75e2d,0x630fffff), 1 },
1106 {
"056789", 56789 },
1107 {
"b1011101100", 0 },
1108 {
"-b1011101100", 0 },
1109 {
"b10123456789", 0 },
1110 {
"0b1011101100", 0 },
1111 {
"-0b1011101100", 0 },
1112 {
"0b10123456789", 0 },
1113 {
"-0b10123456789", 0 },
1121 {
"-0o1234567", 0 },
1127 {
"0d1011101100", 0 },
1130 {
"-xFEDCBA00", 0 },
1131 {
"0x89abcdef", 0 },
1132 {
"0xFEDCBA00", 0 },
1133 {
"-0xFEDCBA00", 0 },
1134 {
"0xabcdefgh", 0 },
1135 {
"0xABCDEFGH", 0 },
1154 ULL(0x80000000,0x00000000) :
ULL(0x7fffffff,0xffffffff))),
1155 "(test %d): call failed: _atoi64(\"%s\") has result 0x%s, expected: 0x%s\n",
1160 "(test %d): call failed: _atoi64(\"%s\") has result 0x%s, expected: 0x%s\n",
1179 ULL(0x80000000,0x00000000) :
ULL(0x7fffffff,0xffffffff))),
1180 "(test %d): call failed: _atoi64(\"%s\") has result 0x%s, expected: 0x%s\n",
1185 "(test %d): call failed: _atoi64(\"%s\") has result 0x%s, expected: 0x%s\n",
1188 pRtlFreeUnicodeString(&uni);
1190 result = p_wtoi64(
L"\t\xa0\n 12" );
1192 result = p_wtoi64(
L"\x2002\x2003 12" );
1202 {
L"-1234", -1234, -1234 },
1203 {
L"\x09\x0a\x0b\x0c\x0d -123", -123, -123 },
1204 {
L"\xa0 +44", 44, 44 },
1205 {
L"\x2002\x2003 +55", 0, 0 },
1206 {
L"\x3000 +66", 0, 0 },
1207 { { 0x3231 }, 0, 0 },
1208 { { 0x4e00 }, 0, 0 },
1209 { { 0x0bef }, 0, 0 },
1210 { { 0x0e59 }, 9, 9 },
1211 { { 0xff19 }, 9, 9 },
1212 { { 0x00b9 }, 0, 0 },
1213 { {
'-',0x0e50,
'x',0xff19,
'1' }, -0x91, -0x91 },
1214 { {
'+',0x0e50,0xff17,
'1' }, 071, 071 },
1215 { { 0xff19,
'f',0x0e59,0xff46 }, 0x9f9, 0x9f9, 16 },
1216 {
L"2147483647", 2147483647, 2147483647 },
1217 {
L"2147483648",
LONG_MAX, 2147483648 },
1218 {
L"4294967295",
LONG_MAX, 4294967295 },
1221 {
L"-2147483647", -2147483647, -2147483647 },
1225 {
L"-9223372036854775807",
LONG_MIN, 1 },
1227 static const WCHAR zeros[] =
1229 0x0660, 0x06f0, 0x0966, 0x09e6, 0x0a66, 0x0ae6, 0x0b66, 0x0c66, 0x0ce6,
1230 0x0d66, 0x0e50, 0x0ed0, 0x0f20, 0x1040, 0x17e0, 0x1810, 0xff10
1249 WCHAR tmp[] = { zeros[
i] + 4, zeros[
i], zeros[
i] + 5, 0 };
1251 ok(
res == 405,
"with zero = U+%04X: got %ld, expected 405\n", zeros[
i],
res);
1252 ures = pwcstoul(tmp,
NULL, 0);
1253 ok(ures == 405,
"with zero = U+%04X: got %lu, expected 405\n", zeros[
i], ures);
1254 tmp[1] = zeros[
i] + 10;
1256 ok(
res == 4,
"with zero = U+%04X: got %ld, expected 4\n", zeros[
i],
res);
1257 ures = pwcstoul(tmp,
NULL, 16);
1258 ok(ures == 4,
"with zero = U+%04X: got %lu, expected 4\n", zeros[
i], ures);
1264 static const WCHAR teststringW[] = {
'a',
'b',
'r',
'a',
'c',
'a',
'd',
'a',
'b',
'r',
'a',0};
1266 ok(pwcschr(teststringW,
'a') == teststringW + 0,
1267 "wcschr should have returned a pointer to the first 'a' character\n");
1268 ok(pwcschr(teststringW, 0) == teststringW + 11,
1269 "wcschr should have returned a pointer to the null terminator\n");
1270 ok(pwcschr(teststringW,
'x') ==
NULL,
1271 "wcschr should have returned NULL\n");
1276 static const WCHAR teststringW[] = {
'a',
'b',
'r',
'a',
'c',
'a',
'd',
'a',
'b',
'r',
'a',0};
1278 ok(pwcsrchr(teststringW,
'a') == teststringW + 10,
1279 "wcsrchr should have returned a pointer to the last 'a' character\n");
1280 ok(pwcsrchr(teststringW, 0) == teststringW + 11,
1281 "wcsrchr should have returned a pointer to the null terminator\n");
1282 ok(pwcsrchr(teststringW,
'x') ==
NULL,
1283 "wcsrchr should have returned NULL\n");
1288 static WCHAR teststringW[] = {
'a',
'b',
'r',
'a',
'c',
'a',
'd',
'a',
'b',
'r',
'a',0};
1290 static const WCHAR constemptyW[] = {0};
1296 static const WCHAR conststringW[] = {
'a',
'b',
'r',
'a',
'c',
'a',
'd',
'a',
'b',
'r',
'a',0};
1297 ok(
p_wcslwr((
LPWSTR)conststringW) == conststringW,
"p_wcslwr returned different string\n");
1298 ok(
p_wcsupr((
LPWSTR)conststringW) == conststringW,
"p_wcsupr returned different string\n");
1302 ok(
p_wcslwr(teststringW) == teststringW,
"p_wcslwr returned different string\n");
1303 ok(
p_wcsupr(teststringW) == teststringW,
"p_wcsupr returned different string\n");
1306 ok(
p_wcslwr((
LPWSTR)constemptyW) == constemptyW,
"p_wcslwr returned different string\n");
1307 ok(
p_wcsupr((
LPWSTR)constemptyW) == constemptyW,
"p_wcsupr returned different string\n");
1309 for (
i = 0;
i < 65536;
i++)
1311 WCHAR lwr = ((
i >=
'A' &&
i <=
'Z') || (
i >= 0xc0 &&
i <= 0xd6) || (
i >= 0xd8 &&
i <= 0xde)) ?
i + 32 :
i;
1312 WCHAR upr = pRtlUpcaseUnicodeChar(
i );
1313 ok( ptowlower(
i ) == lwr,
"%04x: towlower got %04x expected %04x\n",
i, ptowlower(
i ), lwr );
1314 ok( ptowupper(
i ) == upr,
"%04x: towupper got %04x expected %04x\n",
i, ptowupper(
i ), upr );
1320 for (
i = 1;
i < 65536;
i++)
1326 for (
i = 1;
i < 65536;
i++)
1332 WCHAR buf_a[2], buf_b[2];
1335 buf_a[1] = buf_b[1] = 0;
1336 for (
i = 0;
i < 0x300;
i++)
1338 int lwr_a = (
i >=
'A' &&
i <=
'Z') ?
i + 32 :
i;
1340 for (
j = 0;
j < 0x300;
j++)
1342 int lwr_b = (
j >=
'A' &&
j <=
'Z') ?
j + 32 :
j;
1345 ok(
ret == lwr_a - lwr_b,
"%04x:%04x: strings differ %d\n",
i,
j,
ret );
1347 ok(
ret == lwr_a - lwr_b,
"%04x:%04x: strings differ %d\n",
i,
j,
ret );
1354 const int *
p =
a, *
q =
b;
1356 ok (
a !=
b,
"must never get the same pointer\n");
1363 const char *
p =
a, *
q =
b;
1365 ok (
a !=
b,
"must never get the same pointer\n");
1372 const char *
const *
p =
a;
1373 const char *
const *
q =
b;
1375 ok (
a !=
b,
"must never get the same pointer\n");
1382 const char *
const *
p =
a;
1383 const char *
const *
q =
b;
1385 ok (
a !=
b,
"must never get the same pointer\n");
1392 int arr[5] = { 23, 42, 8, 4, 16 };
1393 char carr[5] = { 42, 23, 4, 8, 16 };
1394 const char *strarr[7] = {
1403 const char *strarr2[7] = {
1414 ok(arr[0] == 23,
"badly sorted, nmemb=0, arr[0] is %d\n", arr[0]);
1415 ok(arr[1] == 42,
"badly sorted, nmemb=0, arr[1] is %d\n", arr[1]);
1416 ok(arr[2] == 8,
"badly sorted, nmemb=0, arr[2] is %d\n", arr[2]);
1417 ok(arr[3] == 4,
"badly sorted, nmemb=0, arr[3] is %d\n", arr[3]);
1418 ok(arr[4] == 16,
"badly sorted, nmemb=0, arr[4] is %d\n", arr[4]);
1421 ok(arr[0] == 23,
"badly sorted, nmemb=1, arr[0] is %d\n", arr[0]);
1422 ok(arr[1] == 42,
"badly sorted, nmemb=1, arr[1] is %d\n", arr[1]);
1423 ok(arr[2] == 8,
"badly sorted, nmemb=1, arr[2] is %d\n", arr[2]);
1424 ok(arr[3] == 4,
"badly sorted, nmemb=1, arr[3] is %d\n", arr[3]);
1425 ok(arr[4] == 16,
"badly sorted, nmemb=1, arr[4] is %d\n", arr[4]);
1428 ok(arr[0] == 23,
"badly sorted, size=0, arr[0] is %d\n", arr[0]);
1429 ok(arr[1] == 42,
"badly sorted, size=0, arr[1] is %d\n", arr[1]);
1430 ok(arr[2] == 8,
"badly sorted, size=0, arr[2] is %d\n", arr[2]);
1431 ok(arr[3] == 4,
"badly sorted, size=0, arr[3] is %d\n", arr[3]);
1432 ok(arr[4] == 16,
"badly sorted, size=0, arr[4] is %d\n", arr[4]);
1435 ok(arr[0] == 4,
"badly sorted, arr[0] is %d\n", arr[0]);
1436 ok(arr[1] == 8,
"badly sorted, arr[1] is %d\n", arr[1]);
1437 ok(arr[2] == 16,
"badly sorted, arr[2] is %d\n", arr[2]);
1438 ok(arr[3] == 23,
"badly sorted, arr[3] is %d\n", arr[3]);
1439 ok(arr[4] == 42,
"badly sorted, arr[4] is %d\n", arr[4]);
1442 ok(carr[0] == 4,
"badly sorted, carr[0] is %d\n", carr[0]);
1443 ok(carr[1] == 8,
"badly sorted, carr[1] is %d\n", carr[1]);
1444 ok(carr[2] == 16,
"badly sorted, carr[2] is %d\n", carr[2]);
1445 ok(carr[3] == 23,
"badly sorted, carr[3] is %d\n", carr[3]);
1446 ok(carr[4] == 42,
"badly sorted, carr[4] is %d\n", carr[4]);
1449 ok(!
strcmp(strarr[0],
"!"),
"badly sorted, strarr[0] is %s\n", strarr[0]);
1450 ok(!
strcmp(strarr[1],
"."),
"badly sorted, strarr[1] is %s\n", strarr[1]);
1451 ok(!
strcmp(strarr[2],
"Hello"),
"badly sorted, strarr[2] is %s\n", strarr[2]);
1452 ok(!
strcmp(strarr[3],
"Hopefully"),
"badly sorted, strarr[3] is %s\n", strarr[3]);
1453 ok(!
strcmp(strarr[4],
"Sorted"),
"badly sorted, strarr[4] is %s\n", strarr[4]);
1454 ok(!
strcmp(strarr[5],
"Wine"),
"badly sorted, strarr[5] is %s\n", strarr[5]);
1455 ok(!
strcmp(strarr[6],
"World"),
"badly sorted, strarr[6] is %s\n", strarr[6]);
1458 ok(!
strcmp(strarr2[0],
"!"),
"badly sorted, strar2r[0] is %s\n", strarr2[0]);
1459 ok(!
strcmp(strarr2[1],
"Hello"),
"badly sorted, strarr2[1] is %s\n", strarr2[1]);
1460 ok(!
strcmp(strarr2[2],
"Sorted"),
"badly sorted, strarr2[2] is %s\n", strarr2[2]);
1461 ok(!
strcmp(strarr2[3],
"wine"),
"badly sorted, strarr2[3] is %s\n", strarr2[3]);
1462 ok(!
strcmp(strarr2[4],
"WINE"),
"badly sorted, strarr2[4] is %s\n", strarr2[4]);
1463 ok(!
strcmp(strarr2[5],
"Wine"),
"badly sorted, strarr2[5] is %s\n", strarr2[5]);
1464 ok(!
strcmp(strarr2[6],
"World"),
"badly sorted, strarr2[6] is %s\n", strarr2[6]);
1469 int arr[7] = { 1, 3, 4, 8, 16, 23, 42 };
1477 ok (
x == &arr[
i],
"bsearch did not find %d entry in loopsize %d.\n",
i,
j);
1481 ok (
x ==
NULL,
"bsearch did find 4242 entry in loopsize %d.\n",
j);
1487 const char *origstring =
"XXXXXXXXXXXX";
1488 const char *teststring =
"hello world";
1492 res = p_snprintf(
NULL, 0, teststring);
1497 res = p_snprintf(
NULL, 1, teststring);
1499 "_snprintf returned %d, expected %d or < 0.\n",
res,
lstrlenA(teststring));
1502 ok(
res < 0,
"_snprintf returned %d, expected < 0.\n",
res);
1507 ok(!
strcmp(
buffer,
"hello worldX"),
"_snprintf returned buffer '%s', expected 'hello worldX'.\n",
buffer);
1512 ok(!
strcmp(
buffer, teststring),
"_snprintf returned buffer '%s', expected '%s'.\n",
buffer, teststring);
1527 res = p_snprintf(
buffer, 4,
"%s",
"test");
1533 res = p_snprintf(
buffer, 3,
"%s",
"test");
1558 res = p_snprintf(
buffer,
sizeof(
buffer),
"%hx %hd", 0x123456, 987654);
1562 if (
sizeof(
void *) == 8)
1603 res = p_snprintf(
buffer,
sizeof(
buffer),
"%jx %d", 0x1234567890ull, 1);
1608 res = p_snprintf(
buffer,
sizeof(
buffer),
"%llx %d", 0x1234567890ull, 1);
1622 win_skip(
"_snprintf_s not available\n");
1627 res = p_snprintf_s(
buf,
sizeof(
buf),
sizeof(
buf),
"test");
1632 res = p_snprintf_s(
buf, 4, 4,
"test");
1637 res = p_snprintf_s(
buf, 5, 4,
"test");
1642 res = p_snprintf_s(
buf, 5, 3,
"test");
1647 res = p_snprintf_s(
buf, 4, 10,
"test");
1652 res = p_snprintf_s(
buf, 6, 5,
"test%c", 0);
1660 const WCHAR *origstring =
L"XXXXXXXXXXXX";
1661 const WCHAR *teststring =
L"hello world";
1665 res = p_snwprintf(
NULL, 0, teststring);
1669 ok(
res < 0,
"_snprintf returned %d, expected < 0.\n",
res);
1674 ok(!
wcscmp(
buffer,
L"hello worldX"),
"_snprintf returned buffer %s, expected 'hello worldX'.\n",
1680 ok(!
wcscmp(
buffer, teststring),
"_snprintf returned buffer %s, expected %s.\n",
1723 if (
sizeof(
void *) == 8)
1783 win_skip(
"_snwprintf_s not available\n");
1788 res = p_snwprintf_s(
buf,
sizeof(
buf),
sizeof(
buf),
L"test");
1793 res = p_snwprintf_s(
buf, 4, 4,
L"test");
1798 res = p_snwprintf_s(
buf, 5, 4,
L"test");
1803 res = p_snwprintf_s(
buf, 5, 3,
L"test");
1808 res = p_snwprintf_s(
buf, 4, 10,
L"test");
1813 res = p_snwprintf_s(
buf, 6, 5,
L"test%c", 0);
1824 unsigned int arg_size;
1826 const WCHAR *expectedw;
1832 {
"%qu", 0,
"qu",
NULL, 10 },
1833 {
"%ll", 0,
"",
NULL, 10 },
1834 {
"%lu",
sizeof(
ULONG),
"65537",
NULL, 65537 },
1837 {
"%#lx",
sizeof(
ULONG),
"0xa",
NULL, 10 },
1838 {
"%#llx",
sizeof(
ULONG64),
"0x1000000000",
NULL, 0x1000000000 },
1839 {
"%#lllx",
sizeof(
ULONG64),
"0x1000000000",
NULL, 0x1000000000 },
1840 {
"%hu",
sizeof(
ULONG),
"1",
NULL, 65537 },
1841 {
"%hlu",
sizeof(
ULONG),
"1",
NULL, 65537 },
1842 {
"%hllx",
sizeof(
ULONG64),
"100000010",
NULL, 0x100000010 },
1843 {
"%hlllx",
sizeof(
ULONG64),
"100000010",
NULL, 0x100000010 },
1844 {
"%llhx",
sizeof(
ULONG64),
"100000010",
NULL, 0x100000010 },
1845 {
"%lllhx",
sizeof(
ULONG64),
"100000010",
NULL, 0x100000010 },
1846 {
"%lhu",
sizeof(
ULONG),
"1",
NULL, 65537 },
1847 {
"%hhu",
sizeof(
ULONG),
"1",
NULL, 65537 },
1848 {
"%hwu",
sizeof(
ULONG),
"1",
NULL, 65537 },
1849 {
"%whu",
sizeof(
ULONG),
"1",
NULL, 65537 },
1850 {
"%##lhllwlx",
sizeof(
ULONG64),
"0x1000000010",
NULL, 0x1000000010 },
1851 {
"%##lhlwlx",
sizeof(
ULONG),
"0x10",
NULL, 0x1000000010 },
1852 {
"%04lhlwllx",
sizeof(
ULONG64),
"1000000010",
NULL, 0x1000000010 },
1885 {
"%c",
sizeof(
SHORT),
"\xc8",
L"\x95c8", 0x95c8 },
1886 {
"%lc",
sizeof(
SHORT),
"\x3f",
L"\x95c8", 0x95c8 },
1887 {
"%llc",
sizeof(
SHORT),
"\xc8",
L"\x95c8", 0x95c8 },
1888 {
"%lllc",
sizeof(
SHORT),
"\x3f",
L"\x95c8", 0x95c8 },
1889 {
"%llllc",
sizeof(
SHORT),
"\xc8",
L"\x95c8", 0x95c8 },
1890 {
"%lllllc",
sizeof(
SHORT),
"\x3f",
L"\x95c8", 0x95c8 },
1891 {
"%C",
sizeof(
SHORT),
"\x3f",
L"\xc8", 0x95c8 },
1892 {
"%lC",
sizeof(
SHORT),
"\x3f",
L"\x95c8", 0x95c8 },
1893 {
"%llC",
sizeof(
SHORT),
"\x3f",
L"\xc8", 0x95c8 },
1894 {
"%lllC",
sizeof(
SHORT),
"\x3f",
L"\x95c8", 0x95c8 },
1895 {
"%llllC",
sizeof(
SHORT),
"\x3f",
L"\xc8", 0x95c8 },
1896 {
"%lllllC",
sizeof(
SHORT),
"\x3f",
L"\x95c8", 0x95c8 },
1897 {
"%hc",
sizeof(
BYTE),
"\xc8",
L"\xc8", 0x95c8 },
1898 {
"%hhc",
sizeof(
BYTE),
"\xc8",
L"\xc8", 0x95c8 },
1899 {
"%hhhc",
sizeof(
BYTE),
"\xc8",
L"\xc8", 0x95c8 },
1900 {
"%wc",
sizeof(
BYTE),
"\x3f",
L"\x95c8", 0x95c8 },
1901 {
"%wC",
sizeof(
BYTE),
"\x3f",
L"\x95c8", 0x95c8 },
1902 {
"%hwc",
sizeof(
BYTE),
"\x3f",
L"\xc8", 0x95c8 },
1903 {
"%whc",
sizeof(
BYTE),
"\x3f",
L"\xc8", 0x95c8 },
1904 {
"%hwC",
sizeof(
BYTE),
"\x3f",
L"\xc8", 0x95c8 },
1905 {
"%whC",
sizeof(
BYTE),
"\x3f",
L"\xc8", 0x95c8 },
1910 {
"%q%u",
sizeof(
ULONG),
"q10",
NULL, 10 },
1911 {
"%lhw%u", 0,
"%u",
NULL, 10 },
1912 {
"%u% ",
sizeof(
ULONG),
"10",
NULL, 10 },
1913 {
"%u% %u",
sizeof(
ULONG),
"10%u",
NULL, 10 },
1914 {
"% ll u", 0,
" u",
NULL, 10 },
1919 WCHAR ws[256], expectedw[256], specw[256];
1926 p_snwprintf(expectedw,
ARRAY_SIZE(expectedw),
L"%C", 0x95c8);
1927 if (
s[0] != 0x3f ||
ws[0] != 0x95c8 || expectedw[0] != 0xc8)
1930 skip(
"An English non-UTF8 locale is required for the printf tests.\n");
1946 len = p_snwprintf(
ws, ~(
size_t)0, specw,
tests[
i].argw,
L"end");
1947 switch (
tests[
i].arg_size)
1950 p_snprintf(
s, ~(
size_t)0, spec,
"end");
1951 len = p_snwprintf(
ws, ~(
size_t)0, specw,
L"end");
1967 ok(0,
"unknown length %u.\n",
tests[
i].arg_size);
1973 win_skip(
"Skipping unsupported format test %u ('%s') on Windows 2003.\n",
i,
tests[
i].spec);
1989 for (
j = 0;
j <
len; ++
j)
2000 int i,
ret, exp_ret;
2010 ok(ptolower !=
NULL,
"tolower is not available\n");
2012 for (
i = -512;
i < 512;
i++)
2014 exp_ret = (
char)
i >=
'A' && (
char)
i <=
'Z' ?
i -
'A' +
'a' :
i;
2016 ok(
ret == exp_ret,
"tolower(%d) = %d\n",
i,
ret);
2023 int i,
ret, exp_ret;
2027 ok(ptoupper !=
NULL,
"toupper is not available\n");
2029 for (
i = -512;
i < 0xffff;
i++)
2038 ok(!
ret ||
ret == 1 ||
ret == 2,
"WideCharToMultiByte returned %d\n",
ret);
2040 exp_ret = (
unsigned char)
str[1] + ((
unsigned char)
str[0] << 8);
2042 exp_ret = (
unsigned char)
str[0];
2047 ok(
ret == exp_ret,
"toupper(%x) = %x, expected %x\n",
i,
ret, exp_ret);
2067 ok(!
ret,
"_strnicmp returned %d\n",
ret);
2069 ok(
ret == -1,
"_strnicmp returned %d\n",
ret);
2071 ok(!
ret,
"_strnicmp returned %d\n",
ret);
2081 ret = psscanf(
"10",
"%d", &
i);
2083 ok(
i == 10,
"i = %d\n",
i);
2085 ret = psscanf(
"10",
"%f", &
f);
2087 ok(
f == 0.0f,
"f = %f\n",
f);
2089 ret = psscanf(
"10",
"%g", &
f);
2091 ok(
f == 0.0f,
"f = %f\n",
f);
2093 ret = psscanf(
"10",
"%e", &
f);
2095 ok(
f == 0.0f,
"f = %f\n",
f);
2097 ret = psscanf(
"10",
"%lf", &
d);
2099 ok(
d == 0.0,
"d = %lf\n",
f);
2101 ret = psscanf(
"10",
"%lg", &
d);
2103 ok(
d == 0.0,
"d = %lf\n",
f);
2105 ret = psscanf(
"10",
"%le", &
d);
2107 ok(
d == 0.0,
"d = %lf\n",
f);
2113 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020,
2114 0x0020, 0x0068, 0x0028, 0x0028, 0x0028, 0x0028, 0x0020, 0x0020,
2116 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020,
2117 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020,
2119 0x0048, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010,
2120 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010,
2122 0x0084, 0x0084, 0x0084, 0x0084, 0x0084, 0x0084, 0x0084, 0x0084,
2123 0x0084, 0x0084, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010,
2125 0x0010, 0x0181, 0x0181, 0x0181, 0x0181, 0x0181, 0x0181, 0x0101,
2126 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101,
2128 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101,
2129 0x0101, 0x0101, 0x0101, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010,
2131 0x0010, 0x0182, 0x0182, 0x0182, 0x0182, 0x0182, 0x0182, 0x0102,
2132 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102,
2134 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102,
2135 0x0102, 0x0102, 0x0102, 0x0010, 0x0010, 0x0010, 0x0010, 0x0020,
2137 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020,
2138 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020,
2140 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020,
2141 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020,
2143 0x0048, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010,
2144 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010,
2146 0x0010, 0x0010, 0x0014, 0x0014, 0x0010, 0x0010, 0x0010, 0x0010,
2147 0x0010, 0x0014, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010,
2149 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101,
2150 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101,
2152 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0010,
2153 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0102,
2155 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102,
2156 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102,
2158 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0010,
2159 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102
2166 for (
i = 0;
i < 65536;
i++)
2169 ok( piswctype(
i, 0xffff ) ==
type,
"%u: wrong type %x\n",
i, piswctype(
i, 0xffff ));
2182 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020,
2183 0x0020, 0x0028, 0x0028, 0x0028, 0x0028, 0x0028, 0x0020, 0x0020,
2185 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020,
2186 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020,
2188 0x0048, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010,
2189 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010,
2191 0x0084, 0x0084, 0x0084, 0x0084, 0x0084, 0x0084, 0x0084, 0x0084,
2192 0x0084, 0x0084, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010,
2194 0x0010, 0x0181, 0x0181, 0x0181, 0x0181, 0x0181, 0x0181, 0x0101,
2195 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101,
2197 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101,
2198 0x0101, 0x0101, 0x0101, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010,
2200 0x0010, 0x0182, 0x0182, 0x0182, 0x0182, 0x0182, 0x0182, 0x0102,
2201 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102,
2203 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102, 0x0102,
2204 0x0102, 0x0102, 0x0102, 0x0010, 0x0010, 0x0010, 0x0010, 0x0020
2211 for (
i = -1;
i < 256;
i++)
2230 const char s[] =
"ab";
2234 ok(!
r,
"memchr returned %p, expected NULL\n",
r);
2237 ok(
r ==
s,
"memchr returned %p, expected %p\n",
r,
s);
2240 ok(
r ==
s,
"memchr returned %p, expected %p\n",
r,
s);
2243 ok(
r ==
s,
"memchr returned %p, expected %p\n",
r,
s);
static PFN_strnicmp p_strnicmp
static PFN_wcsicmp p_wcsicmp
static PFN_wcslwr p_wcslwr
static PFN_wcsnicmp p_wcsnicmp
static PFN_wcsupr p_wcsupr
#define GetProcAddress(x, y)
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
#define _strnicmp(_String1, _String2, _MaxCount)
#define WideCharToMultiByte
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
int WINAPI lstrcmpA(LPCSTR str1, LPCSTR str2)
int WINAPI lstrcmpiA(LPCSTR str1, LPCSTR str2)
_ACRTIMP int __cdecl _snwprintf_s(wchar_t *, size_t, size_t, const wchar_t *,...)
_ACRTIMP int __cdecl _snwprintf(wchar_t *, size_t, const wchar_t *,...)
_ACRTIMP __msvcrt_long __cdecl _wtol(const wchar_t *)
_ACRTIMP __int64 __cdecl _wtoi64(const wchar_t *)
_ACRTIMP __msvcrt_ulong __cdecl wcstoul(const wchar_t *, wchar_t **, int)
_ACRTIMP __msvcrt_long __cdecl wcstol(const wchar_t *, wchar_t **, int)
_ACRTIMP int __cdecl _wtoi(const wchar_t *)
_ACRTIMP int __cdecl _wcsicmp(const wchar_t *, const wchar_t *)
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
_ACRTIMP int __cdecl _wcsnicmp(const wchar_t *, const wchar_t *, size_t)
_ACRTIMP void __cdecl qsort(void *, size_t, size_t, int(__cdecl *)(const void *, const void *))
_ACRTIMP int __cdecl _ACRTIMP int __cdecl _snprintf_s(char *, size_t, size_t, const char *,...) __WINE_CRT_PRINTF_ATTR(4
_ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl sscanf(const char *, const char *,...) __WINE_CRT_SCANF_ATTR(2
static int __cdecl _snprintf(char *buffer, size_t size, const char *format,...) __WINE_CRT_PRINTF_ATTR(3
_ACRTIMP int __cdecl atoi(const char *)
_ACRTIMP size_t __cdecl strlen(const char *)
char *CDECL _i64toa(__int64 value, char *str, int radix)
__int64 CDECL _atoi64(const char *str)
wchar_t *CDECL _itow(int value, wchar_t *str, int radix)
wchar_t *CDECL _ui64tow(unsigned __int64 value, wchar_t *str, int radix)
char *CDECL _ui64toa(unsigned __int64 value, char *str, int radix)
int __cdecl strcmp(const char *str1, const char *str2)
wchar_t *CDECL _ltow(__msvcrt_long value, wchar_t *str, int radix)
wchar_t *CDECL _i64tow(__int64 value, wchar_t *str, int radix)
wchar_t *CDECL _ultow(__msvcrt_ulong value, wchar_t *str, int radix)
__msvcrt_long CDECL atol(const char *str)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
UNICODE_STRING * PUNICODE_STRING
int __cdecl iswctype(wint_t wc, wctype_t wctypeFlags)
GLint GLint GLint GLint GLint x
GLuint GLuint GLsizei GLenum type
GLdouble GLdouble GLdouble r
GLdouble GLdouble GLdouble GLdouble q
GLboolean GLboolean GLboolean b
GLenum GLuint GLenum GLsizei const GLchar * buf
GLboolean GLboolean GLboolean GLboolean a
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
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 GLint GLint j
static const WCHAR emptyW[]
static const BOOL is_win64
int WINAPI lstrlenA(LPCSTR lpString)
void __cdecl void __cdecl void __cdecl void __cdecl void __cdecl void winetest_pop_context(void)
void __cdecl void __cdecl void __cdecl void __cdecl void __cdecl winetest_push_context(const char *fmt,...) __WINE_PRINTF_ATTR(1
static struct test_info tests[]
static void test_tolower(void)
static void test_atoi(void)
static void test_toupper(void)
static void test_atol(void)
static const str2long_t str2long[]
static int __cdecl istrcomparefunc(const void *a, const void *b)
static void one_itoa_test(int test_num, const ulong2str_t *ulong2str)
static void test_ulongtow(void)
static void test_ulonglongtow(void)
static void one_ui64toa_test(int test_num, const ulonglong2str_t *ulonglong2str)
static void one_i64tow_test(int test_num, const ulonglong2str_t *ulonglong2str)
static const char static unsigned short
static const ulong2str_t ulong2str[]
static void test_printf_format(void)
static void test__snwprintf(void)
static int __cdecl intcomparefunc(const void *a, const void *b)
static const ulonglong2str_t ulonglong2str[]
static void test__strnicmp(void)
static void test_wcsicmp(void)
static void test_sscanf(void)
static void test__snprintf(void)
static void test_ctype(void)
static int __cdecl charcomparefunc(const void *a, const void *b)
static const unsigned short wctypes[256]
static const void *static void *__cdecl * pbsearch(void *, void *, size_t, size_t, int(__cdecl *compar)(const void *, const void *))
static void one_ui64tow_test(int test_num, const ulonglong2str_t *ulonglong2str)
static void one_ultoa_test(int test_num, const ulong2str_t *ulong2str)
static void test_memchr(void)
static void test_bsearch(void)
static void test__snprintf_s(void)
static void one_itow_test(int test_num, const ulong2str_t *ulong2str)
static void one_ltoa_test(int test_num, const ulong2str_t *ulong2str)
static void test_wtol(void)
static void *__cdecl * pmemchr(const void *, int, size_t)
static const str2longlong_t str2longlong[]
static void test_wctype(void)
static void test_wcsrchr(void)
static void InitFunctionPtrs(void)
static void test_wcstol(void)
static void test_wcschr(void)
static const unsigned short ctypes[256]
static void one_ltow_test(int test_num, const ulong2str_t *ulong2str)
static void one_ultow_test(int test_num, const ulong2str_t *ulong2str)
static void test_wcslwrupr(void)
static void test_ulonglongtoa(void)
static int __cdecl strcomparefunc(const void *a, const void *b)
static void one_i64toa_test(int test_num, const ulonglong2str_t *ulonglong2str)
#define LARGE_STRI_BUFFER_LENGTH
static void test_qsort(void)
static void test_ulongtoa(void)
static void test_atoi64(void)
static void test_wtoi64(void)
static const UNICODE_STRING BOOLEAN
static void test__snwprintf_s(void)
static void test_wtoi(void)
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeStringFromAsciiz(_Out_ PUNICODE_STRING Destination, _In_ PCSZ Source)
WCHAR NTAPI RtlUpcaseUnicodeChar(_In_ WCHAR Source)
NTSYSAPI NTSTATUS NTAPI RtlUnicodeStringToAnsiString(PANSI_STRING DestinationString, PUNICODE_STRING SourceString, BOOLEAN AllocateDestinationString)
NTSYSAPI VOID NTAPI RtlFreeAnsiString(PANSI_STRING AnsiString)
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
#define _WIN32_WINNT_VISTA
NTSYSAPI WCHAR WINAPI RtlAnsiCharToUnicodeChar(LPSTR *)