40 static char buf[2][1024];
52#define expect_eq(expr, value, type, format) { type ret = (expr); ok((value) == ret, #expr " expected " format " got " format "\n", value, ret); }
53#define expect_bin(buf, value, len) { ok(memcmp((buf), value, len) == 0, "Binary buffer mismatch - expected %s, got %s\n", buf_to_string((unsigned char *)value, len, 1), buf_to_string((buf), len, 0)); }
65static int (
__cdecl *p__mbscpy_s)(
unsigned char*,
size_t,
const unsigned char*);
108static int (
__cdecl *p__mbccpy_s)(
unsigned char*,
size_t,
int*,
const unsigned char*);
113#define SETNOFAIL(x,y) x = (void*)GetProcAddress(hMsvcrt,y)
114#define SET(x,y) SETNOFAIL(x,y); ok(x != NULL, "Export '%s' not found\n", y)
119 char original[] =
"BADCFEHGJILKNMPORQTSVUXWZY@#";
120 char expected1[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZ@#";
121 char expected2[] =
"ABCDEFGHIJKLMNOPQRSTUVWX$";
130 memset(to,
'$',
sizeof(to));
135 ok(
memcmp(to,
expected1,testsize) == 0,
"Testing even size %d returned '%*.*s'\n", testsize, testsize, testsize, to);
138 memset(to,
'$',
sizeof(to));
143 ok(
memcmp(to,
expected2,testsize) == 0,
"Testing odd size %d returned '%*.*s'\n", testsize, testsize, testsize, to);
146 memset(to,
'$',
sizeof(to));
149 memcpy(to, original, testsize);
150 _swab( to, to, testsize );
151 ok(
memcmp(to,
expected1,testsize) == 0,
"Testing overlapped size %d returned '%*.*s'\n", testsize, testsize, testsize, to);
154 memset(to,
'$',
sizeof(to));
159 ok(
memcmp(to,
expected3,testsize) == 0,
"Testing small size %d returned '%*.*s'\n", testsize, testsize, testsize, to);
173 printf(
"static int result_cp_%d_mbctype[] = { ",
cp);
174 for (
i = 1;
i < 257;
i++)
191static int result_cp_932_mbctype[] = { 0x0,65, 0x8,1, 0x18,26, 0x8,6, 0x28,26, 0x8,4,
192 0x0,1, 0x8,1, 0xc,31, 0x8,1, 0xa,5, 0x9,58, 0xc,29, 0,3 };
193static int result_cp_936_mbctype[] = { 0x0,65, 0x8,1, 0x18,26, 0x8,6, 0x28,26, 0x8,6,
195static int result_cp_949_mbctype[] = { 0x0,66, 0x18,26, 0x8,6, 0x28,26, 0x8,6, 0xc,126,
197static int result_cp_950_mbctype[] = { 0x0,65, 0x8,1, 0x18,26, 0x8,6, 0x28,26, 0x8,4,
198 0x0,2, 0x4,32, 0xc,94, 0,1 };
206 for (
i = 0;
i < 256;
i++)
219#define test_codepage(num) test_cp_table(num, result_cp_##num##_mbctype);
227 unsigned char *mbstring = (
unsigned char *)
"\xb0\xb1\xb2 \xb3\xb4 \xb5";
228 unsigned char *mbstring2 = (
unsigned char *)
"\xb0\xb1\xb2\xb3Q\xb4\xb5";
229 unsigned char *mbsonlylead = (
unsigned char *)
"\xb0\0\xb1\xb2 \xb3";
230 unsigned char buf[16];
262 ok(
_ismbblead(0x1234b0),
"0x1234b0 should not be a lead byte\n");
335 expect_eq(p__mbsnlen(mbstring, 8), 8,
int,
"%d");
336 expect_eq(p__mbsnlen(mbstring, 9), 4,
int,
"%d");
337 expect_eq(p__mbsnlen(mbstring, 10), 4,
int,
"%d");
338 expect_eq(p__mbsnlen(mbsonlylead, 0), 0,
int,
"%d");
339 expect_eq(p__mbsnlen(mbsonlylead, 1), 1,
int,
"%d");
340 expect_eq(p__mbsnlen(mbsonlylead, 2), 0,
int,
"%d");
341 expect_eq(p__mbsnlen(mbstring2, 7), 7,
int,
"%d");
342 expect_eq(p__mbsnlen(mbstring2, 8), 4,
int,
"%d");
343 expect_eq(p__mbsnlen(mbstring2, 9), 4,
int,
"%d");
351 expect_eq(p_mbrlen((
const char*)mbstring, 2,
NULL), 2,
int,
"%d");
352 expect_eq(p_mbrlen((
const char*)&mbstring[2], 2,
NULL), 2,
int,
"%d");
353 expect_eq(p_mbrlen((
const char*)&mbstring[3], 2,
NULL), 1,
int,
"%d");
354 expect_eq(p_mbrlen((
const char*)mbstring, 1,
NULL), -2,
int,
"%d");
355 expect_eq(p_mbrlen((
const char*)mbstring, 1, &
state), -2,
int,
"%d");
356 ok(
state == mbstring[0],
"incorrect state value (%x)\n",
state);
357 expect_eq(p_mbrlen((
const char*)&mbstring[1], 1, &
state), 2,
int,
"%d");
367 ok(
dst == 0x6c28,
"dst = %x, expected 0x6c28\n",
dst);
369 ok(
dst == 0x3f,
"dst = %x, expected 0x3f\n",
dst);
371 ok(
dst == 0x20,
"dst = %x, expected 0x20\n",
dst);
373 ok(
dst == 0,
"dst = %x, expected 0\n",
dst);
375 ok(
dst == 0,
"dst = %x, expected 0\n",
dst);
376 ok(
state == mbstring[0],
"incorrect state value (%x)\n",
state);
378 ok(
dst == 0x6c28,
"dst = %x, expected 0x6c28\n",
dst);
395 err = p__mbccpy_s(
buf, 0, &copied, mbstring);
397 ok(!copied,
"copied = %d\n", copied);
398 ok(
buf[0] == 0xff,
"buf[0] = %x\n",
buf[0]);
402 err = p__mbccpy_s(
buf, 1, &copied, mbstring);
404 ok(!copied,
"copied = %d\n", copied);
405 ok(!
buf[0],
"buf[0] = %x\n",
buf[0]);
409 err = p__mbccpy_s(
buf, 2, &copied, mbstring);
410 ok(!
err,
"_mbccpy_s returned %d\n",
err);
411 ok(copied == 2,
"copied = %d\n", copied);
416 err = p__mbccpy_s(
buf, 2, &copied, (
unsigned char *)
"\xb0");
418 ok(copied == 1,
"copied = %d\n", copied);
453 step =
_mbsinc(mbstring) - mbstring;
454 ok(step == 2,
"_mbsinc adds %d (exp. 2)\n", step);
455 step =
_mbsinc(&mbstring[2]) - &mbstring[2];
456 ok(step == 2,
"_mbsinc adds %d (exp. 2)\n", step);
458 step =
_mbsninc(mbsonlylead, 1) - mbsonlylead;
459 ok(step == 0,
"_mbsninc adds %d (exp. 0)\n", step);
460 step =
_mbsninc(mbsonlylead, 2) - mbsonlylead;
461 ok(step == 0,
"_mbsninc adds %d (exp. 0)\n", step);
462 step =
_mbsninc(mbstring2, 0) - mbstring2;
463 ok(step == 0,
"_mbsninc adds %d (exp. 2)\n", step);
464 step =
_mbsninc(mbstring2, 1) - mbstring2;
465 ok(step == 2,
"_mbsninc adds %d (exp. 2)\n", step);
466 step =
_mbsninc(mbstring2, 2) - mbstring2;
467 ok(step == 4,
"_mbsninc adds %d (exp. 4)\n", step);
468 step =
_mbsninc(mbstring2, 3) - mbstring2;
469 ok(step == 5,
"_mbsninc adds %d (exp. 5)\n", step);
470 step =
_mbsninc(mbstring2, 4) - mbstring2;
471 ok(step == 7,
"_mbsninc adds %d (exp. 7)\n", step);
472 step =
_mbsninc(mbstring2, 5) - mbstring2;
473 ok(step == 7,
"_mbsninc adds %d (exp. 7)\n", step);
474 step =
_mbsninc(mbstring2, 17) - mbstring2;
475 ok(step == 7,
"_mbsninc adds %d (exp. 7)\n", step);
488 skip(
"Current locale has double-byte charset - could lead to false positives\n");
516 unsigned char str1[]=
"cabernet";
517 unsigned char str2[]=
"shiraz";
518 unsigned char set[]=
"abc";
519 unsigned char empty[]=
"";
520 unsigned char mbstr[]=
" 2019\x94\x4e" "6\x8c\x8e" "29\x93\xfa";
521 unsigned char mbset1[]=
"0123456789 \x94\x4e";
522 unsigned char mbset2[]=
" \x94\x4e\x8c\x8e";
523 unsigned char mbset3[]=
"\x8e";
527 ok(
ret==3,
"_mbsspn returns %d should be 3\n",
ret);
529 ok(
ret==0,
"_mbsspn returns %d should be 0\n",
ret);
531 ok(
ret==0,
"_mbsspn returns %d should be 0\n",
ret);
535 ok(
ret==8,
"_mbsspn returns %d should be 8\n",
ret);
537 ok(
ret==1,
"_mbsspn returns %d should be 1\n",
ret);
539 ok(
ret==0,
"_mbsspn returns %d should be 0\n",
ret);
541 ok(
ret==2,
"_mbsspn returns %d should be 2\n",
ret);
543 ok(
ret==14,
"_mbsspn returns %d should be 14\n",
ret);
550 unsigned char str1[]=
"cabernet";
551 unsigned char str2[]=
"shiraz";
552 unsigned char set[]=
"abc";
553 unsigned char empty[]=
"";
554 unsigned char full[]=
"abcenrt";
555 unsigned char mbstr[]=
" 2019\x94\x4e" "6\x8c\x8e" "29\x93\xfa";
556 unsigned char mbset1[]=
"0123456789 \x94\x4e";
557 unsigned char mbset2[]=
" \x94\x4e\x8c\x8e";
562 ok(
ret[0]==
'e',
"_mbsspnp returns %c should be e\n",
ret[0]);
564 ok(
ret[0]==
's',
"_mbsspnp returns %c should be s\n",
ret[0]);
566 ok(
ret[0]==
'c',
"_mbsspnp returns %c should be c\n",
ret[0]);
568 ok(
ret==
NULL,
"_mbsspnp returns %p should be NULL\n",
ret);
572 ok(
ret==mbstr+8,
"_mbsspnp returns %p should be %p\n",
ret, mbstr+8);
574 ok(
ret==mbstr+1,
"_mbsspnp returns %p should be %p\n",
ret, mbstr+1);
576 ok(
ret==mbstr+8,
"_mbsspnp returns %p should be %p\n",
ret, mbstr+8);
578 ok(
ret==mbstr+10,
"_mbsspnp returns %p should be %p\n",
ret, mbstr+10);
587 ok(
str == 0,
"strdup returns %s should be 0\n",
str);
594 const char small[] =
"small";
595 const char big[] =
"atoolongstringforthislittledestination";
606 ok(
ret == 0,
"Copying a string into a big enough destination returned %d, expected 0\n",
ret);
609 "Unexpected return data from strcpy_s: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
614 ok(
ret ==
EINVAL,
"Copying into a destination of size 0 returned %d, expected EINVAL\n",
ret);
617 "Unexpected return data from strcpy_s: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
620 ok(
ret ==
EINVAL,
"Copying into a destination of size 0 returned %d, expected EINVAL\n",
ret);
623 "Unexpected return data from strcpy_s: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
628 ok(
ret ==
ERANGE,
"Copying a big string in a small location returned %d, expected ERANGE\n",
ret);
631 "Unexpected return data from strcpy_s: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
636 ok(
ret ==
EINVAL,
"Copying from a NULL source string returned %d, expected EINVAL\n",
ret);
639 "Unexpected return data from strcpy_s: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
643 ok(
ret ==
EINVAL,
"Copying a big string a NULL dest returned %d, expected EINVAL\n",
ret);
651 "Unexpected return data from strcpy: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
655#define okchars(dst, b0, b1, b2, b3, b4, b5, b6, b7) \
656 ok(dst[0] == b0 && dst[1] == b1 && dst[2] == b2 && dst[3] == b3 && \
657 dst[4] == b4 && dst[5] == b5 && dst[6] == b6 && dst[7] == b7, \
658 "Bad result: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",\
659 dst[0], dst[1], dst[2], dst[3], dst[4], dst[5], dst[6], dst[7])
664 static const char tiny[] = {
'T',0,
'I',
'N',
'Y',0};
665 static const char big[] = {
'a',
't',
'o',
'o',
'l',
'o',
'n',
'g',
's',
't',
'r',
'i',
'n',
'g',0};
675 ok(
ret == 0,
"Copying a buffer into a big enough destination returned %d, expected 0\n",
ret);
676 okchars(
dest, tiny[0], tiny[1], tiny[2], tiny[3], tiny[4], tiny[5],
'X',
'X');
682 ok(
ret ==
ERANGE,
"Copying a big buffer to a small destination returned %d, expected ERANGE\n",
ret);
690 ok(
ret ==
EINVAL,
"Copying a NULL source buffer returned %d, expected EINVAL\n",
ret);
698 ok(
ret ==
ERANGE,
"Copying into a destination of size 0 returned %d, expected ERANGE\n",
ret);
700 okchars(
dest,
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X');
705 ok(
ret ==
EINVAL,
"Copying a tiny buffer to a big NULL destination returned %d, expected EINVAL\n",
ret);
712 ok(
ret ==
EINVAL,
"Copying a NULL buffer into a destination of size 0 returned %d, expected EINVAL\n",
ret);
714 okchars(
dest,
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X');
717 ok(!
ret,
"memcpy_s returned %d\n",
ret);
718 ok(!
memcmp(
buf, big,
sizeof(big)),
"unexpected buf\n");
721 ok(!
ret,
"memcpy_s returned %d\n",
ret);
722 ok(!
memcmp(
buf + 1, big,
sizeof(big)),
"unexpected buf\n");
725 ok(!
ret,
"memcpy_s returned %d\n",
ret);
726 ok(!
memcmp(
buf, big,
sizeof(big)),
"unexpected buf\n");
732 static const char tiny[] = {
'T',0,
'I',
'N',
'Y',0};
733 static const char big[] = {
'a',
't',
'o',
'o',
'l',
'o',
'n',
'g',
's',
't',
'r',
'i',
'n',
'g',0};
743 ok(
ret == 0,
"Moving a buffer into a big enough destination returned %d, expected 0\n",
ret);
744 okchars(
dest, tiny[0], tiny[1], tiny[2], tiny[3], tiny[4], tiny[5],
'X',
'X');
749 ok(
ret == 0,
"Moving a buffer up one char returned %d, expected 0\n",
ret);
750 okchars(
dest, big[0], big[0], big[1], big[2], big[3], big[4], big[5], big[6]);
756 ok(
ret ==
ERANGE,
"Moving a big buffer to a small destination returned %d, expected ERANGE\n",
ret);
758 okchars(
dest,
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X');
764 ok(
ret ==
EINVAL,
"Moving a NULL source buffer returned %d, expected EINVAL\n",
ret);
766 okchars(
dest,
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X');
772 ok(
ret ==
ERANGE,
"Moving into a destination of size 0 returned %d, expected ERANGE\n",
ret);
774 okchars(
dest,
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X');
779 ok(
ret ==
EINVAL,
"Moving a tiny buffer to a big NULL destination returned %d, expected EINVAL\n",
ret);
786 ok(
ret ==
EINVAL,
"Moving a NULL buffer into a destination of size 0 returned %d, expected EINVAL\n",
ret);
788 okchars(
dest,
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X');
794 const char *
small =
"sma";
806 ok(
ret == 0,
"strcat_s: Copying a string into a big enough destination returned %d, expected 0\n",
ret);
809 "Unexpected return data from strcpy_s: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
812 ok(
ret == 0,
"strcat_s: Attaching a string to a big enough destination returned %d, expected 0\n",
ret);
815 "Unexpected return data from strcpy_s: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
819 ok(
ret ==
ERANGE,
"strcat_s: Attaching a string to a filled up destination returned %d, expected ERANGE\n",
ret);
822 "Unexpected return data from strcpy_s: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
830 ok(
ret ==
EINVAL,
"strcat_s: Source len = 0 returned %d, expected EINVAL\n",
ret);
833 "Unexpected return data from strcpy_s: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
837 ok(
ret ==
EINVAL,
"strcat_s: len = 0 and src = NULL returned %d, expected EINVAL\n",
ret);
840 "Unexpected return data from strcpy_s: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
844 ok(
ret ==
EINVAL,
"strcat_s: Sourcing from NULL returned %d, expected EINVAL\n",
ret);
847 "Unexpected return data from strcpy_s: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
851 ok(
ret ==
EINVAL,
"strcat_s: Writing to a NULL string returned %d, expected EINVAL\n",
ret);
856 unsigned char dst[8],
src[4];
884 ok(
err == 0,
"_mbscat_s returned %d\n",
err);
889 ok(!
dst[0],
"dst[0] = %c\n",
dst[0]);
890 ok(
dst[1] ==
'a',
"dst[1] = %c\n",
dst[1]);
901 ok(
err == 0,
"_mbscat_s returned %d\n",
err);
910 ok(
err == 0,
"_mbscat_s returned %d\n",
err);
936 unsigned char dest[8];
937 const unsigned char big[] =
"atoolongstringforthislittledestination";
938 const unsigned char small[] =
"small";
943 win_skip(
"_mbsnbcpy_s not found\n");
949 ok(
ret == 0,
"_mbsnbcpy_s: Copying a string into a big enough destination returned %d, expected 0\n",
ret);
952 "Unexpected return data from _mbsnbcpy_s: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
958 ok(
ret ==
ERANGE,
"_mbsnbcpy_s: Copying a too long string returned %d, expected ERANGE\n",
ret);
961 "Unexpected return data from _mbsnbcpy_s: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
965 ret = p_mbsnbcpy_s(
dest,
sizeof(
dest) - 2, big, 4);
966 ok(
ret == 0,
"_mbsnbcpy_s: Copying a too long string with a count cap returned %d, expected 0\n",
ret);
969 "Unexpected return data from _mbsnbcpy_s: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
974 ok(
ret == 0,
"_mbsnbcpy_s: Copying more data than the source string len returned %d, expected 0\n",
ret);
977 "Unexpected return data from _mbsnbcpy_s: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
983 const unsigned char src[] =
"source string";
984 unsigned char dest[16];
1002 ok(!
dest[0],
"dest buffer was not modified on invalid argument\n");
1008 ok(
dest[
sizeof(
src)] ==
'X',
"unused part of buffer was modified\n");
1013 ok(!
dest[0],
"incorrect dest buffer (%d)\n",
dest[0]);
1014 ok(
dest[1] ==
src[1],
"incorrect dest buffer (%d)\n",
dest[1]);
1019 static const WCHAR szLongText[] = {
'T',
'h',
'i',
's',
'A',
'L',
'o',
'n',
'g',
's',
't',
'r',
'i',
'n',
'g',0 };
1020 static WCHAR szDest[18];
1021 static WCHAR szDestShort[8];
1032 ret = p_wcscpy_s(
NULL, 18, szLongText);
1039 ret = p_wcscpy_s(szDest, 18,
NULL);
1042 ok(szDest[0] == 0,
"szDest[0] not 0, got %c\n", szDest[0]);
1047 ret = p_wcscpy_s(szDest, 0, szLongText);
1053 ok(szDest[0] == 0 ||
ret ==
EINVAL,
"szDest[0] not 0\n");
1056 ret = p_wcscpy_s(szDest, 18, szLongText);
1057 ok(
ret == 0,
"expected 0 got %d\n",
ret);
1058 ok(
lstrcmpW(szDest, szLongText) == 0,
"szDest != szLongText\n");
1061 ret = p_wcscpy_s(szDest, 18, szDest);
1062 ok(
ret == 0,
"expected 0 got %d\n",
ret);
1063 ok(
lstrcmpW(szDest, szLongText) == 0,
"szDest != szLongText\n");
1068 ret = p_wcscpy_s(szDestShort, 8, szLongText);
1071 ok(szDestShort[0] == 0,
"szDestShort[0] not 0\n");
1083 ret = p_wcsncpy_s(szDest, 18,
NULL, 1);
1085 ok(szDest[0] == 0,
"szDest[0] not 0\n");
1088 ret = p_wcsncpy_s(szDest, 18,
NULL, 0);
1089 ok(
ret == 0,
"expected ERROR_SUCCESS got %d\n",
ret);
1090 ok(szDest[0] == 0,
"szDest[0] not 0\n");
1093 ret = p_wcsncpy_s(szDest, 0, szLongText,
ARRAY_SIZE(szLongText));
1095 ok(szDest[0] == 0 ||
ret ==
EINVAL,
"szDest[0] not 0\n");
1097 ret = p_wcsncpy_s(szDest, 18, szLongText,
ARRAY_SIZE(szLongText));
1098 ok(
ret == 0,
"expected 0 got %d\n",
ret);
1099 ok(
lstrcmpW(szDest, szLongText) == 0,
"szDest != szLongText\n");
1102 ret = p_wcsncpy_s(szDestShort, 8, szLongText,
ARRAY_SIZE(szLongText));
1104 ok(szDestShort[0] == 0,
"szDestShort[0] not 0\n");
1107 ret = p_wcsncpy_s(szDest, 5, szLongText, -1);
1109 ok(szDest[4] == 0,
"szDest[4] not 0\n");
1112 ret = p_wcsncpy_s(
NULL, 0, (
void*)0xdeadbeef, 0);
1115 szDestShort[0] =
'1';
1117 ret = p_wcsncpy_s(szDestShort+1, 4, szDestShort, -1);
1119 ok(szDestShort[0]==
'1' && szDestShort[1]==
'1' && szDestShort[2]==
'1' && szDestShort[3]==
'1',
1125 static const WCHAR mixedString[] = {
'M',
'i',
'X',
'e',
'D',
'l',
'o',
'w',
1126 'e',
'r',
'U',
'P',
'P',
'E',
'R', 0};
1127 static const WCHAR expectedString[] = {
'M',
'I',
'X',
'E',
'D',
'L',
'O',
1128 'W',
'E',
'R',
'U',
'P',
'P',
'E',
1142 ok(
ret ==
EINVAL,
"Expected _wcsupr_s to fail with EINVAL, got %d\n",
ret);
1148 ok(
ret ==
EINVAL,
"Expected _wcsupr_s to fail with EINVAL, got %d\n",
ret);
1153 testBuffer[0] =
'\0';
1154 ret = p_wcsupr_s(testBuffer, 0);
1155 ok(
ret ==
EINVAL,
"Expected _wcsupr_s to fail with EINVAL, got %d\n",
ret);
1157 ok(testBuffer[0] ==
'\0',
"Expected the buffer to be unchanged\n");
1160 testBuffer[0] =
'\0';
1161 ret = p_wcsupr_s(testBuffer, 1);
1162 ok(
ret == 0,
"Expected _wcsupr_s to succeed, got %d\n",
ret);
1163 ok(testBuffer[0] ==
'\0',
"Expected the buffer to be unchanged\n");
1167 testBuffer[0] =
'x';
1168 ret = p_wcsupr_s(testBuffer, 0);
1169 ok(
ret ==
EINVAL,
"Expected _wcsupr_s to fail with EINVAL, got %d\n",
ret);
1171 ok(testBuffer[0] ==
'\0',
"Expected the first buffer character to be null\n");
1175 testBuffer[0] =
'x';
1176 ret = p_wcsupr_s(testBuffer, 1);
1177 ok(
ret ==
EINVAL,
"Expected _wcsupr_s to fail with EINVAL, got %d\n",
ret);
1179 ok(testBuffer[0] ==
'\0',
"Expected the first buffer character to be null\n");
1182 wcscpy(testBuffer, mixedString);
1184 ret = p_wcsupr_s(testBuffer, 0);
1185 ok(
ret ==
EINVAL,
"Expected _wcsupr_s to fail with EINVAL, got %d\n",
ret);
1187 ok(testBuffer[0] ==
'\0',
"Expected the first buffer character to be null\n");
1190 wcscpy(testBuffer, mixedString);
1192 ok(
ret == 0,
"Expected _wcsupr_s to succeed, got %d\n",
ret);
1193 ok(!
wcscmp(testBuffer, expectedString),
"Expected the string to be fully upper-case\n");
1196 wcscpy(testBuffer, mixedString);
1199 ok(
ret ==
EINVAL,
"Expected _wcsupr_s to fail with EINVAL, got %d\n",
ret);
1201 ok(testBuffer[0] ==
'\0',
"Expected the first buffer character to be null\n");
1204 wcscpy(testBuffer, mixedString);
1206 ok(
ret == 0,
"Expected _wcsupr_s to succeed, got %d\n",
ret);
1207 ok(!
wcscmp(testBuffer, expectedString),
"Expected the string to be fully upper-case\n");
1212 static const WCHAR mixedString[] = {
'M',
'i',
'X',
'e',
'D',
'l',
'o',
'w',
1213 'e',
'r',
'U',
'P',
'P',
'E',
'R', 0};
1214 static const WCHAR expectedString[] = {
'm',
'i',
'x',
'e',
'd',
'l',
'o',
1215 'w',
'e',
'r',
'u',
'p',
'p',
'e',
1244 ok(
buffer[0] == 0,
"expected empty string\n");
1250 ok(
buffer[0] == 0,
"expected buffer to be unchanged\n");
1258 ok(
buffer[0] ==
'\0',
"expected empty string\n");
1266 ok(
buffer[0] ==
'\0',
"expected empty string\n");
1274 ok(
buffer[0] ==
'\0',
"expected empty string\n");
1279 ok(
ret == 0,
"expected 0, got %d\n",
ret);
1288 ok(
buffer[0] ==
'\0',
"expected empty string\n");
1293 ok(
ret == 0,
"expected 0, got %d\n",
ret);
1300 unsigned int jisjms[][2] = { {0x2020, 0}, {0x2021, 0}, {0x2120, 0}, {0x2121, 0x8140},
1301 {0x7f7f, 0}, {0x7f7e, 0}, {0x7e7f, 0}, {0x7e7e, 0xeffc},
1302 {0x255f, 0x837e}, {0x2560, 0x8380}, {0x2561, 0x8381},
1303 {0x2121FFFF, 0}, {0x2223, 0x81a1}, {0x237e, 0x829e}, {0, 0}};
1311 for (
j = 0; jisjms[
j][0] != 0;
j++)
1315 exp = (
cp[
i] == 932) ? jisjms[
j][1] : jisjms[
j][0];
1316 ok(
ret ==
exp,
"Expected 0x%x, got 0x%x (0x%x, codepage=%d)\n",
1326 unsigned int jmsjis[][2] = { {0x80fc, 0}, {0x813f, 0}, {0x8140, 0x2121},
1327 {0x817e, 0x215f}, {0x817f, 0}, {0x8180, 0x2160},
1328 {0x819e, 0x217e}, {0x819f, 0x2221}, {0x81fc, 0x227e},
1329 {0x81fd, 0}, {0x9ffc, 0x5e7e}, {0x9ffd, 0},
1330 {0xa040, 0}, {0xdffc, 0}, {0xe040, 0x5f21},
1331 {0xeffc, 0x7e7e}, {0xf040, 0}, {0x21, 0}, {0, 0}};
1339 for (
j = 0; jmsjis[
j][0] != 0;
j++)
1343 exp = (
cp[
i] == 932) ? jmsjis[
j][1] : jmsjis[
j][0];
1344 ok(
ret ==
exp,
"Expected 0x%x, got 0x%x (0x%x, codepage=%d)\n",
1353 static const unsigned int mbchira_932[][2] = {
1354 {0x8152, 0x8152}, {0x8153, 0x8153}, {0x8154, 0x8154}, {0x8155, 0x8155},
1355 {0x82a0, 0x82a0}, {0x833f, 0x833f}, {0x8340, 0x829f}, {0x837e, 0x82dd},
1356 {0x837f, 0x837f}, {0x8380, 0x82de}, {0x8393, 0x82f1}, {0x8394, 0x8394},
1357 {0x8396, 0x8396}, {0x8397, 0x8397},
1358 {0xa5, 0xa5}, {0xb0, 0xb0}, {0xdd, 0xdd} };
1365 int ret,
exp = mbchira_932[
i][0];
1375 exp = mbchira_932[
i][1];
1383 static const unsigned int mbckata_932[][2] = {
1384 {0x8152, 0x8152}, {0x8153, 0x8153}, {0x8154, 0x8154}, {0x8155, 0x8155},
1385 {0x833f, 0x833f}, {0x829f, 0x8340}, {0x82dd, 0x837e}, {0x837f, 0x837f},
1386 {0x82de, 0x8380}, {0x8394, 0x8394}, {0x8397, 0x8397},
1387 {0xa5, 0xa5}, {0xb0, 0xb0}, {0xdd, 0xdd} };
1394 int ret,
exp = mbckata_932[
i][0];
1404 exp = mbckata_932[
i][1];
1412 static const unsigned int mbbmbc[][2] = {
1413 {0x1f, 0x1f}, {0x20, 0x8140}, {0x39, 0x8258}, {0x40, 0x8197},
1414 {0x41, 0x8260}, {0x5e, 0x814f}, {0x7e, 0x8150}, {0x7f, 0x7f},
1415 {0x80, 0x80}, {0x81, 0x81}, {0xa0, 0xa0}, {0xa7, 0x8340},
1416 {0xb0, 0x815b}, {0xd1, 0x8380}, {0xff, 0xff}, {0,0}};
1424 for (
j = 0; mbbmbc[
j][0] != 0;
j++)
1428 exp = (
cp[
i] == 932) ? mbbmbc[
j][1] : mbbmbc[
j][0];
1429 ok(
ret ==
exp,
"Expected 0x%x, got 0x%x (0x%x, codepage %d)\n",
1438 static const unsigned int mbcmbb_932[][2] = {
1439 {0x829e, 0x829e}, {0x829f, 0xa7}, {0x82f1, 0xdd}, {0x82f2, 0x82f2},
1440 {0x833f, 0x833f}, {0x8340, 0xa7}, {0x837e, 0xd0}, {0x837f, 0x837f},
1441 {0x8380, 0xd1}, {0x8396, 0xb9}, {0x8397, 0x8397}, {0x813f, 0x813f},
1442 {0x8140, 0x20}, {0x814c, 0x814c}, {0x814f, 0x5e}, {0x8197, 0x40},
1443 {0x8198, 0x8198}, {0x8258, 0x39}, {0x8259, 0x8259}, {0x825f, 0x825f},
1444 {0x8260, 0x41}, {0x82f1, 0xdd}, {0x82f2, 0x82f2}, {0,0}};
1449 for (
i = 0; mbcmbb_932[
i][0] != 0;
i++)
1452 exp = mbcmbb_932[
i][1];
1459 struct katakana_pair {
1463 static const struct katakana_pair
tests[] = {
1496 for(
i = 0;
i < 0x10000;
i++) {
1507 ok(!
err,
"_ismbclegal (932) : Expected 0x%x, got 0x%x (0x%x)\n",
exp,
ret,
i);
1510 for(
i = 0;
i < 0x10000;
i++) {
1519 ok(!
err,
"_ismbclegal (936) : Expected 0x%x, got 0x%x (0x%x)\n",
exp,
ret,
i);
1522 for(
i = 0;
i < 0x10000;
i++) {
1531 ok(!
err,
"_ismbclegal (949) : Expected 0x%x, got 0x%x (0x%x)\n",
exp,
ret,
i);
1534 for(
i = 0;
i < 0x10000;
i++) {
1544 ok(!
err,
"_ismbclegal (950) : Expected 0x%x, got 0x%x (0x%x)\n",
exp,
ret,
i);
1547 for(
i = 0;
i < 0x10000;
i++) {
1564static const struct {
1574 {
"red cabernet",
" ", 0, 4, -1 },
1575 {
"sparkling white riesling",
" ", 0, 10, 16 },
1576 {
" pale cream sherry",
"e ", 1, 6, 9 },
1591 "string (%p) \'%s\' return %p\n",
1593 if( !strret)
continue;
1597 "second call string (%p) \'%s\' return %p\n",
1599 if( !strret)
continue;
1603 "third call string (%p) \'%s\' return %p\n",
1610 static char neg[] =
"-0x";
1620 ok(
l==-1234,
"wrong value %d\n",
l);
1624 ok(ul==1234,
"wrong value %u\n", ul);
1629 ok(
l==2147483647,
"wrong value %d\n",
l);
1633 ok(
l==-2147483647L - 1,
"wrong value %d\n",
l);
1636 ul =
strtoul(
"4294967295UL", &
e, 0);
1637 ok(ul==4294967295ul,
"wrong value %u\n", ul);
1641 l =
strtol(
"9223372036854775807L", &
e, 0);
1642 ok(
l==2147483647,
"wrong value %d\n",
l);
1645 ul =
strtoul(
"9223372036854775807L", &
e, 0);
1646 ok(ul==4294967295ul,
"wrong value %u\n", ul);
1651 ok(ul == -2,
"wrong value %u\n", ul);
1656 ok(ul == 2,
"wrong value %u\n", ul);
1661 ok(ul==1,
"wrong value %u\n", ul);
1666 ok(ul == 1,
"wrong value %u\n", ul);
1671 ok(
l == 0,
"wrong value %d\n",
l);
1673 ok(
e == neg,
"e = %p, neg = %p\n",
e, neg);
1678 static const char str[] =
"string";
1686 res = p_strnlen(
str, 20);
1687 ok(
res == 6,
"Returned length = %d\n", (
int)
res);
1690 ok(
res == 3,
"Returned length = %d\n", (
int)
res);
1693 ok(
res == 0,
"Returned length = %d\n", (
int)
res);
1698 static const char no1[] =
"31923";
1699 static const char no2[] =
"-213312";
1700 static const char no3[] =
"12aa";
1701 static const char no4[] =
"abc12";
1702 static const char overflow[] =
"99999999999999999999";
1703 static const char neg_overflow[] =
"-99999999999999999999";
1704 static const char hex[] =
"0x123";
1705 static const char oct[] =
"000123";
1706 static const char blanks[] =
" 12 212.31";
1712 if(!p_strtoi64 || !p_strtoui64) {
1713 win_skip(
"_strtoi64 or _strtoui64 not found\n");
1718 res = p_strtoi64(no1,
NULL, 10);
1719 ok(
res == 31923,
"res != 31923\n");
1720 res = p_strtoi64(no2,
NULL, 10);
1721 ok(
res == -213312,
"res != -213312\n");
1722 res = p_strtoi64(no3,
NULL, 10);
1723 ok(
res == 12,
"res != 12\n");
1724 res = p_strtoi64(no4, &endpos, 10);
1725 ok(
res == 0,
"res != 0\n");
1726 ok(endpos == no4,
"Scanning was not stopped on first character\n");
1727 res = p_strtoi64(
hex, &endpos, 10);
1728 ok(
res == 0,
"res != 0\n");
1729 ok(endpos ==
hex+1,
"Incorrect endpos (%p-%p)\n",
hex, endpos);
1730 res = p_strtoi64(
oct, &endpos, 10);
1731 ok(
res == 123,
"res != 123\n");
1733 res = p_strtoi64(blanks, &endpos, 10);
1734 ok(
res == 12,
"res != 12\n");
1735 ok(endpos == blanks+10,
"Incorrect endpos (%p-%p)\n", blanks, endpos);
1739 res = p_strtoi64(overflow, &endpos, 10);
1741 ok(endpos == overflow+
strlen(overflow),
"Incorrect endpos (%p-%p)\n", overflow, endpos);
1745 res = p_strtoi64(neg_overflow, &endpos, 10);
1747 ok(endpos == neg_overflow+
strlen(neg_overflow),
"Incorrect endpos (%p-%p)\n", neg_overflow, endpos);
1751 res = p_strtoi64(no1, &endpos, 16);
1752 ok(
res == 203043,
"res != 203043\n");
1753 ok(endpos == no1+
strlen(no1),
"Incorrect endpos (%p-%p)\n", no1, endpos);
1754 res = p_strtoi64(no2, &endpos, 16);
1755 ok(
res == -2175762,
"res != -2175762\n");
1756 ok(endpos == no2+
strlen(no2),
"Incorrect endpos (%p-%p)\n", no2, endpos);
1757 res = p_strtoi64(no3, &endpos, 16);
1758 ok(
res == 4778,
"res != 4778\n");
1759 ok(endpos == no3+
strlen(no3),
"Incorrect endpos (%p-%p)\n", no3, endpos);
1760 res = p_strtoi64(no4, &endpos, 16);
1761 ok(
res == 703506,
"res != 703506\n");
1762 ok(endpos == no4+
strlen(no4),
"Incorrect endpos (%p-%p)\n", no4, endpos);
1763 res = p_strtoi64(
hex, &endpos, 16);
1764 ok(
res == 291,
"res != 291\n");
1766 res = p_strtoi64(
oct, &endpos, 16);
1767 ok(
res == 291,
"res != 291\n");
1769 res = p_strtoi64(blanks, &endpos, 16);
1770 ok(
res == 18,
"res != 18\n");
1771 ok(endpos == blanks+10,
"Incorrect endpos (%p-%p)\n", blanks, endpos);
1775 res = p_strtoi64(
hex, &endpos, 36);
1776 ok(
res == 1541019,
"res != 1541019\n");
1781 res = p_strtoi64(no1, &endpos, 0);
1782 ok(
res == 31923,
"res != 31923\n");
1783 ok(endpos == no1+
strlen(no1),
"Incorrect endpos (%p-%p)\n", no1, endpos);
1784 res = p_strtoi64(no2, &endpos, 0);
1785 ok(
res == -213312,
"res != -213312\n");
1786 ok(endpos == no2+
strlen(no2),
"Incorrect endpos (%p-%p)\n", no2, endpos);
1787 res = p_strtoi64(no3, &endpos, 10);
1788 ok(
res == 12,
"res != 12\n");
1789 ok(endpos == no3+2,
"Incorrect endpos (%p-%p)\n", no3, endpos);
1790 res = p_strtoi64(no4, &endpos, 10);
1791 ok(
res == 0,
"res != 0\n");
1792 ok(endpos == no4,
"Incorrect endpos (%p-%p)\n", no4, endpos);
1793 res = p_strtoi64(
hex, &endpos, 10);
1794 ok(
res == 0,
"res != 0\n");
1795 ok(endpos ==
hex+1,
"Incorrect endpos (%p-%p)\n",
hex, endpos);
1796 res = p_strtoi64(
oct, &endpos, 10);
1797 ok(
res == 123,
"res != 123\n");
1799 res = p_strtoi64(blanks, &endpos, 10);
1800 ok(
res == 12,
"res != 12\n");
1801 ok(endpos == blanks+10,
"Incorrect endpos (%p-%p)\n", blanks, endpos);
1805 ures = p_strtoui64(no1, &endpos, 0);
1806 ok(ures == 31923,
"ures != 31923\n");
1807 ok(endpos == no1+
strlen(no1),
"Incorrect endpos (%p-%p)\n", no1, endpos);
1808 ures = p_strtoui64(no2, &endpos, 0);
1809 ok(ures == -213312,
"ures != -213312\n");
1810 ok(endpos == no2+
strlen(no2),
"Incorrect endpos (%p-%p)\n", no2, endpos);
1811 ures = p_strtoui64(no3, &endpos, 10);
1812 ok(ures == 12,
"ures != 12\n");
1813 ok(endpos == no3+2,
"Incorrect endpos (%p-%p)\n", no3, endpos);
1814 ures = p_strtoui64(no4, &endpos, 10);
1815 ok(ures == 0,
"ures != 0\n");
1816 ok(endpos == no4,
"Incorrect endpos (%p-%p)\n", no4, endpos);
1817 ures = p_strtoui64(
hex, &endpos, 10);
1818 ok(ures == 0,
"ures != 0\n");
1819 ok(endpos ==
hex+1,
"Incorrect endpos (%p-%p)\n",
hex, endpos);
1820 ures = p_strtoui64(
oct, &endpos, 10);
1821 ok(ures == 123,
"ures != 123\n");
1823 ures = p_strtoui64(blanks, &endpos, 10);
1824 ok(ures == 12,
"ures != 12\n");
1825 ok(endpos == blanks+10,
"Incorrect endpos (%p-%p)\n", blanks, endpos);
1829 ures = p_strtoui64(overflow, &endpos, 10);
1831 ok(endpos == overflow+
strlen(overflow),
"Incorrect endpos (%p-%p)\n", overflow, endpos);
1835 ures = p_strtoui64(neg_overflow, &endpos, 10);
1836 ok(ures == 1,
"ures != 1\n");
1837 ok(endpos == neg_overflow+
strlen(neg_overflow),
"Incorrect endpos (%p-%p)\n", neg_overflow, endpos);
1842 if(d1-d2>-1
e-30 && d1-d2<1
e-30)
1849 const char double1[] =
"12.1";
1850 const char double2[] =
"-13.721";
1851 const char double3[] =
"INF";
1852 const char double4[] =
".21e12";
1853 const char double5[] =
"214353e-3";
1854 const char double6[] =
"NAN";
1855 const char overflow[] =
"1d9999999999999999999";
1856 const char white_chars[] =
" d10";
1863 ok(
end == double1+4,
"incorrect end (%d)\n", (
int)(
end-double1));
1867 ok(
end == double2+7,
"incorrect end (%d)\n", (
int)(
end-double2));
1871 ok(
end == double3,
"incorrect end (%d)\n", (
int)(
end-double3));
1875 ok(
end == double4+6,
"incorrect end (%d)\n", (
int)(
end-double4));
1879 ok(
end == double5+9,
"incorrect end (%d)\n", (
int)(
end-double5));
1883 ok(
end == double6,
"incorrect end (%d)\n", (
int)(
end-double6));
1890 ok(
end == white_chars,
"incorrect end (%d)\n", (
int)(
end-white_chars));
1902 end = (
char *)0xdeadbeef;
1906 ok(!
end,
"incorrect end ptr %p\n",
end);
1916 win_skip(
"system with limited locales\n");
1937 d =
strtod(
"21921922352523587651128218821",
NULL);
1947 ok(
end == overflow+21,
"incorrect end (%d)\n", (
int)(
end-overflow));
1956 static const wchar_t wSimple[] = {
't',
'e',
'x',
't',0 };
1957 static const wchar_t wHiragana[] = { 0x3042,0x3043,0 };
1958 static const wchar_t wEmpty[] = { 0 };
1959 static const char mSimple[] =
"text";
1960 static const char mHiragana[] = { 0x82,0xa0,0x82,0xa1,0 };
1961 static const char mEmpty[] = { 0 };
1963 const wchar_t *pwstr;
1971 wOut[4] =
'!'; wOut[5] =
'\0';
1972 mOut[4] =
'!'; mOut[5] =
'\0';
1978 ok(
ret == -1,
"mbstowcs did not return -1\n");
1983 ok(
ret == 4,
"mbstowcs did not return 4\n");
1986 ok(
ret == 4,
"mbstowcs did not return 4\n");
1988 ok(wOut[4] ==
'!',
"wOut[4] != \'!\'\n");
1991 ok(
ret == 0,
"mbstowcs did not return 0, got %d\n", (
int)
ret);
1994 ok(
ret == 0,
"mbstowcs did not return 0, got %d\n", (
int)
ret);
1998 ok(
ret == 4,
"wcstombs did not return 4\n");
2001 ok(
ret == 4,
"wcstombs did not return 4\n");
2002 ok(!
memcmp(mOut, mSimple, 5*
sizeof(
char)),
"mOut = %s\n", mOut);
2005 ok(
ret == 2,
"wcstombs did not return 2\n");
2006 ok(!
memcmp(mOut, mSimple, 5*
sizeof(
char)),
"mOut = %s\n", mOut);
2009 ok(
ret == 0,
"wcstombs did not return 0, got %d\n", (
int)
ret);
2012 ok(
ret == 0,
"wcstombs did not return 0, got %d\n", (
int)
ret);
2013 ok(!
memcmp(mOut, mEmpty,
sizeof(mEmpty)),
"mOut = %s\n", mOut);
2016 win_skip(
"Japanese_Japan.932 locale not available\n");
2021 ok(
ret == 2,
"mbstowcs did not return 2\n");
2025 ok(
ret == 0,
"mbstowcs did not return 0, got %d\n", (
int)
ret);
2029 ok(
ret == 4,
"wcstombs did not return 4\n");
2030 ok(!
memcmp(mOut, mHiragana,
sizeof(mHiragana)),
"mOut = %s\n", mOut);
2033 ok(
ret == 0,
"wcstombs did not return 0, got %d\n", (
int)
ret);
2034 ok(!
memcmp(mOut, mEmpty,
sizeof(mEmpty)),
"mOut = %s\n", mOut);
2036 if(!pmbstowcs_s || !pwcstombs_s) {
2038 win_skip(
"mbstowcs_s or wcstombs_s not available\n");
2044 ok(
ret == 5,
"mbstowcs_s did not return 5\n");
2049 ok(
ret == 3,
"mbstowcs_s did not return 3\n");
2054 ok(
ret == 1,
"mbstowcs_s did not return 1, got %d\n", (
int)
ret);
2057 err = pmbstowcs_s(&
ret,
NULL, 0, mHiragana, 1);
2059 ok(
ret == 3,
"mbstowcs_s did not return 3\n");
2063 ok(
ret == 5,
"wcstombs_s did not return 5\n");
2064 ok(!
memcmp(mOut, mSimple,
sizeof(mSimple)),
"mOut = %s\n", mOut);
2068 ok(
ret == 5,
"wcstombs_s did not return 5\n");
2069 ok(!
memcmp(mOut, mHiragana,
sizeof(mHiragana)),
"mOut = %s\n", mOut);
2073 ok(
ret == 1,
"wcstombs_s did not return 1, got %d\n", (
int)
ret);
2074 ok(!
memcmp(mOut, mEmpty,
sizeof(mEmpty)),
"mOut = %s\n", mOut);
2076 err = pwcstombs_s(&
ret,
NULL, 0, wHiragana, 1);
2078 ok(
ret == 5,
"wcstombs_s did not return 5\n");
2082 win_skip(
"wcsrtombs not available\n");
2088 ret = pwcsrtombs(mOut, &pwstr, 4, &
err);
2089 ok(
ret == 4,
"wcsrtombs did not return 4\n");
2091 ok(pwstr == wSimple+4,
"pwstr = %p (wszSimple = %p)\n", pwstr, wSimple);
2092 ok(!
memcmp(mOut, mSimple,
ret),
"mOut = %s\n", mOut);
2095 ret = pwcsrtombs(mOut, &pwstr, 5,
NULL);
2096 ok(
ret == 4,
"wcsrtombs did not return 4\n");
2097 ok(pwstr ==
NULL,
"pwstr != NULL\n");
2098 ok(!
memcmp(mOut, mSimple,
sizeof(mSimple)),
"mOut = %s\n", mOut);
2102 win_skip(
"mbsrtowcs not available\n");
2108 ok(
ret == 2,
"mbsrtowcs did not return 2\n");
2109 ok(pmbstr == mHiragana,
"pmbstr = %p, expected %p\n", pmbstr, mHiragana);
2112 ret = p_mbsrtowcs(wOut, &pmbstr, 6,
NULL);
2113 ok(
ret == 2,
"mbsrtowcs did not return 2\n");
2115 ok(!pmbstr,
"pmbstr != NULL\n");
2117 state = mHiragana[0];
2118 pmbstr = mHiragana+1;
2119 ret = p_mbsrtowcs(wOut, &pmbstr, 6, &
state);
2120 ok(
ret == 2,
"mbsrtowcs did not return 2\n");
2121 ok(wOut[0] == 0x3042,
"wOut[0] = %x\n", wOut[0]);
2122 ok(wOut[1] == 0xff61,
"wOut[1] = %x\n", wOut[1]);
2123 ok(wOut[2] == 0,
"wOut[2] = %x\n", wOut[2]);
2124 ok(!pmbstr,
"pmbstr != NULL\n");
2128 ok(
ret == -1,
"mbsrtowcs did not return -1\n");
2131 if(!p_mbsrtowcs_s) {
2133 win_skip(
"mbsrtowcs_s not available\n");
2139 ok(
ret == -1,
"mbsrtowcs_s did not return -1\n");
2142 ok(
ret == -1,
"mbsrtowcs_s did not return -1\n");
2144 err = p_mbsrtowcs_s(&
ret, wOut, 0, &pmbstr, 6,
NULL);
2145 ok(
ret == -1,
"mbsrtowcs_s did not return -1\n");
2151 ok(
ret == 3,
"mbsrtowcs_s did not return 3\n");
2153 ok(pmbstr == mHiragana,
"pmbstr = %p, expected %p\n", pmbstr, mHiragana);
2157 err = p_mbsrtowcs_s(&
ret, wOut, 1, &pmbstr, 6,
NULL);
2158 ok(
ret == 2,
"mbsrtowcs_s did not return 2\n");
2160 ok(!wOut[0],
"wOut[0] = '%c'\n", wOut[0]);
2161 ok(pmbstr == mHiragana+2,
"pmbstr = %p, expected %p\n", pmbstr, mHiragana+2);
2165 err = p_mbsrtowcs_s(&
ret, wOut, 2, &pmbstr, 6,
NULL);
2166 ok(
ret == 3,
"mbsrtowcs_s did not return 3\n");
2168 ok(!wOut[0],
"wOut[0] = '%c'\n", wOut[0]);
2169 ok(pmbstr == mHiragana+4,
"pmbstr = %p, expected %p\n", pmbstr, mHiragana+4);
2173 err = p_mbsrtowcs_s(&
ret, wOut, 3, &pmbstr, 6,
NULL);
2174 ok(
ret == 3,
"mbsrtowcs_s did not return 3\n");
2176 ok(!pmbstr,
"pmbstr != NULL\n");
2188 win_skip(
"Skipping _gcvt tests\n");
2207 err = p_gcvt_s(
buf, 5, 1.2, 10);
2209 ok(
buf[0] ==
'\0',
"buf[0] = %c\n",
buf[0]);
2212 err = p_gcvt_s(
buf, 4, 123456, 2);
2214 ok(
buf[0] ==
'\0',
"buf[0] = %c\n",
buf[0]);
2224 win_skip(
"Skipping _itoa_s tests\n");
2229 ret = p_itoa_s(0,
NULL, 0, 0);
2230 ok(
ret ==
EINVAL,
"Expected _itoa_s to return EINVAL, got %d\n",
ret);
2236 ok(
ret ==
EINVAL,
"Expected _itoa_s to return EINVAL, got %d\n",
ret);
2238 ok(
buffer[0] ==
'X',
"Expected the output buffer to be untouched\n");
2243 ok(
ret ==
EINVAL,
"Expected _itoa_s to return EINVAL, got %d\n",
ret);
2245 ok(
buffer[0] ==
'\0',
"Expected the output buffer to be null terminated\n");
2250 ok(
ret ==
EINVAL,
"Expected _itoa_s to return EINVAL, got %d\n",
ret);
2252 ok(
buffer[0] ==
'\0',
"Expected the output buffer to be null terminated\n");
2256 ret = p_itoa_s(12345678,
buffer, 4, 10);
2257 ok(
ret ==
ERANGE,
"Expected _itoa_s to return ERANGE, got %d\n",
ret);
2260 "Expected the output buffer to be null terminated with truncated output\n");
2264 ret = p_itoa_s(12345678,
buffer, 8, 10);
2265 ok(
ret ==
ERANGE,
"Expected _itoa_s to return ERANGE, got %d\n",
ret);
2268 "Expected the output buffer to be null terminated with truncated output\n");
2272 ret = p_itoa_s(-12345678,
buffer, 9, 10);
2273 ok(
ret ==
ERANGE,
"Expected _itoa_s to return ERANGE, got %d\n",
ret);
2276 "Expected the output buffer to be null terminated with truncated output\n");
2278 ret = p_itoa_s(12345678,
buffer, 9, 10);
2279 ok(
ret == 0,
"Expected _itoa_s to return 0, got %d\n",
ret);
2281 "Expected output buffer string to be \"12345678\", got \"%s\"\n",
2285 ok(
ret == 0,
"Expected _itoa_s to return 0, got %d\n",
ret);
2287 "Expected output buffer string to be \"1010101010101010\", got \"%s\"\n",
2291 ok(
ret == 0,
"Expected _itoa_s to return 0, got %d\n",
ret);
2293 "Expected output buffer string to be \"nell\", got \"%s\"\n",
2297 ok(
ret == 0,
"Expected _itoa_s to return 0, got %d\n",
ret);
2299 "Expected output buffer string to be \"hag\", got \"%s\"\n",
2303 ok(
ret == 0,
"Expected _itoa_s to return 0, got %d\n",
ret);
2305 "Expected output buffer string to be \"-12345678\", got \"%s\"\n",
2310 "Expected output buffer string to be \"10\", got \"%s\"\n",
buffer);
2320 win_skip(
"Skipping _strlwr_s tests\n");
2326 ok(
ret ==
EINVAL,
"Expected _strlwr_s to return EINVAL, got %d\n",
ret);
2331 ok(
ret ==
EINVAL,
"Expected _strlwr_s to return EINVAL, got %d\n",
ret);
2336 ok(
ret ==
EINVAL,
"Expected _strlwr_s to return EINVAL, got %d\n",
ret);
2342 ok(
ret ==
EINVAL,
"Expected _strlwr_s to return EINVAL, got %d\n",
ret);
2345 "Expected the output buffer to be \"\\0oRrIsTeR\"\n");
2349 ret = p_strlwr_s(
buffer,
sizeof(
"GoRrIsTeR") - 1);
2350 ok(
ret ==
EINVAL,
"Expected _strlwr_s to return EINVAL, got %d\n",
ret);
2353 "Expected the output buffer to be \"\\0oRrIsTeR\"\n");
2356 ret = p_strlwr_s(
buffer,
sizeof(
"GoRrIsTeR"));
2357 ok(
ret == 0,
"Expected _strlwr_s to return 0, got %d\n",
ret);
2359 "Expected the output buffer to be \"gorrister\", got \"%s\"\n",
2362 memcpy(
buffer,
"GoRrIsTeR\0ELLEN",
sizeof(
"GoRrIsTeR\0ELLEN"));
2364 ok(
ret == 0,
"Expected _strlwr_s to return 0, got %d\n",
ret);
2365 ok(!
memcmp(
buffer,
"gorrister\0ELLEN",
sizeof(
"gorrister\0ELLEN")),
2366 "Expected the output buffer to be \"gorrister\\0ELLEN\", got \"%s\"\n",
2372 static wchar_t abcW[] = {
'a',
'b',
'c',0};
2379 win_skip(
"skipping wcsncat_s tests\n");
2411 unsigned char dest[16];
2412 const unsigned char first[] =
"dinosaur";
2413 const unsigned char second[] =
"duck";
2418 win_skip(
"Skipping _mbsnbcat_s tests\n");
2424 ok(
ret == 0,
"Expected _mbsnbcat_s to return 0, got %d\n",
ret);
2428 ok(
ret ==
EINVAL,
"Expected _mbsnbcat_s to return EINVAL, got %d\n",
ret);
2433 ok(
ret ==
EINVAL,
"Expected _mbsnbcat_s to return EINVAL, got %d\n",
ret);
2439 ok(
ret ==
EINVAL,
"Expected _mbsnbcat_s to return EINVAL, got %d\n",
ret);
2441 ok(
dest[0] ==
'X',
"Expected the output buffer to be untouched\n");
2445 ret = p_mbsnbcat_s(
dest, 0, second, 0);
2446 ok(
ret ==
EINVAL,
"Expected _mbsnbcat_s to return EINVAL, got %d\n",
ret);
2448 ok(
dest[0] ==
'X',
"Expected the output buffer to be untouched\n");
2453 ok(
ret ==
EINVAL,
"Expected _mbsnbcat_s to return EINVAL, got %d\n",
ret);
2455 ok(
dest[0] ==
'\0',
"Expected the output buffer to be null terminated\n");
2460 ok(
ret ==
EINVAL,
"Expected _mbsnbcat_s to return EINVAL, got %d\n",
ret);
2462 ok(
dest[0] ==
'\0',
"Expected the output buffer to be null terminated\n");
2466 ret = p_mbsnbcat_s(
dest,
sizeof(
dest), second,
sizeof(second));
2467 ok(
ret == 0,
"Expected _mbsnbcat_s to return 0, got %d\n",
ret);
2469 "Expected the output buffer string to be \"duck\"\n");
2474 ret = p_mbsnbcat_s(
dest,
sizeof(
dest), second, 0);
2475 ok(
ret == 0,
"Expected _mbsnbcat_s to return 0, got %d\n",
ret);
2477 "Expected the output buffer string to be \"dinosaur\"\n");
2481 ret = p_mbsnbcat_s(
dest,
sizeof(
dest), second,
sizeof(second));
2482 ok(
ret == 0,
"Expected _mbsnbcat_s to return 0, got %d\n",
ret);
2483 ok(!
memcmp(
dest,
"dinosaurduck",
sizeof(
"dinosaurduck")),
2484 "Expected the output buffer string to be \"dinosaurduck\"\n");
2488 ret = p_mbsnbcat_s(
dest,
sizeof(
dest), second,
sizeof(second) + 1);
2489 ok(
ret == 0,
"Expected _mbsnbcat_s to return 0, got %d\n",
ret);
2490 ok(!
memcmp(
dest,
"dinosaurduck",
sizeof(
"dinosaurduck")),
2491 "Expected the output buffer string to be \"dinosaurduck\"\n");
2495 ret = p_mbsnbcat_s(
dest,
sizeof(
dest), second,
sizeof(second) - 1);
2496 ok(
ret == 0,
"Expected _mbsnbcat_s to return 0, got %d\n",
ret);
2497 ok(!
memcmp(
dest,
"dinosaurduck",
sizeof(
"dinosaurduck")),
2498 "Expected the output buffer string to be \"dinosaurduck\"\n");
2502 ret = p_mbsnbcat_s(
dest,
sizeof(
dest), second,
sizeof(second) - 2);
2503 ok(
ret == 0,
"Expected _mbsnbcat_s to return 0, got %d\n",
ret);
2504 ok(!
memcmp(
dest,
"dinosaurduc",
sizeof(
"dinosaurduc")),
2505 "Expected the output buffer string to be \"dinosaurduc\"\n");
2511 ret = p_mbsnbcat_s(
dest,
sizeof(
first) - 1, second,
sizeof(second));
2512 ok(
ret ==
EINVAL,
"Expected _mbsnbcat_s to return EINVAL, got %d\n",
ret);
2514 ok(!
memcmp(
dest,
"\0inosaur",
sizeof(
"\0inosaur") - 1),
2515 "Expected the output buffer string to be \"\\0inosaur\" without ending null terminator\n");
2520 ret = p_mbsnbcat_s(
dest,
sizeof(
first), second,
sizeof(second));
2521 ok(
ret ==
ERANGE,
"Expected _mbsnbcat_s to return ERANGE, got %d\n",
ret);
2523 ok(!
memcmp(
dest,
"\0inosaurd",
sizeof(
"\0inosaurd") - 1),
2524 "Expected the output buffer string to be \"\\0inosaurd\" without ending null terminator\n");
2529 ret = p_mbsnbcat_s(
dest,
sizeof(
first) + 1, second,
sizeof(second));
2530 ok(
ret ==
ERANGE,
"Expected _mbsnbcat_s to return ERANGE, got %d\n",
ret);
2532 ok(!
memcmp(
dest,
"\0inosaurdu",
sizeof(
"\0inosaurdu") - 1),
2533 "Expected the output buffer string to be \"\\0inosaurdu\" without ending null terminator\n");
2539 unsigned char buffer[20];
2543 win_skip(
"Skipping _mbsupr_s tests\n");
2549 ok(
ret == 0,
"Expected _mbsupr_s to return 0, got %d\n",
ret);
2553 ok(
ret ==
EINVAL,
"Expected _mbsupr_s to return EINVAL, got %d\n",
ret);
2558 ok(
ret ==
EINVAL,
"Expected _mbsupr_s to return EINVAL, got %d\n",
ret);
2563 ret = p_mbsupr_s(
buffer,
sizeof(
"abcdefgh"));
2564 ok(
ret == 0,
"Expected _mbsupr_s to return 0, got %d\n",
ret);
2566 "Expected the output buffer to be \"ABCDEFGH\", got \"%s\"\n",
2572 ok(
ret == 0,
"Expected _mbsupr_s to return 0, got %d\n",
ret);
2574 "Expected the output buffer to be \"ABCDEFGH\", got \"%s\"\n",
2580 ok(
ret ==
EINVAL,
"Expected _mbsupr_s to return EINVAL, got %d\n",
ret);
2583 memcpy(
buffer,
"abcdefgh\0ijklmnop",
sizeof(
"abcdefgh\0ijklmnop"));
2586 ok(
ret == 0,
"Expected _mbsupr_s to return 0, got %d\n",
ret);
2587 ok(!
memcmp(
buffer,
"ABCDEFGH\0ijklmnop",
sizeof(
"ABCDEFGH\0ijklmnop")),
2588 "Expected the output buffer to be \"ABCDEFGH\\0ijklmnop\", got \"%s\"\n",
2596 unsigned char buffer[20];
2600 win_skip(
"Skipping _mbslwr_s tests\n");
2606 ok(
ret == 0,
"Expected _mbslwr_s to return 0, got %d\n",
ret);
2610 ok(
ret ==
EINVAL,
"Expected _mbslwr_s to return EINVAL, got %d\n",
ret);
2615 ok(
ret ==
EINVAL,
"Expected _mbslwr_s to return EINVAL, got %d\n",
ret);
2620 ret = p_mbslwr_s(
buffer,
sizeof(
"ABCDEFGH"));
2621 ok(
ret == 0,
"Expected _mbslwr_s to return 0, got %d\n",
ret);
2623 "Expected the output buffer to be \"abcdefgh\", got \"%s\"\n",
2629 ok(
ret == 0,
"Expected _mbslwr_s to return 0, got %d\n",
ret);
2631 "Expected the output buffer to be \"abcdefgh\", got \"%s\"\n",
2637 ok(
ret ==
EINVAL,
"Expected _mbslwr_s to return EINVAL, got %d\n",
ret);
2640 memcpy(
buffer,
"ABCDEFGH\0IJKLMNOP",
sizeof(
"ABCDEFGH\0IJKLMNOP"));
2643 ok(
ret == 0,
"Expected _mbslwr_s to return 0, got %d\n",
ret);
2644 ok(!
memcmp(
buffer,
"abcdefgh\0IJKLMNOP",
sizeof(
"abcdefgh\0IJKLMNOP")),
2645 "Expected the output buffer to be \"abcdefgh\\0IJKLMNOP\", got \"%s\"\n",
2651 const unsigned char delim[] =
"t";
2653 char str[] =
"!.!test";
2661 "_mbstok(NULL, \"t\") = %p, expected NULL (%p)\n",
ret,
str);
2664 ok(!
ret,
"_mbstok(NULL, \"t\") = %p, expected NULL\n",
ret);
2674 win_skip(
"Skipping _ultoa_s tests\n");
2679 ret = p_ultoa_s(0,
NULL, 0, 0);
2680 ok(
ret ==
EINVAL,
"Expected _ultoa_s to return EINVAL, got %d\n",
ret);
2686 ok(
ret ==
EINVAL,
"Expected _ultoa_s to return EINVAL, got %d\n",
ret);
2688 ok(
buffer[0] ==
'X',
"Expected the output buffer to be untouched\n");
2693 ok(
ret ==
EINVAL,
"Expected _ultoa_s to return EINVAL, got %d\n",
ret);
2695 ok(
buffer[0] ==
'\0',
"Expected the output buffer to be null terminated\n");
2700 ok(
ret ==
EINVAL,
"Expected _ultoa_s to return EINVAL, got %d\n",
ret);
2702 ok(
buffer[0] ==
'\0',
"Expected the output buffer to be null terminated\n");
2706 ret = p_ultoa_s(12345678,
buffer, 4, 10);
2707 ok(
ret ==
ERANGE,
"Expected _ultoa_s to return ERANGE, got %d\n",
ret);
2710 "Expected the output buffer to be null terminated with truncated output\n");
2714 ret = p_ultoa_s(12345678,
buffer, 8, 10);
2715 ok(
ret ==
ERANGE,
"Expected _ultoa_s to return ERANGE, got %d\n",
ret);
2718 "Expected the output buffer to be null terminated with truncated output\n");
2720 ret = p_ultoa_s(12345678,
buffer, 9, 10);
2721 ok(
ret == 0,
"Expected _ultoa_s to return 0, got %d\n",
ret);
2723 "Expected output buffer string to be \"12345678\", got \"%s\"\n",
2727 ok(
ret == 0,
"Expected _ultoa_s to return 0, got %d\n",
ret);
2729 "Expected output buffer string to be \"1010101010101010\", got \"%s\"\n",
2733 ok(
ret == 0,
"Expected _ultoa_s to return 0, got %d\n",
ret);
2735 "Expected output buffer string to be \"nell\", got \"%s\"\n",
2739 ok(
ret == 0,
"Expected _ultoa_s to return 0, got %d\n",
ret);
2741 "Expected output buffer string to be \"hag\", got \"%s\"\n",
2750 win_skip(
"Skipping wctob tests\n");
2754 ret = p_wctob(0x8141);
2757 ret = p_wctob(0x81);
2760 ret = p_wctob(0xe0);
2761 ok(
ret == 0x61,
"ret = %x\n",
ret);
2764 ret = p_wctob(0x81);
2768 ret = p_wctob(0x8141);
2771 ret = p_wctob(0x81);
2772 ok(
ret == (
int)(
char)0x81,
"ret = %x\n",
ret);
2774 ret = p_wctob(0x9f);
2775 ok(
ret == (
int)(
char)0x9f,
"ret = %x\n",
ret);
2777 ret = p_wctob(0xe0);
2778 ok(
ret == (
int)(
char)0xe0,
"ret = %x\n",
ret);
2786 unsigned char dst[10];
2796 ok(
ret == 2,
"wcrtomb did not return 2\n");
2801 ok(
ret == 2,
"wcrtomb did not return 2\n");
2802 ok(
state == 0,
"state != 0\n");
2803 ok(
dst[0] == 0x82,
"dst[0] = %x, expected 0x82\n",
dst[0]);
2804 ok(
dst[1] == 0xa0,
"dst[1] = %x, expected 0xa0\n",
dst[1]);
2805 ok(
dst[2] ==
'a',
"dst[2] != 'a'\n");
2808 ok(
ret == 2,
"wcrtomb did not return 2\n");
2809 ok(
dst[0] == 0x82,
"dst[0] = %x, expected 0x82\n",
dst[0]);
2810 ok(
dst[1] == 0xa1,
"dst[1] = %x, expected 0xa1\n",
dst[1]);
2813 ok(
ret == 1,
"wcrtomb did not return 1\n");
2814 ok(
dst[0] == 0x20,
"dst[0] = %x, expected 0x20\n",
dst[0]);
2817 ok(
ret == -1,
"wcrtomb did not return -1\n");
2818 ok(
dst[0] == 0x3f,
"dst[0] = %x, expected 0x3f\n",
dst[0]);
2830 ok(
ret == 2,
"ret != 2\n");
2832 ok(
dst[0] == 0x82,
"dst[0] = %x, expected 0x82\n",
dst[0]);
2833 ok(
dst[1] == 0xa0,
"dst[1] = %x, expected 0xa0\n",
dst[1]);
2834 ok(
dst[2] ==
'a',
"dst[2] != 'a'\n");
2838 ok(
ret == 2,
"ret != 2\n");
2840 ok(
dst[0] == 0x82,
"dst[0] = %x, expected 0x82\n",
dst[0]);
2841 ok(
dst[1] == 0xa0,
"dst[1] = %x, expected 0xa0\n",
dst[1]);
2845 ok(
ret == 1,
"ret != 1\n");
2846 ok(
dst[0] == 0x20,
"dst[0] = %x, expected 0x20\n",
dst[0]);
2850 ok(
ret == 1,
"ret != 1\n");
2854 ok(
ret == -1,
"wcrtomb did not return -1\n");
2855 ok(
dst[0] == 0x3f,
"dst[0] = %x, expected 0x3f\n",
dst[0]);
2867 ret = p_tolower(0x41);
2868 ok(
ret == 0x61,
"ret = %x\n",
ret);
2870 ret = p_tolower(0xF4);
2871 ok(
ret == 0xF4,
"ret = %x\n",
ret);
2874 ret = p_tolower((
char)0xF4);
2875 ok(
ret == (
char)0xF4,
"ret = %x\n",
ret);
2879 ret = p_tolower((
char)0xD0);
2880 ok(
ret == (
char)0xD0,
"ret = %x\n",
ret);
2885 ret = p_tolower((
char)0xF4);
2886 ok(
ret == (
char)0xF4,
"ret = %x\n",
ret);
2891 win_skip(
"skipping tolower tests that depends on locale\n");
2898 ret = p_tolower(ch);
2907 if(!
len ||
ret==(
unsigned char)lch)
2912 ret = p_tolower(ch);
2921 if(!
len ||
ret==(
unsigned char)lch)
2924 ret = p_tolower(0xD0);
2925 ok(
ret == 0xD0,
"ret = %x\n",
ret);
2929 ret = p_tolower((
char)0xD0);
2930 ok(
ret == 0xF0,
"ret = %x\n",
ret);
2932 ret = p_tolower(0xD0);
2933 ok(
ret == 0xF0,
"ret = %x\n",
ret);
2947 win_skip(
"_atodbl_l is not available\n");
2953 ok(
ret == 0,
"_atodbl_l(&d, \"\", NULL) returned %d, expected 0\n",
ret);
2954 ok(
d.x == 0,
"d.x = %lf, expected 0\n",
d.x);
2956 ok(
ret == 0,
"_atodbl(&d, \"\") returned %d, expected 0\n",
ret);
2957 ok(
d.x == 0,
"d.x = %lf, expected 0\n",
d.x);
2961 ok(
ret == 0,
"_atodbl_l(&d, \"t\", NULL) returned %d, expected 0\n",
ret);
2962 ok(
d.x == 0,
"d.x = %lf, expected 0\n",
d.x);
2964 ok(
ret == 0,
"_atodbl(&d, \"t\") returned %d, expected 0\n",
ret);
2965 ok(
d.x == 0,
"d.x = %lf, expected 0\n",
d.x);
2969 ok(
ret == 0,
"_atodbl_l(&d, \"0\", NULL) returned %d, expected 0\n",
ret);
2970 ok(
d.x == 0,
"d.x = %lf, expected 0\n",
d.x);
2972 ok(
ret == 0,
"_atodbl(&d, \"0\") returned %d, expected 0\n",
ret);
2973 ok(
d.x == 0,
"d.x = %lf, expected 0\n",
d.x);
2977 ok(
ret == 0,
"_atodbl_l(&d, \"123\", NULL) returned %d, expected 0\n",
ret);
2978 ok(
d.x == 123,
"d.x = %lf, expected 123\n",
d.x);
2980 ok(
ret == 0,
"_atodbl(&d, \"123\") returned %d, expected 0\n",
ret);
2981 ok(
d.x == 123,
"d.x = %lf, expected 123\n",
d.x);
2985 ok(
ret ==
_UNDERFLOW,
"_atodbl_l(&d, \"1e-309\", NULL) returned %d, expected _UNDERFLOW\n",
ret);
2988 ok(
ret ==
_UNDERFLOW,
"_atodbl(&d, \"1e-309\") returned %d, expected _UNDERFLOW\n",
ret);
2993 ok(
ret ==
_OVERFLOW,
"_atodbl_l(&d, \"1e309\", NULL) returned %d, expected _OVERFLOW\n",
ret);
2995 ok(
ret ==
_OVERFLOW,
"_atodbl(&d, \"1e309\") returned %d, expected _OVERFLOW\n",
ret);
3003 ok(
ret == 0,
"_stricmp returned %d\n",
ret);
3005 ok(
ret < 0,
"_stricmp returned %d\n",
ret);
3007 ok(
ret > 0,
"_stricmp returned %d\n",
ret);
3009 ok(
ret < 0,
"_stricmp returned %d\n",
ret);
3017 ok(
ret == 0,
"_stricmp returned %d\n",
ret);
3019 ok(
ret < 0,
"_stricmp returned %d\n",
ret);
3021 ok(
ret > 0,
"_stricmp returned %d\n",
ret);
3023 ok(
ret == 0,
"_stricmp returned %d\n",
ret);
3025 ok(
ret < 0,
"_stricmp returned %d\n",
ret);
3032 static const WCHAR digit[] = {
'9', 0 };
3034 static const WCHAR stock[] = { 0x3231, 0 };
3035 static const WCHAR cjk_1[] = { 0x4e00, 0 };
3036 static const WCHAR tamil[] = { 0x0bef, 0 };
3037 static const WCHAR thai[] = { 0x0e59, 0 };
3038 static const WCHAR fullwidth[] = { 0xff19, 0 };
3039 static const WCHAR superscript1[] = { 0xb9, 0 };
3040 static const WCHAR minus_0x91[] = {
'-', 0x0e50,
'x', 0xff19,
'1', 0 };
3041 static const WCHAR plus_071[] = {
'+', 0x0e50, 0xff17,
'1', 0 };
3042 static const WCHAR hex[] = { 0xff19,
'f', 0x0e59, 0xff46, 0 };
3043 static const WCHAR zeros[] = {
3044 0x660, 0x6f0, 0x966, 0x9e6, 0xa66, 0xae6, 0xb66, 0xc66, 0xce6,
3045 0xd66, 0xe50, 0xed0, 0xf20, 0x1040, 0x17e0, 0x1810, 0xff10
3053 if (!p_wcstoi64 || !p_wcstoui64) {
3054 win_skip(
"_wcstoi64 or _wcstoui64 not found\n");
3058 res = p_wcstoi64(digit,
NULL, 10);
3059 ok(
res == 9,
"res != 9\n");
3060 res = p_wcstoi64(
space, &endpos, 0);
3061 ok(endpos ==
space,
"endpos != space\n");
3062 res = p_wcstoi64(stock, &endpos, 10);
3063 ok(
res == 0,
"res != 0\n");
3064 ok(endpos == stock,
"Incorrect endpos (%p-%p)\n", stock, endpos);
3065 res = p_wcstoi64(cjk_1,
NULL, 0);
3066 ok(
res == 0,
"res != 0\n");
3067 res = p_wcstoi64(tamil, &endpos, 10);
3068 ok(
res == 0,
"res != 0\n");
3069 ok(endpos == tamil,
"Incorrect endpos (%p-%p)\n", tamil, endpos);
3070 res = p_wcstoi64(thai,
NULL, 10);
3071 ok(
res == 9,
"res != 9\n");
3072 res = p_wcstoi64(fullwidth,
NULL, 10);
3073 ok(
res == 9,
"res != 9\n");
3074 res = p_wcstoi64(superscript1,
NULL, 10);
3075 ok(
res == 0,
"res != 0\n");
3077 ok(
res == 0x9f9,
"res != 0x9f9\n");
3078 res = p_wcstoi64(minus_0x91,
NULL, 0);
3079 ok(
res == -0x91,
"res != -0x91\n");
3080 res = p_wcstoi64(plus_071,
NULL, 0);
3081 ok(
res == 071,
"res != 071\n");
3083 ures = p_wcstoui64(digit,
NULL, 10);
3084 ok(ures == 9,
"ures != 9\n");
3085 ures = p_wcstoui64(
space, &endpos, 0);
3086 ok(endpos ==
space,
"endpos != space\n");
3087 ures = p_wcstoui64(stock, &endpos, 10);
3088 ok(ures == 0,
"ures != 0\n");
3089 ok(endpos == stock,
"Incorrect endpos (%p-%p)\n", stock, endpos);
3090 ures = p_wcstoui64(tamil, &endpos, 10);
3091 ok(ures == 0,
"ures != 0\n");
3092 ok(endpos == tamil,
"Incorrect endpos (%p-%p)\n", tamil, endpos);
3093 ures = p_wcstoui64(thai,
NULL, 10);
3094 ok(ures == 9,
"ures != 9\n");
3095 ures = p_wcstoui64(fullwidth,
NULL, 10);
3096 ok(ures == 9,
"ures != 9\n");
3097 ures = p_wcstoui64(superscript1,
NULL, 10);
3098 ok(ures == 0,
"ures != 0\n");
3099 ures = p_wcstoui64(
hex,
NULL, 16);
3100 ok(ures == 0x9f9,
"ures != 0x9f9\n");
3101 ures = p_wcstoui64(plus_071,
NULL, 0);
3102 ok(ures == 071,
"ures != 071\n");
3106 WCHAR tmp[] = {zeros[
i] + 4, zeros[
i], zeros[
i] + 5, 0};
3107 res = p_wcstoi64(tmp,
NULL, 0);
3108 ok(
res == 405,
"with zero = U+%04X: got %d, expected 405\n", zeros[
i], (
int)
res);
3109 tmp[1] = zeros[
i] + 10;
3110 res = p_wcstoi64(tmp,
NULL, 16);
3111 ok(
res == 4,
"with zero = U+%04X: got %d, expected 4\n", zeros[
i], (
int)
res);
3122 ok(
r == 0,
"atoi(0) = %d\n",
r);
3125 ok(
r == -1,
"atoi(-1) = %d\n",
r);
3128 ok(
r == 1,
"atoi(1) = %d\n",
r);
3130 r =
atoi(
"4294967296");
3131 ok(
r == 0,
"atoi(4294967296) = %d\n",
r);
3139 ok(
r == 0,
"atol(0) = %d\n",
r);
3142 ok(
r == -1,
"atol(-1) = %d\n",
r);
3145 ok(
r == 1,
"atol(1) = %d\n",
r);
3147 r =
atol(
"4294967296");
3148 ok(
r == 0,
"atol(4294967296) = %d\n",
r);
3183#define TEST_STRNCPY_LEN 10
3185 char *(
__cdecl *p_strncpy)(
char*,
const char*,
size_t);
3188 char not_null_terminated[] = {
'0',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0'};
3234 ok(
ret == 3,
"ret = %d\n", (
int)
ret);
3237 ok(
ret == 3,
"ret = %d\n", (
int)
ret);
3238 ok(
dest[0] ==
'a',
"dest[0] = %d\n",
dest[0]);
3242 ok(
ret == 3,
"ret = %d\n", (
int)
ret);
3248 ok(
ret == 3,
"ret = %d\n", (
int)
ret);
3249 ok(
dest[0] ==
's',
"dest[0] = %d\n",
dest[0]);
3250 ok(
dest[1] ==
'a',
"dest[1] = %d\n",
dest[1]);
3254 ok(
ret == 0,
"ret = %d\n", (
int)
ret);
3267 ok(
dest[0] ==
'a',
"dest[0] = %d\n",
dest[0]);
3271 ok(
dest[0],
"dest[0] = 0\n");
3288 win_skip(
"_strnset_s not available\n");
3292 r = p__strnset_s(
NULL, 0,
'a', 0);
3293 ok(
r == 0,
"r = %d\n",
r);
3296 r = p__strnset_s(
buf,
sizeof(
buf),
'a', 2);
3297 ok(
r == 0,
"r = %d\n",
r);
3300 r = p__strnset_s(
buf, 0,
'a', 0);
3303 r = p__strnset_s(
NULL, 0,
'a', 1);
3307 r = p__strnset_s(
buf,
sizeof(
buf)-1,
'c', 2);
3314 wchar_t text[] = {
't',
'e',
'x',
't',0 };
3318 win_skip(
"_wcsnset_s not available\n");
3322 r = p__wcsnset_s(
NULL, 0,
'a', 0);
3323 ok(
r == 0,
"r = %d\n",
r);
3325 r = p__wcsnset_s(
text, 0,
'a', 1);
3327 ok(
text[0] ==
't',
"text[0] = %d\n",
text[0]);
3329 r = p__wcsnset_s(
NULL, 2,
'a', 1);
3332 r = p__wcsnset_s(
text, 2,
'a', 3);
3335 ok(
text[1] ==
'e',
"text[1] = %d\n",
text[1]);
3338 r = p__wcsnset_s(
text, 5,
'a', 1);
3339 ok(
r == 0,
"r = %d\n",
r);
3340 ok(
text[0] ==
'a',
"text[0] = %d\n",
text[0]);
3341 ok(
text[1] ==
'e',
"text[1] = %d\n",
text[1]);
3344 r = p__wcsnset_s(
text, 5,
'b', 3);
3345 ok(
r == 0,
"r = %d\n",
r);
3346 ok(
text[0] ==
'b',
"text[0] = %d\n",
text[0]);
3348 ok(
text[2] ==
'x',
"text[2] = %d\n",
text[2]);
3357 win_skip(
"_wcsset_s not available\n");
3361 r = p__wcsset_s(
NULL, 0,
'a');
3365 r = p__wcsset_s(
str, 0,
'a');
3367 ok(
str[0] ==
'a',
"str[0] = %d\n",
str[0]);
3371 r = p__wcsset_s(
str, 2,
'c');
3373 ok(!
str[0],
"str[0] = %d\n",
str[0]);
3374 ok(
str[1] ==
'b',
"str[1] = %d\n",
str[1]);
3379 r = p__wcsset_s(
str, 3,
'c');
3380 ok(
r == 0,
"r = %d\n",
r);
3381 ok(
str[0] ==
'c',
"str[0] = %d\n",
str[0]);
3382 ok(
str[1] == 0,
"str[1] = %d\n",
str[1]);
3383 ok(
str[2] ==
'b',
"str[2] = %d\n",
str[2]);
3388 static const unsigned char a[] = {
'a',0},
b[] = {
'b',0};
3474 static const char *
s1 =
"abc";
3475 static const char *
s2 =
"aBd";
3509 static const char *
s1 =
"abc";
3510 static const char *
s2 =
"aBd";
3515 win_skip(
"_memicmp_l not found.\n");
3522 ok(
errno == 0xdeadbeef,
"errno is %d, expected 0xdeadbeef\n",
errno);
3542 ok(
errno == 0xdeadbeef,
"errno is %d, expected 0xdeadbeef\n",
errno);
3547 ok(
errno == 0xdeadbeef,
"errno is %d, expected 0xdeadbeef\n",
errno);
3552 const char str[] =
"123";
3558 ok(
mem !=
NULL,
"VirtualAlloc failed\n");
3564 ok(
p == str2,
"_strupr returned %p\n",
p);
3565 ok(!
strcmp(str2,
"ABC"),
"str2 = %s\n", str2);
3568 ok(
p ==
mem,
"_strupr returned %p\n",
p);
3573 win_skip(
"English locale _strupr tests\n");
3579 ok(
p == str2,
"_strupr returned %p\n",
p);
3580 ok(!
strcmp(str2,
"ABC"),
"str2 = %s\n", str2);
3585 ok(
p ==
mem,
"_strupr returned %p\n",
p);
3603 {
"English",
"ABCD",
"ABCD", 4, 0 },
3604 {
"English",
"ABCD",
"ABCD", 10, 0 },
3606 {
"English",
"ABC",
"ABCD", 3, 0 },
3607 {
"English",
"ABC",
"ABCD", 4, -1 },
3608 {
"English",
"ABC",
"ABCD", 10, -1 },
3610 {
"English",
"ABCD",
"ABC", 3, 0 },
3611 {
"English",
"ABCD",
"ABC", 4, 1 },
3612 {
"English",
"ABCD",
"ABC", 10, 1 },
3614 {
"English",
"ABCe",
"ABCf", 3, 0 },
3615 {
"English",
"abcd",
"ABCD", 10, -1 },
3617 {
"C",
"ABCD",
"ABCD", 4, 0 },
3618 {
"C",
"ABCD",
"ABCD", 10, 0 },
3620 {
"C",
"ABC",
"ABCD", 3, 0 },
3621 {
"C",
"ABC",
"ABCD", 10, -1 },
3623 {
"C",
"ABCD",
"ABC", 3, 0 },
3624 {
"C",
"ABCD",
"ABC", 10, 1 },
3626 {
"C",
"ABCe",
"ABCf", 3, 0 },
3627 {
"C",
"abcd",
"ABCD", 10, 1 },
3646 memset(str1, 0xee,
sizeof(str1));
3649 memset(str2, 0xff,
sizeof(str2));
3656 ok(
ret < 0,
"expected < 0, got %d for %s, %s, %d\n",
ret, str1, str2, (
int)
tests[
i].
count);
3658 ok(
ret > 0,
"expected > 0, got %d for %s, %s, %d\n",
ret, str1, str2, (
int)
tests[
i].
count);
3660 memset(str1W, 0xee,
sizeof(str1W));
3664 memset(str2W, 0xff,
sizeof(str2W));
3672 ok(
ret < 0,
"expected < 0, got %d for %s, %s, %d\n",
ret, str1, str2, (
int)
tests[
i].
count);
3674 ok(
ret > 0,
"expected > 0, got %d for %s, %s, %d\n",
ret, str1, str2, (
int)
tests[
i].
count);
3688 {
"English",
"abcd",
"ABCD", 4, 0 },
3689 {
"English",
"abcd",
"ABCD", 10, 0 },
3691 {
"English",
"abc",
"ABCD", 3, 0 },
3692 {
"English",
"abc",
"ABCD", 4, -1 },
3693 {
"English",
"abc",
"ABCD", 10, -1 },
3695 {
"English",
"abcd",
"ABC", 3, 0 },
3696 {
"English",
"abcd",
"ABC", 4, 1 },
3697 {
"English",
"abcd",
"ABC", 10, 1 },
3699 {
"English",
"abcE",
"ABCF", 3, 0 },
3701 {
"C",
"abcd",
"ABCD", 4, 0 },
3702 {
"C",
"abcd",
"ABCD", 10, 0 },
3704 {
"C",
"abc",
"ABCD", 3, 0 },
3705 {
"C",
"abc",
"ABCD", 10, -1 },
3707 {
"C",
"abcd",
"ABC", 3, 0 },
3708 {
"C",
"abcd",
"ABC", 10, 1 },
3710 {
"C",
"abce",
"ABCf", 3, 0 },
3729 memset(str1, 0xee,
sizeof(str1));
3732 memset(str2, 0xff,
sizeof(str2));
3739 ok(
ret < 0,
"expected < 0, got %d for %s, %s, %d\n",
ret, str1, str2, (
int)
tests[
i].
count);
3741 ok(
ret > 0,
"expected > 0, got %d for %s, %s, %d\n",
ret, str1, str2, (
int)
tests[
i].
count);
3743 memset(str1W, 0xee,
sizeof(str1W));
3747 memset(str2W, 0xff,
sizeof(str2W));
3755 ok(
ret < 0,
"expected < 0, got %d for %s, %s, %d\n",
ret, str1, str2, (
int)
tests[
i].
count);
3757 ok(
ret > 0,
"expected > 0, got %d for %s, %s, %d\n",
ret, str1, str2, (
int)
tests[
i].
count);
3782 win_skip(
"__strncnt() is not available.\n");
3791 ret = p___strncnt(strncnt_tests[
i].
str, strncnt_tests[
i].
size);
3792 ok(
ret == strncnt_tests[
i].
ret,
"%u: unexpected return value %u.\n",
i, (
int)
ret);
3801 static const char *locales[] = {
NULL,
"C" };
3805 for (
i = 0;
i <= 0xffff;
i++)
3807 ret = p_towlower(
i);
3808 if (
i >=
'A' &&
i <=
'Z')
3810 exp =
i +
'a' -
'A';
3814 ok(
ret ==
i,
"expected self %x, got %x for C locale\n",
i,
ret);
3816 ret = p_towupper(
i);
3817 if (
i >=
'a' &&
i <=
'z')
3819 exp =
i +
'A' -
'a';
3823 ok(
ret ==
i,
"expected self %x, got %x for C locale\n",
i,
ret);
3826 if (!p__towlower_l || !p__towupper_l || !p__create_locale)
3828 win_skip(
"_towlower_l/_towupper_l/_create_locale not available\n");
3835 for (
j = 0;
j <= 0xffff;
j++) {
3837 if (
j >=
'A' &&
j <=
'Z')
3839 exp =
j +
'a' -
'A';
3843 ok(
ret ==
j,
"expected self %x, got %x for C locale\n",
j,
ret);
3846 if (
j >=
'a' &&
j <=
'z')
3848 exp =
j +
'A' -
'a';
3852 ok(
ret ==
j,
"expected self %x, got %x for C locale\n",
j,
ret);
3862 static const char xilstring[]=
"c:/xilinx";
3868 ok(
hMsvcrt != 0,
"GetModuleHandleA failed\n");
3875 SET(p_strcpy,
"strcpy");
3933 "Got result %s\n",
mem+5);
ios_base &_STLP_CALL oct(ios_base &__s)
int strcmp(const char *String1, const char *String2)
UINT32 strtoul(const char *String, char **Terminator, UINT32 Base)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
ACPI_SIZE strlen(const char *String)
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
char * strcpy(char *DstString, const char *SrcString)
char * strtok(char *String, const char *Delimiters)
static const WCHAR empty[]
#define GetProcAddress(x, y)
#define WideCharToMultiByte
#define MultiByteToWideChar
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
BOOL WINAPI GetCPInfo(UINT codepage, LPCPINFO cpinfo)
INT WINAPI LCMapStringW(LCID lcid, DWORD flags, LPCWSTR src, INT srclen, LPWSTR dst, INT dstlen)
int _atodbl(void *value, char *str)
GLuint GLuint GLsizei count
GLdouble GLdouble GLdouble r
GLboolean GLboolean GLboolean b
GLenum GLuint GLenum GLsizei const GLchar * buf
GLboolean GLboolean GLboolean GLboolean a
GLubyte GLubyte GLubyte GLubyte w
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
#define MB_ERR_INVALID_CHARS
_Check_return_ _CRTIMP int __cdecl _ismbcl1(_In_ unsigned int _Ch)
_Check_return_ _CRTIMP int __cdecl _ismbckata(_In_ unsigned int _Ch)
_Check_return_ _CRTIMP int __cdecl _ismbcl2(_In_ unsigned int _Ch)
_Check_return_ _CRTIMP unsigned int __cdecl _mbcjmstojis(_In_ unsigned int _Ch)
_Check_return_ _CRTIMP int __cdecl _ismbcl0(_In_ unsigned int _Ch)
_CRTIMP unsigned char *__cdecl _mbsncpy(_Pre_notnull_ _Out_writes_(2 *_Count) _Post_maybez_ unsigned char *_Dest, _In_z_ const unsigned char *_Source, _In_ size_t _Count)
_Check_return_ _CRTIMP unsigned int __cdecl _mbcjistojms(_In_ unsigned int _Ch)
_Check_return_ _CRTIMP unsigned int __cdecl _mbsnextc(_In_z_ const unsigned char *_Str)
_Check_return_ _CRTIMP int __cdecl _ismbclegal(_In_ unsigned int _Ch)
_Check_return_ _CRTIMP size_t __cdecl _mbsspn(_In_z_ const unsigned char *_Str, _In_z_ const unsigned char *_Control)
_Check_return_ _CRTIMP unsigned int __cdecl _mbctombb(_In_ unsigned int _Ch)
_Check_return_ _CRTIMP unsigned char *__cdecl _mbsninc(_In_reads_bytes_(_Count) _Pre_z_ const unsigned char *_Str, _In_ size_t _Count)
_Check_return_ _CRTIMP int __cdecl _mbscmp(_In_z_ const unsigned char *_Str1, _In_z_ const unsigned char *_Str2)
_CRTIMP int __cdecl _mbsbtype(_In_reads_bytes_(_Pos) _Pre_z_ const unsigned char *_Str, _In_ size_t _Pos)
_Check_return_ _CRTIMP unsigned int __cdecl _mbbtombc(_In_ unsigned int _Ch)
_CRTIMP unsigned char *__cdecl _mbsnbcpy(_Out_writes_(_Count) _Post_maybez_ unsigned char *_Dest, _In_z_ const unsigned char *_Source, _In_ size_t _Count)
_Check_return_ _CRTIMP size_t __cdecl _mbslen(_In_z_ const unsigned char *_Str)
_Check_return_ _CRTIMP unsigned char *__cdecl _mbsinc(_In_z_ const unsigned char *_Ptr)
_Check_return_ _CRTIMP unsigned int __cdecl _mbctokata(_In_ unsigned int _Ch)
_Check_return_ _CRTIMP unsigned char *__cdecl _mbstok(_Inout_opt_z_ unsigned char *_Str, _In_z_ const unsigned char *_Delim)
_CRTIMP void __cdecl _mbccpy(_Out_writes_bytes_(2) unsigned char *_Dst, _In_z_ const unsigned char *_Src)
_Check_return_ _CRTIMP unsigned char *__cdecl _mbsspnp(_In_z_ const unsigned char *_Str1, _In_z_ const unsigned char *_Str2)
_Check_return_ _CRTIMP unsigned int __cdecl _mbctohira(_In_ unsigned int _Ch)
_Check_return_ _CRTIMP size_t __cdecl _mbclen(_In_z_ const unsigned char *_Str)
_CRTIMP char *__cdecl gcvt(_In_ double _Val, _In_ int _NumOfDigits, _Pre_notnull_ _Post_z_ char *_DstBuf)
_CRTIMP char *__cdecl _gcvt(_In_ double _Val, _In_ int _NumOfDigits, _Pre_notnull_ _Post_z_ char *_DstBuf)
_Check_return_ int __cdecl atoi(_In_z_ const char *_Str)
_CRTIMP char *__cdecl itoa(_In_ int _Val, _Pre_notnull_ _Post_z_ char *_DstBuf, _In_ int _Radix)
_Check_return_ long __cdecl atol(_In_z_ const char *_Str)
size_t __cdecl mbstowcs(_Out_writes_opt_z_(_MaxCount) wchar_t *_Dest, _In_z_ const char *_Source, _In_ size_t _MaxCount)
_Check_return_ _CRTIMP size_t __cdecl _mbstrlen(_In_z_ const char *_Str)
_CRTIMP void __cdecl _swab(_Inout_updates_(_SizeInBytes) _Post_readable_size_(_SizeInBytes) char *_Buf1, _Inout_updates_(_SizeInBytes) _Post_readable_size_(_SizeInBytes) char *_Buf2, int _SizeInBytes)
size_t __cdecl wcstombs(_Out_writes_opt_z_(_MaxCount) char *_Dest, _In_z_ const wchar_t *_Source, _In_ size_t _MaxCount)
_Check_return_ long __cdecl strtol(_In_z_ const char *_Str, _Out_opt_ _Deref_post_z_ char **_EndPtr, _In_ int _Radix)
_Check_return_ int __cdecl mblen(_In_reads_bytes_opt_(_MaxCount) _Pre_opt_z_ const char *_Ch, _In_ size_t _MaxCount)
_Check_return_ double __cdecl strtod(_In_z_ const char *_Str, _Out_opt_ _Deref_post_z_ char **_EndPtr)
_Check_return_ _CRTIMP int __cdecl _ismbbtrail(_In_ unsigned int _C)
_Check_return_ _CRTIMP int __cdecl _ismbslead(_In_reads_z_(_Pos - _Str+1) const unsigned char *_Str, _In_z_ const unsigned char *_Pos)
_CRTIMP int __cdecl _getmbcp(void)
#define memcpy(s1, s2, n)
static struct test_info tests[]
#define sprintf(buf, format,...)
static struct _PeImage bin
static const WCHAR expected2[]
static const WCHAR expected3[]
static const WCHAR expected1[]
int __cdecl _setmbcp(int)
int __cdecl _ismbblead(unsigned int)
int __cdecl _ismbstrail(const unsigned char *start, const unsigned char *str)
static void test_strxfrm(void)
static void test_strtok(void)
static void test__mbsupr_s(void)
static void test_strdup(void)
static void test_mbbtombc(void)
static void test__wcsnset_s(void)
static void test_C_locale(void)
static void test_ismbckata(void)
static void test_mbctokata(void)
static void test_mbcp(void)
static const unsigned char *static size_t const wchar_t * wcSrc
static char * buf_to_string(const unsigned char *bin, int len, int nr)
static void test_tolower(void)
static int result_cp_932_mbctype[]
static void test___strncnt(void)
static void test__strtod(void)
static void test_mbcjisjms(void)
#define expect_bin(buf, value, len)
static void test_memcpy_s(void)
static void test_wcscpy_s(void)
static void test__memicmp(void)
static void test__wcslwr_s(void)
static void test__mbsnbcat_s(void)
static void test__strtoi64(void)
static void test_mbctohira(void)
static void test__mbscmp(void)
static int result_cp_949_mbctype[]
static void test_strtol(void)
static void test_strcpy_s(void)
static void test_memmove_s(void)
static void test__wcsset_s(void)
static size_t numberOfElements
static void test_strcat_s(void)
static void test__mbscpy_s(void)
static void test_cp_table(int cp, int *result)
static void test_mbsspn(void)
static void test__wcsupr_s(void)
#define test_codepage(num)
static void test_strnlen(void)
static void test__tcsncoll(void)
static void test__itoa_s(void)
static void test_strncpy(void)
static void *__cdecl * pmemcpy(void *, const void *, size_t n)
static void test_atoi(void)
static void test__strnset_s(void)
static unsigned char * p_mbctype
static const char mbstate_t *static wchar_t const char mbstate_t *static const wchar_t int *static double
static void test__mbslwr_s(void)
#define expect_eq(expr, value, type, format)
static void test__mbscat_s(void)
static void test__wcstoi64(void)
static void test__stricmp(void)
static void test__memicmp_l(void)
static void test_gcvt(void)
static void test_mbctombb(void)
static void test__ismbclx(void)
static void test_wctomb(void)
static void test__mbsnbcpy_s(void)
static void test__atodbl(void)
static BOOL almost_equal(double d1, double d2)
static int * p__mb_cur_max
static void test__tcsnicoll(void)
static void test__ultoa_s(void)
static void test_atof(void)
static void test__mbstok(void)
static void test_wctob(void)
static void test__strupr(void)
static void test_mbcjmsjis(void)
static void test_atol(void)
static const struct @1685 testcases_strtok[]
#define okchars(dst, b0, b1, b2, b3, b4, b5, b6, b7)
static void test_swab(void)
static void test__strlwr_s(void)
static int result_cp_936_mbctype[]
static int *__cdecl * pmemcmp(void *, const void *, size_t n)
static int result_cp_950_mbctype[]
static void test_mbstowcs(void)
static void test_mbsspnp(void)
static void test_ismbclegal(void)
static void test_wcsncat_s(void)
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
_Check_return_ _CRTIMP int __cdecl _wcsnicoll(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2, _In_ size_t _MaxCount)
_Check_return_opt_ _CRTIMP size_t __cdecl strxfrm(_Out_writes_opt_(_MaxCount) _Post_maybez_ char *_Dst, _In_z_ const char *_Src, _In_ size_t _MaxCount)
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_Check_return_ _CRTIMP int __cdecl _strncoll(_In_z_ const char *_Str1, _In_z_ const char *_Str2, _In_ size_t _MaxCount)
_Check_return_ _CRTIMP int __cdecl _strnicoll(_In_z_ const char *_Str1, _In_z_ const char *_Str2, _In_ size_t _MaxCount)
_CRTIMP char *__cdecl _strupr(_Inout_z_ char *_String)
_Check_return_ _CRTIMP int __cdecl _wcsncoll(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2, _In_ size_t _MaxCount)
LPVOID NTAPI VirtualAlloc(IN LPVOID lpAddress, IN SIZE_T dwSize, IN DWORD flAllocationType, IN DWORD flProtect)
BOOL NTAPI VirtualProtect(IN LPVOID lpAddress, IN SIZE_T dwSize, IN DWORD flNewProtect, OUT PDWORD lpflOldProtect)
BOOL NTAPI VirtualFree(IN LPVOID lpAddress, IN SIZE_T dwSize, IN DWORD dwFreeType)