68 ok(
hntdll != 0,
"LoadLibrary failed\n");
72 pRtlCreateUnicodeStringFromAsciiz = (
void *)
GetProcAddress(
hntdll,
"RtlCreateUnicodeStringFromAsciiz");
106#define LARGE_STRI_BUFFER_LENGTH 67
117 {10, 123,
"123\0---------------------------------------------------------------", 0x77},
119 { 2, 0x80000000U,
"10000000000000000000000000000000\0----------------------------------", 0x67},
120 { 2, -2147483647,
"10000000000000000000000000000001\0----------------------------------", 0x67},
121 { 2, -65537,
"11111111111111101111111111111111\0----------------------------------", 0x67},
122 { 2, -65536,
"11111111111111110000000000000000\0----------------------------------", 0x67},
123 { 2, -65535,
"11111111111111110000000000000001\0----------------------------------", 0x67},
124 { 2, -32768,
"11111111111111111000000000000000\0----------------------------------", 0x67},
125 { 2, -32767,
"11111111111111111000000000000001\0----------------------------------", 0x67},
126 { 2, -2,
"11111111111111111111111111111110\0----------------------------------", 0x67},
127 { 2, -1,
"11111111111111111111111111111111\0----------------------------------", 0x67},
128 { 2, 0,
"0\0-----------------------------------------------------------------", 0x77},
129 { 2, 1,
"1\0-----------------------------------------------------------------", 0x77},
130 { 2, 10,
"1010\0--------------------------------------------------------------", 0x77},
131 { 2, 100,
"1100100\0-----------------------------------------------------------", 0x77},
132 { 2, 1000,
"1111101000\0--------------------------------------------------------", 0x77},
133 { 2, 10000,
"10011100010000\0----------------------------------------------------", 0x77},
134 { 2, 32767,
"111111111111111\0---------------------------------------------------", 0x77},
135 { 2, 32768,
"1000000000000000\0--------------------------------------------------", 0x77},
136 { 2, 65535,
"1111111111111111\0--------------------------------------------------", 0x77},
137 { 2, 100000,
"11000011010100000\0-------------------------------------------------", 0x77},
138 { 2, 234567,
"111001010001000111\0------------------------------------------------", 0x77},
139 { 2, 300000,
"1001001001111100000\0-----------------------------------------------", 0x77},
140 { 2, 524287,
"1111111111111111111\0-----------------------------------------------", 0x77},
141 { 2, 524288,
"10000000000000000000\0----------------------------------------------", 0x67},
142 { 2, 1000000,
"11110100001001000000\0----------------------------------------------", 0x67},
143 { 2, 10000000,
"100110001001011010000000\0------------------------------------------", 0x67},
144 { 2, 100000000,
"101111101011110000100000000\0---------------------------------------", 0x67},
145 { 2, 1000000000,
"111011100110101100101000000000\0------------------------------------", 0x67},
146 { 2, 1073741823,
"111111111111111111111111111111\0------------------------------------", 0x67},
147 { 2, 2147483646,
"1111111111111111111111111111110\0-----------------------------------", 0x67},
148 { 2, 2147483647,
"1111111111111111111111111111111\0-----------------------------------", 0x67},
149 { 2, 2147483648U,
"10000000000000000000000000000000\0----------------------------------", 0x67},
150 { 2, 2147483649U,
"10000000000000000000000000000001\0----------------------------------", 0x67},
151 { 2, 4294967294U,
"11111111111111111111111111111110\0----------------------------------", 0x67},
152 { 2, 0xFFFFFFFF,
"11111111111111111111111111111111\0----------------------------------", 0x67},
154 { 8, 0x80000000U,
"20000000000\0-------------------------------------------------------", 0x77},
155 { 8, -2147483647,
"20000000001\0-------------------------------------------------------", 0x77},
156 { 8, -2,
"37777777776\0-------------------------------------------------------", 0x77},
157 { 8, -1,
"37777777777\0-------------------------------------------------------", 0x77},
158 { 8, 0,
"0\0-----------------------------------------------------------------", 0x77},
159 { 8, 1,
"1\0-----------------------------------------------------------------", 0x77},
160 { 8, 2147483646,
"17777777776\0-------------------------------------------------------", 0x77},
161 { 8, 2147483647,
"17777777777\0-------------------------------------------------------", 0x77},
162 { 8, 2147483648U,
"20000000000\0-------------------------------------------------------", 0x77},
163 { 8, 2147483649U,
"20000000001\0-------------------------------------------------------", 0x77},
164 { 8, 4294967294U,
"37777777776\0-------------------------------------------------------", 0x77},
165 { 8, 4294967295U,
"37777777777\0-------------------------------------------------------", 0x77},
167 {10, 0x80000000U,
"-2147483648\0-------------------------------------------------------", 0x33},
168 {10, 0x80000000U,
"2147483648\0--------------------------------------------------------", 0x44},
169 {10, -2147483647,
"-2147483647\0-------------------------------------------------------", 0x33},
170 {10, -2147483647,
"2147483649\0--------------------------------------------------------", 0x44},
171 {10, -2,
"-2\0----------------------------------------------------------------", 0x33},
172 {10, -2,
"4294967294\0--------------------------------------------------------", 0x44},
173 {10, -1,
"-1\0----------------------------------------------------------------", 0x33},
174 {10, -1,
"4294967295\0--------------------------------------------------------", 0x44},
175 {10, 0,
"0\0-----------------------------------------------------------------", 0x77},
176 {10, 1,
"1\0-----------------------------------------------------------------", 0x77},
177 {10, 12,
"12\0----------------------------------------------------------------", 0x77},
178 {10, 123,
"123\0---------------------------------------------------------------", 0x77},
179 {10, 1234,
"1234\0--------------------------------------------------------------", 0x77},
180 {10, 12345,
"12345\0-------------------------------------------------------------", 0x77},
181 {10, 123456,
"123456\0------------------------------------------------------------", 0x77},
182 {10, 1234567,
"1234567\0-----------------------------------------------------------", 0x77},
183 {10, 12345678,
"12345678\0----------------------------------------------------------", 0x77},
184 {10, 123456789,
"123456789\0---------------------------------------------------------", 0x77},
185 {10, 2147483646,
"2147483646\0--------------------------------------------------------", 0x77},
186 {10, 2147483647,
"2147483647\0--------------------------------------------------------", 0x77},
187 {10, 2147483648U,
"-2147483648\0-------------------------------------------------------", 0x33},
188 {10, 2147483648U,
"2147483648\0--------------------------------------------------------", 0x44},
189 {10, 2147483649U,
"-2147483647\0-------------------------------------------------------", 0x33},
190 {10, 2147483649U,
"2147483649\0--------------------------------------------------------", 0x44},
191 {10, 4294967294U,
"-2\0----------------------------------------------------------------", 0x33},
192 {10, 4294967294U,
"4294967294\0--------------------------------------------------------", 0x44},
193 {10, 4294967295U,
"-1\0----------------------------------------------------------------", 0x33},
194 {10, 4294967295U,
"4294967295\0--------------------------------------------------------", 0x44},
196 {16, 0,
"0\0-----------------------------------------------------------------", 0x77},
197 {16, 1,
"1\0-----------------------------------------------------------------", 0x77},
198 {16, 2147483646,
"7ffffffe\0----------------------------------------------------------", 0x77},
199 {16, 2147483647,
"7fffffff\0----------------------------------------------------------", 0x77},
200 {16, 0x80000000,
"80000000\0----------------------------------------------------------", 0x77},
201 {16, 0x80000001,
"80000001\0----------------------------------------------------------", 0x77},
202 {16, 0xFFFFFFFE,
"fffffffe\0----------------------------------------------------------", 0x77},
203 {16, 0xFFFFFFFF,
"ffffffff\0----------------------------------------------------------", 0x77},
205 { 2, 32768,
"1000000000000000\0--------------------------------------------------", 0x77},
206 { 2, 65536,
"10000000000000000\0-------------------------------------------------", 0x77},
207 { 2, 131072,
"100000000000000000\0------------------------------------------------", 0x77},
208 {16, 0xffffffff,
"ffffffff\0----------------------------------------------------------", 0x77},
209 {16, 0xa,
"a\0-----------------------------------------------------------------", 0x77},
210 {16, 0,
"0\0-----------------------------------------------------------------", 0x77},
211 {20, 3368421,
"111111\0------------------------------------------------------------", 0x77},
212 {36, 62193781,
"111111\0------------------------------------------------------------", 0x77},
213 {37, 71270178,
"111111\0------------------------------------------------------------", 0x77},
215#define NB_ULONG2STR (sizeof(ulong2str)/sizeof(*ulong2str))
229 "(test %d): _itoa(%d, [out], %d) has result %p, expected: %p\n",
232 "(test %d): _itoa(%d, [out], %d) assigns string \"%s\", expected: \"%s\"\n",
248 "(test %d): _ltoa(%d, [out], %d) has result %p, expected: %p\n",
251 "(test %d): _ltoa(%d, [out], %d) assigns string \"%s\", expected: \"%s\"\n",
267 "(test %d): _ultoa(%u, [out], %d) has result %p, expected: %p\n",
270 "(test %d): _ultoa(%u, [out], %d) assigns string \"%s\", expected: \"%s\"\n",
279 for (test_num = 0; test_num <
NB_ULONG2STR; test_num++) {
309 dest_wstr[
pos] =
'-';
314 unicode_string.
Buffer = dest_wstr;
317 pRtlUnicodeStringToAnsiString(&ansi_str, &unicode_string, 1);
319 "(test %d): _itow(%d, [out], %d) has result %p, expected: %p\n",
322 "(test %d): _itow(%d, [out], %d) assigns string \"%s\", expected: \"%s\"\n",
324 pRtlFreeAnsiString(&ansi_str);
344 dest_wstr[
pos] =
'-';
349 unicode_string.
Buffer = dest_wstr;
353 pRtlUnicodeStringToAnsiString(&ansi_str, &unicode_string, 1);
355 "(test %d): _ltow(%d, [out], %d) has result %p, expected: %p\n",
358 "(test %d): _ltow(%d, [out], %d) assigns string \"%s\", expected: \"%s\"\n",
360 pRtlFreeAnsiString(&ansi_str);
380 dest_wstr[
pos] =
'-';
385 unicode_string.
Buffer = dest_wstr;
389 pRtlUnicodeStringToAnsiString(&ansi_str, &unicode_string, 1);
391 "(test %d): _ultow(%u, [out], %d) has result %p, expected: %p\n",
394 "(test %d): _ultow(%u, [out], %d) assigns string \"%s\", expected: \"%s\"\n",
396 pRtlFreeAnsiString(&ansi_str);
405 for (test_num = 0; test_num <
NB_ULONG2STR; test_num++) {
421 "(test a): _itow(%d, NULL, 10) has result %p, expected: NULL\n",
429 "(test b): _ltow(%d, NULL, 10) has result %p, expected: NULL\n",
437 "(test c): _ultow(%d, NULL, 10) has result %p, expected: NULL\n",
442#define ULL(a,b) (((ULONGLONG)(a) << 32) | (b))
453 {10, 123,
"123\0---------------------------------------------------------------", 0x33},
455 { 2, 0x80000000U,
"10000000000000000000000000000000\0----------------------------------", 0x33},
456 { 2, -2147483647,
"1111111111111111111111111111111110000000000000000000000000000001\0--", 0x33},
457 { 2, -65537,
"1111111111111111111111111111111111111111111111101111111111111111\0--", 0x33},
458 { 2, -65536,
"1111111111111111111111111111111111111111111111110000000000000000\0--", 0x33},
459 { 2, -65535,
"1111111111111111111111111111111111111111111111110000000000000001\0--", 0x33},
460 { 2, -32768,
"1111111111111111111111111111111111111111111111111000000000000000\0--", 0x33},
461 { 2, -32767,
"1111111111111111111111111111111111111111111111111000000000000001\0--", 0x33},
462 { 2, -2,
"1111111111111111111111111111111111111111111111111111111111111110\0--", 0x33},
463 { 2, -1,
"1111111111111111111111111111111111111111111111111111111111111111\0--", 0x33},
464 { 2, 0,
"0\0-----------------------------------------------------------------", 0x33},
465 { 2, 1,
"1\0-----------------------------------------------------------------", 0x33},
466 { 2, 10,
"1010\0--------------------------------------------------------------", 0x33},
467 { 2, 100,
"1100100\0-----------------------------------------------------------", 0x33},
468 { 2, 1000,
"1111101000\0--------------------------------------------------------", 0x33},
469 { 2, 10000,
"10011100010000\0----------------------------------------------------", 0x33},
470 { 2, 32767,
"111111111111111\0---------------------------------------------------", 0x33},
471 { 2, 32768,
"1000000000000000\0--------------------------------------------------", 0x33},
472 { 2, 65535,
"1111111111111111\0--------------------------------------------------", 0x33},
473 { 2, 100000,
"11000011010100000\0-------------------------------------------------", 0x33},
474 { 2, 234567,
"111001010001000111\0------------------------------------------------", 0x33},
475 { 2, 300000,
"1001001001111100000\0-----------------------------------------------", 0x33},
476 { 2, 524287,
"1111111111111111111\0-----------------------------------------------", 0x33},
477 { 2, 524288,
"10000000000000000000\0----------------------------------------------", 0x33},
478 { 2, 1000000,
"11110100001001000000\0----------------------------------------------", 0x33},
479 { 2, 10000000,
"100110001001011010000000\0------------------------------------------", 0x33},
480 { 2, 100000000,
"101111101011110000100000000\0---------------------------------------", 0x33},
481 { 2, 1000000000,
"111011100110101100101000000000\0------------------------------------", 0x33},
482 { 2, 1073741823,
"111111111111111111111111111111\0------------------------------------", 0x33},
483 { 2, 2147483646,
"1111111111111111111111111111110\0-----------------------------------", 0x33},
484 { 2, 2147483647,
"1111111111111111111111111111111\0-----------------------------------", 0x33},
485 { 2, 2147483648U,
"10000000000000000000000000000000\0----------------------------------", 0x33},
486 { 2, 2147483649U,
"10000000000000000000000000000001\0----------------------------------", 0x33},
487 { 2, 4294967294U,
"11111111111111111111111111111110\0----------------------------------", 0x33},
488 { 2, 0xFFFFFFFF,
"11111111111111111111111111111111\0----------------------------------", 0x33},
489 { 2,
ULL(0x1,0xffffffff),
"111111111111111111111111111111111\0---------------------------------", 0x33},
490 { 2, ((
ULONGLONG)100000)*100000,
"1001010100000010111110010000000000\0--------------------------------", 0x33},
491 { 2,
ULL(0x3,0xffffffff),
"1111111111111111111111111111111111\0--------------------------------", 0x33},
492 { 2,
ULL(0x7,0xffffffff),
"11111111111111111111111111111111111\0-------------------------------", 0x33},
493 { 2,
ULL(0xf,0xffffffff),
"111111111111111111111111111111111111\0------------------------------", 0x33},
494 { 2, ((
ULONGLONG)100000)*1000000,
"1011101001000011101101110100000000000\0-----------------------------", 0x33},
495 { 2,
ULL(0x1f,0xffffffff),
"1111111111111111111111111111111111111\0-----------------------------", 0x33},
496 { 2,
ULL(0x3f,0xffffffff),
"11111111111111111111111111111111111111\0----------------------------", 0x33},
497 { 2,
ULL(0x7f,0xffffffff),
"111111111111111111111111111111111111111\0---------------------------", 0x33},
498 { 2,
ULL(0xff,0xffffffff),
"1111111111111111111111111111111111111111\0--------------------------", 0x33},
500 { 8, 0x80000000U,
"20000000000\0-------------------------------------------------------", 0x33},
501 { 8, -2147483647,
"1777777777760000000001\0--------------------------------------------", 0x33},
502 { 8, -2,
"1777777777777777777776\0--------------------------------------------", 0x33},
503 { 8, -1,
"1777777777777777777777\0--------------------------------------------", 0x33},
504 { 8, 0,
"0\0-----------------------------------------------------------------", 0x33},
505 { 8, 1,
"1\0-----------------------------------------------------------------", 0x33},
506 { 8, 2147483646,
"17777777776\0-------------------------------------------------------", 0x33},
507 { 8, 2147483647,
"17777777777\0-------------------------------------------------------", 0x33},
508 { 8, 2147483648U,
"20000000000\0-------------------------------------------------------", 0x33},
509 { 8, 2147483649U,
"20000000001\0-------------------------------------------------------", 0x33},
510 { 8, 4294967294U,
"37777777776\0-------------------------------------------------------", 0x33},
511 { 8, 4294967295U,
"37777777777\0-------------------------------------------------------", 0x33},
513 {10, 0x80000000U,
"2147483648\0--------------------------------------------------------", 0x33},
514 {10, -2147483647,
"-2147483647\0-------------------------------------------------------", 0x55},
515 {10, -2147483647,
"-18446744071562067969\0---------------------------------------------", 0x00},
516 {10, -2147483647,
"18446744071562067969\0----------------------------------------------", 0x22},
517 {10, -2,
"-2\0----------------------------------------------------------------", 0x55},
518 {10, -2,
"-18446744073709551614\0---------------------------------------------", 0x00},
519 {10, -2,
"18446744073709551614\0----------------------------------------------", 0x22},
520 {10, -1,
"-1\0----------------------------------------------------------------", 0x55},
521 {10, -1,
"-18446744073709551615\0---------------------------------------------", 0x00},
522 {10, -1,
"18446744073709551615\0----------------------------------------------", 0x22},
523 {10, 0,
"0\0-----------------------------------------------------------------", 0x33},
524 {10, 1,
"1\0-----------------------------------------------------------------", 0x33},
525 {10, 12,
"12\0----------------------------------------------------------------", 0x33},
526 {10, 123,
"123\0---------------------------------------------------------------", 0x33},
527 {10, 1234,
"1234\0--------------------------------------------------------------", 0x33},
528 {10, 12345,
"12345\0-------------------------------------------------------------", 0x33},
529 {10, 123456,
"123456\0------------------------------------------------------------", 0x33},
530 {10, 1234567,
"1234567\0-----------------------------------------------------------", 0x33},
531 {10, 12345678,
"12345678\0----------------------------------------------------------", 0x33},
532 {10, 123456789,
"123456789\0---------------------------------------------------------", 0x33},
533 {10, 2147483646,
"2147483646\0--------------------------------------------------------", 0x33},
534 {10, 2147483647,
"2147483647\0--------------------------------------------------------", 0x33},
535 {10, 2147483648U,
"2147483648\0--------------------------------------------------------", 0x33},
536 {10, 2147483649U,
"2147483649\0--------------------------------------------------------", 0x33},
537 {10, 4294967294U,
"4294967294\0--------------------------------------------------------", 0x33},
538 {10, 4294967295U,
"4294967295\0--------------------------------------------------------", 0x33},
539 {10,
ULL(0x2,0xdfdc1c35),
"12345678901\0-------------------------------------------------------", 0x33},
540 {10,
ULL(0xe5,0xf4c8f374),
"987654321012\0------------------------------------------------------", 0x33},
541 {10,
ULL(0x1c0,0xfc161e3e),
"1928374656574\0-----------------------------------------------------", 0x33},
542 {10,
ULL(0xbad,0xcafeface),
"12841062955726\0----------------------------------------------------", 0x33},
543 {10,
ULL(0x5bad,0xcafeface),
"100801993177806\0---------------------------------------------------", 0x33},
544 {10,
ULL(0xaface,0xbeefcafe),
"3090515640699646\0--------------------------------------------------", 0x33},
545 {10,
ULL(0xa5beef,0xabcdcafe),
"46653307746110206\0-------------------------------------------------", 0x33},
546 {10,
ULL(0x1f8cf9b,0xf2df3af1),
"142091656963767025\0------------------------------------------------", 0x33},
547 {10,
ULL(0x0fffffff,0xffffffff),
"1152921504606846975\0-----------------------------------------------", 0x33},
548 {10,
ULL(0x7fffffff,0xffffffff),
"9223372036854775807\0-----------------------------------------------", 0x33},
549 {10,
ULL(0x80000000,0x00000000),
"-9223372036854775808\0----------------------------------------------", 0x11},
550 {10,
ULL(0x80000000,0x00000000),
"9223372036854775808\0-----------------------------------------------", 0x22},
551 {10,
ULL(0x80000000,0x00000001),
"-9223372036854775807\0----------------------------------------------", 0x55},
552 {10,
ULL(0x80000000,0x00000001),
"-9223372036854775809\0----------------------------------------------", 0x00},
553 {10,
ULL(0x80000000,0x00000001),
"9223372036854775809\0-----------------------------------------------", 0x22},
554 {10,
ULL(0x80000000,0x00000002),
"-9223372036854775806\0----------------------------------------------", 0x55},
555 {10,
ULL(0x80000000,0x00000002),
"-9223372036854775810\0----------------------------------------------", 0x00},
556 {10,
ULL(0x80000000,0x00000002),
"9223372036854775810\0-----------------------------------------------", 0x22},
557 {10,
ULL(0xffffffff,0xfffffffe),
"-2\0----------------------------------------------------------------", 0x55},
558 {10,
ULL(0xffffffff,0xfffffffe),
"-18446744073709551614\0---------------------------------------------", 0x00},
559 {10,
ULL(0xffffffff,0xfffffffe),
"18446744073709551614\0----------------------------------------------", 0x22},
560 {10,
ULL(0xffffffff,0xffffffff),
"-1\0----------------------------------------------------------------", 0x55},
561 {10,
ULL(0xffffffff,0xffffffff),
"-18446744073709551615\0---------------------------------------------", 0x00},
562 {10,
ULL(0xffffffff,0xffffffff),
"18446744073709551615\0----------------------------------------------", 0x22},
564 {16, 0,
"0\0-----------------------------------------------------------------", 0x33},
565 {16, 1,
"1\0-----------------------------------------------------------------", 0x33},
566 {16, 2147483646,
"7ffffffe\0----------------------------------------------------------", 0x33},
567 {16, 2147483647,
"7fffffff\0----------------------------------------------------------", 0x33},
568 {16, 0x80000000,
"80000000\0----------------------------------------------------------", 0x33},
569 {16, 0x80000001,
"80000001\0----------------------------------------------------------", 0x33},
570 {16, 0xFFFFFFFE,
"fffffffe\0----------------------------------------------------------", 0x33},
571 {16, 0xFFFFFFFF,
"ffffffff\0----------------------------------------------------------", 0x33},
572 {16,
ULL(0x1,0x00000000),
"100000000\0---------------------------------------------------------", 0x33},
573 {16,
ULL(0xbad,0xdeadbeef),
"baddeadbeef\0-------------------------------------------------------", 0x33},
574 {16,
ULL(0x80000000,0x00000000),
"8000000000000000\0--------------------------------------------------", 0x33},
575 {16,
ULL(0xfedcba98,0x76543210),
"fedcba9876543210\0--------------------------------------------------", 0x33},
576 {16,
ULL(0xffffffff,0x80000001),
"ffffffff80000001\0--------------------------------------------------", 0x33},
577 {16,
ULL(0xffffffff,0xfffffffe),
"fffffffffffffffe\0--------------------------------------------------", 0x33},
578 {16,
ULL(0xffffffff,0xffffffff),
"ffffffffffffffff\0--------------------------------------------------", 0x33},
580 { 2, 32768,
"1000000000000000\0--------------------------------------------------", 0x33},
581 { 2, 65536,
"10000000000000000\0-------------------------------------------------", 0x33},
582 { 2, 131072,
"100000000000000000\0------------------------------------------------", 0x33},
583 {16, 0xffffffff,
"ffffffff\0----------------------------------------------------------", 0x33},
584 {16, 0xa,
"a\0-----------------------------------------------------------------", 0x33},
585 {16, 0,
"0\0-----------------------------------------------------------------", 0x33},
586 {20, 3368421,
"111111\0------------------------------------------------------------", 0x33},
587 {36, 62193781,
"111111\0------------------------------------------------------------", 0x33},
588 {37, 71270178,
"111111\0------------------------------------------------------------", 0x33},
589 {99,
ULL(0x2,0x3c9e468c),
"111111\0------------------------------------------------------------", 0x33},
591#define NB_ULONGLONG2STR (sizeof(ulonglong2str)/sizeof(*ulonglong2str))
603 "(test %d): _i64toa(%s, [out], %d) has result %p, expected: %p\n",
609 "(test %d): _i64toa(%s, [out], %d) assigns string \"%s\", expected: \"%s\"\n",
616 "(test %d): _i64toa(%s, [out], %d) assigns string \"%s\", expected: \"%s\"\n",
632 "(test %d): _ui64toa(%s, [out], %d) has result %p, expected: %p\n",
635 "(test %d): _ui64toa(%s, [out], %d) assigns string \"%s\", expected: \"%s\"\n",
649 if (p_ui64toa !=
NULL) {
673 dest_wstr[
pos] =
'-';
678 unicode_string.
Buffer = dest_wstr;
681 pRtlUnicodeStringToAnsiString(&ansi_str, &unicode_string, 1);
683 "(test %d): _i64tow(0x%s, [out], %d) has result %p, expected: %p\n",
693 "(test %d): _i64tow(0x%s, [out], %d) assigns string \"%s\", expected: \"%s\"\n",
700 "(test %d): _i64tow(0x%s, [out], %d) assigns string \"%s\", expected: \"%s\"\n",
704 pRtlFreeAnsiString(&ansi_str);
723 dest_wstr[
pos] =
'-';
728 unicode_string.
Buffer = dest_wstr;
731 pRtlUnicodeStringToAnsiString(&ansi_str, &unicode_string, 1);
733 "(test %d): _ui64tow(0x%s, [out], %d) has result %p, expected: %p\n",
737 "(test %d): _ui64tow(0x%s, [out], %d) assigns string \"%s\", expected: \"%s\"\n",
740 pRtlFreeAnsiString(&ansi_str);
764 "(test d): _i64tow(0x%s, NULL, 10) has result %p, expected: NULL\n",
773 "(test e): _ui64tow(0x%s, NULL, 10) has result %p, expected: NULL\n",
786 {
"1011101100", 1011101100 },
787 {
"1234567", 1234567 },
826 {
" \n \r \t214", 214 },
827 {
" \n \r \t+214", 214 },
828 {
" \n \r \t-214", -214 },
837 {
"-9999999999", -1410065407 },
838 {
"-2147483649", 2147483647 },
839 {
"-2147483648", 0x80000000 },
840 {
"-2147483647", -2147483647 },
844 {
"2147483646", 2147483646 },
845 {
"2147483647", 2147483647 },
846 {
"2147483648", 2147483648UL },
847 {
"2147483649", 2147483649UL },
848 {
"4294967294", 4294967294UL },
849 {
"4294967295", 4294967295UL },
851 {
"9999999999", 1410065407 },
853 {
"b1011101100", 0 },
854 {
"-b1011101100", 0 },
855 {
"b10123456789", 0 },
856 {
"0b1011101100", 0 },
857 {
"-0b1011101100", 0 },
858 {
"0b10123456789", 0 },
859 {
"-0b10123456789", 0 },
873 {
"0d1011101100", 0 },
879 {
"-0xFEDCBA00", 0 },
888#define NB_STR2LONG (sizeof(str2long)/sizeof(*str2long))
897 for (test_num = 0; test_num <
NB_STR2LONG; test_num++) {
898 pRtlCreateUnicodeStringFromAsciiz(&uni,
str2long[test_num].
str);
901 "(test %d): call failed: _wtoi(\"%s\") has result %d, expected: %d\n",
903 pRtlFreeUnicodeString(&uni);
912 for (test_num = 0; test_num <
NB_STR2LONG; test_num++) {
915 "(test %d): call failed: _atoi(\"%s\") has result %d, expected: %d\n",
925 for (test_num = 0; test_num <
NB_STR2LONG; test_num++) {
928 "(test %d): call failed: _atol(\"%s\") has result %d, expected: %d\n",
939 for (test_num = 0; test_num <
NB_STR2LONG; test_num++) {
940 pRtlCreateUnicodeStringFromAsciiz(&uni,
str2long[test_num].
str);
943 "(test %d): call failed: _wtol(\"%s\") has result %d, expected: %d\n",
945 pRtlFreeUnicodeString(&uni);
957 {
"1011101100", 1011101100 },
958 {
"1234567", 1234567 },
997 {
" \n \r \t214", 214 },
998 {
" \n \r \t+214", 214 },
999 {
" \n \r \t-214", -214 },
1008 {
"-99999999999999999999", -
ULL(0x6bc75e2d,0x630fffff), -1 },
1009 {
"-9223372036854775809",
ULL(0x7fffffff,0xffffffff), -1 },
1010 {
"-9223372036854775808",
ULL(0x80000000,0x00000000) },
1011 {
"-9223372036854775807", -
ULL(0x7fffffff,0xffffffff) },
1012 {
"-9999999999", -
ULL(0x00000002,0x540be3ff) },
1013 {
"-2147483649", -
ULL(0x00000000,0x80000001) },
1014 {
"-2147483648", -
ULL(0x00000000,0x80000000) },
1015 {
"-2147483647", -2147483647 },
1019 {
"2147483646", 2147483646 },
1020 {
"2147483647", 2147483647 },
1021 {
"2147483648",
ULL(0x00000000,0x80000000) },
1022 {
"2147483649",
ULL(0x00000000,0x80000001) },
1023 {
"4294967294",
ULL(0x00000000,0xfffffffe) },
1024 {
"4294967295",
ULL(0x00000000,0xffffffff) },
1025 {
"4294967296",
ULL(0x00000001,0x00000000) },
1026 {
"9999999999",
ULL(0x00000002,0x540be3ff) },
1027 {
"9223372036854775806",
ULL(0x7fffffff,0xfffffffe) },
1028 {
"9223372036854775807",
ULL(0x7fffffff,0xffffffff) },
1029 {
"9223372036854775808",
ULL(0x80000000,0x00000000), 1 },
1030 {
"9223372036854775809",
ULL(0x80000000,0x00000001), 1 },
1031 {
"18446744073709551614",
ULL(0xffffffff,0xfffffffe), 1 },
1032 {
"18446744073709551615",
ULL(0xffffffff,0xffffffff), 1 },
1033 {
"18446744073709551616", 0, 1 },
1034 {
"99999999999999999999",
ULL(0x6bc75e2d,0x630fffff), 1 },
1035 {
"056789", 56789 },
1036 {
"b1011101100", 0 },
1037 {
"-b1011101100", 0 },
1038 {
"b10123456789", 0 },
1039 {
"0b1011101100", 0 },
1040 {
"-0b1011101100", 0 },
1041 {
"0b10123456789", 0 },
1042 {
"-0b10123456789", 0 },
1050 {
"-0o1234567", 0 },
1056 {
"0d1011101100", 0 },
1059 {
"-xFEDCBA00", 0 },
1060 {
"0x89abcdef", 0 },
1061 {
"0xFEDCBA00", 0 },
1062 {
"-0xFEDCBA00", 0 },
1063 {
"0xabcdefgh", 0 },
1064 {
"0xABCDEFGH", 0 },
1071#define NB_STR2LONGLONG (sizeof(str2longlong)/sizeof(*str2longlong))
1084 ULL(0x80000000,0x00000000) :
ULL(0x7fffffff,0xffffffff))),
1085 "(test %d): call failed: _atoi64(\"%s\") has result 0x%s, expected: 0x%s\n",
1090 "(test %d): call failed: _atoi64(\"%s\") has result 0x%s, expected: 0x%s\n",
1109 ULL(0x80000000,0x00000000) :
ULL(0x7fffffff,0xffffffff))),
1110 "(test %d): call failed: _atoi64(\"%s\") has result 0x%s, expected: 0x%s\n",
1115 "(test %d): call failed: _atoi64(\"%s\") has result 0x%s, expected: 0x%s\n",
1118 pRtlFreeUnicodeString(&uni);
1124 static const WCHAR teststringW[] = {
'a',
'b',
'r',
'a',
'c',
'a',
'd',
'a',
'b',
'r',
'a',0};
1126 ok(p_wcschr(teststringW,
'a') == teststringW + 0,
1127 "wcschr should have returned a pointer to the first 'a' character\n");
1128 ok(p_wcschr(teststringW, 0) == teststringW + 11,
1129 "wcschr should have returned a pointer to the null terminator\n");
1130 ok(p_wcschr(teststringW,
'x') ==
NULL,
1131 "wcschr should have returned NULL\n");
1136 static const WCHAR teststringW[] = {
'a',
'b',
'r',
'a',
'c',
'a',
'd',
'a',
'b',
'r',
'a',0};
1138 ok(p_wcsrchr(teststringW,
'a') == teststringW + 10,
1139 "wcsrchr should have returned a pointer to the last 'a' character\n");
1140 ok(p_wcsrchr(teststringW, 0) == teststringW + 11,
1141 "wcsrchr should have returned a pointer to the null terminator\n");
1142 ok(p_wcsrchr(teststringW,
'x') ==
NULL,
1143 "wcsrchr should have returned NULL\n");
1148 static WCHAR teststringW[] = {
'a',
'b',
'r',
'a',
'c',
'a',
'd',
'a',
'b',
'r',
'a',0};
1150 static const WCHAR constemptyW[] = {0};
1154 static const WCHAR conststringW[] = {
'a',
'b',
'r',
'a',
'c',
'a',
'd',
'a',
'b',
'r',
'a',0};
1155 ok(p_wcslwr((
LPWSTR)conststringW) == conststringW,
"p_wcslwr returned different string\n");
1156 ok(p_wcsupr((
LPWSTR)conststringW) == conststringW,
"p_wcsupr returned different string\n");
1157 ok(p_wcslwr(
NULL) ==
NULL,
"p_wcslwr didn't returned NULL\n");
1158 ok(p_wcsupr(
NULL) ==
NULL,
"p_wcsupr didn't returned NULL\n");
1160 ok(p_wcslwr(teststringW) == teststringW,
"p_wcslwr returned different string\n");
1161 ok(p_wcsupr(teststringW) == teststringW,
"p_wcsupr returned different string\n");
1162 ok(p_wcslwr(
emptyW) ==
emptyW,
"p_wcslwr returned different string\n");
1163 ok(p_wcsupr(
emptyW) ==
emptyW,
"p_wcsupr returned different string\n");
1164 ok(p_wcslwr((
LPWSTR)constemptyW) == constemptyW,
"p_wcslwr returned different string\n");
1165 ok(p_wcsupr((
LPWSTR)constemptyW) == constemptyW,
"p_wcsupr returned different string\n");
1170 const int *
p =
a, *
q =
b;
1172 ok (
a !=
b,
"must never get the same pointer\n");
1179 const char *
p =
a, *
q =
b;
1181 ok (
a !=
b,
"must never get the same pointer\n");
1188 const char *
const *
p =
a;
1189 const char *
const *
q =
b;
1191 ok (
a !=
b,
"must never get the same pointer\n");
1198 int arr[5] = { 23, 42, 8, 4, 16 };
1199 char carr[5] = { 42, 23, 4, 8, 16 };
1200 const char *strarr[7] = {
1211 ok(arr[0] == 23,
"badly sorted, nmemb=0, arr[0] is %d\n", arr[0]);
1212 ok(arr[1] == 42,
"badly sorted, nmemb=0, arr[1] is %d\n", arr[1]);
1213 ok(arr[2] == 8,
"badly sorted, nmemb=0, arr[2] is %d\n", arr[2]);
1214 ok(arr[3] == 4,
"badly sorted, nmemb=0, arr[3] is %d\n", arr[3]);
1215 ok(arr[4] == 16,
"badly sorted, nmemb=0, arr[4] is %d\n", arr[4]);
1218 ok(arr[0] == 23,
"badly sorted, nmemb=1, arr[0] is %d\n", arr[0]);
1219 ok(arr[1] == 42,
"badly sorted, nmemb=1, arr[1] is %d\n", arr[1]);
1220 ok(arr[2] == 8,
"badly sorted, nmemb=1, arr[2] is %d\n", arr[2]);
1221 ok(arr[3] == 4,
"badly sorted, nmemb=1, arr[3] is %d\n", arr[3]);
1222 ok(arr[4] == 16,
"badly sorted, nmemb=1, arr[4] is %d\n", arr[4]);
1225 ok(arr[0] == 23,
"badly sorted, size=0, arr[0] is %d\n", arr[0]);
1226 ok(arr[1] == 42,
"badly sorted, size=0, arr[1] is %d\n", arr[1]);
1227 ok(arr[2] == 8,
"badly sorted, size=0, arr[2] is %d\n", arr[2]);
1228 ok(arr[3] == 4,
"badly sorted, size=0, arr[3] is %d\n", arr[3]);
1229 ok(arr[4] == 16,
"badly sorted, size=0, arr[4] is %d\n", arr[4]);
1232 ok(arr[0] == 4,
"badly sorted, arr[0] is %d\n", arr[0]);
1233 ok(arr[1] == 8,
"badly sorted, arr[1] is %d\n", arr[1]);
1234 ok(arr[2] == 16,
"badly sorted, arr[2] is %d\n", arr[2]);
1235 ok(arr[3] == 23,
"badly sorted, arr[3] is %d\n", arr[3]);
1236 ok(arr[4] == 42,
"badly sorted, arr[4] is %d\n", arr[4]);
1239 ok(carr[0] == 4,
"badly sorted, carr[0] is %d\n", carr[0]);
1240 ok(carr[1] == 8,
"badly sorted, carr[1] is %d\n", carr[1]);
1241 ok(carr[2] == 16,
"badly sorted, carr[2] is %d\n", carr[2]);
1242 ok(carr[3] == 23,
"badly sorted, carr[3] is %d\n", carr[3]);
1243 ok(carr[4] == 42,
"badly sorted, carr[4] is %d\n", carr[4]);
1246 ok(!
strcmp(strarr[0],
"!"),
"badly sorted, strarr[0] is %s\n", strarr[0]);
1247 ok(!
strcmp(strarr[1],
"."),
"badly sorted, strarr[1] is %s\n", strarr[1]);
1248 ok(!
strcmp(strarr[2],
"Hello"),
"badly sorted, strarr[2] is %s\n", strarr[2]);
1249 ok(!
strcmp(strarr[3],
"Hopefully"),
"badly sorted, strarr[3] is %s\n", strarr[3]);
1250 ok(!
strcmp(strarr[4],
"Sorted"),
"badly sorted, strarr[4] is %s\n", strarr[4]);
1251 ok(!
strcmp(strarr[5],
"Wine"),
"badly sorted, strarr[5] is %s\n", strarr[5]);
1252 ok(!
strcmp(strarr[6],
"World"),
"badly sorted, strarr[6] is %s\n", strarr[6]);
1257 int arr[7] = { 1, 3, 4, 8, 16, 23, 42 };
1261 for (
j=1;
j<
sizeof(arr)/
sizeof(arr[0]);
j++) {
1265 ok (
x == &arr[
i],
"bsearch did not find %d entry in loopsize %d.\n",
i,
j);
1269 ok (
x ==
NULL,
"bsearch did find 4242 entry in loopsize %d.\n",
j);
1275 const char *origstring =
"XXXXXXXXXXXX";
1276 const char *teststring =
"hello world";
1280 res = p__snprintf(
NULL, 0, teststring);
1282 "_snprintf returned %d, expected %d.\n",
res,
lstrlenA(teststring));
1286 res = p__snprintf(
NULL, 1, teststring);
1288 "_snprintf returned %d, expected %d or < 0.\n",
res,
lstrlenA(teststring));
1291 ok(
res < 0,
"_snprintf returned %d, expected < 0.\n",
res);
1296 ok(!
strcmp(
buffer,
"hello worldX"),
"_snprintf returned buffer '%s', expected 'hello worldX'.\n",
buffer);
1301 ok(!
strcmp(
buffer, teststring),
"_snprintf returned buffer '%s', expected '%s'.\n",
buffer, teststring);
1328 if (p_wcslwr && p_wcsupr)
int strcmp(const char *String1, const char *String2)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
ACPI_SIZE strlen(const char *String)
char * strcpy(char *DstString, const char *SrcString)
#define GetProcAddress(x, y)
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
int WINAPI lstrcmpA(LPCSTR str1, LPCSTR str2)
UNICODE_STRING * PUNICODE_STRING
GLint GLint GLint GLint GLint x
GLdouble GLdouble GLdouble GLdouble q
GLboolean GLboolean GLboolean b
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[]
int WINAPI lstrlenA(LPCSTR lpString)
static void test_atoi(void)
static void test_atol(void)
static const str2long_t str2long[]
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 ulong2str_t ulong2str[]
static int __cdecl intcomparefunc(const void *a, const void *b)
static const ulonglong2str_t ulonglong2str[]
static const void *static void *__cdecl * p_bsearch(void *, void *, size_t, size_t, int(__cdecl *compar)(const void *, const void *))
static void test__snprintf(void)
static int __cdecl charcomparefunc(const void *a, const void *b)
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_bsearch(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 const str2longlong_t str2longlong[]
static void test_wcsrchr(void)
static void test_wcschr(void)
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)
static const char static void InitFunctionPtrs(void)
#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_wtoi(void)