44 static char buf[2][1024];
56#define expect_eq(expr, value, type, format) { type ret = (expr); ok((value) == ret, #expr " expected " format " got " format "\n", value, ret); }
57#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)); }
63static int (
__cdecl *p_strcmp)(
const char *,
const char *);
73static int (
__cdecl *p__mbscpy_s)(
unsigned char*,
size_t,
const unsigned char*);
118static int (
__cdecl *p__mbccpy_s)(
unsigned char*,
size_t,
int*,
const unsigned char*);
129#define SETNOFAIL(x,y) x = (void*)GetProcAddress(hMsvcrt,y)
130#define SET(x,y) SETNOFAIL(x,y); ok(x != NULL, "Export '%s' not found\n", y)
135 char original[] =
"BADCFEHGJILKNMPORQTSVUXWZY@#";
136 char expected1[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZ@#";
137 char expected2[] =
"ABCDEFGHIJKLMNOPQRSTUVWX$";
138 char expected3[] =
"$";
146 memset(to,
'$',
sizeof(to));
151 ok(
memcmp(to,expected1,testsize) == 0,
"Testing even size %d returned '%*.*s'\n", testsize, testsize, testsize, to);
154 memset(to,
'$',
sizeof(to));
159 ok(
memcmp(to,expected2,testsize) == 0,
"Testing odd size %d returned '%*.*s'\n", testsize, testsize, testsize, to);
162 memset(to,
'$',
sizeof(to));
165 memcpy(to, original, testsize);
166 _swab( to, to, testsize );
167 ok(
memcmp(to,expected1,testsize) == 0,
"Testing overlapped size %d returned '%*.*s'\n", testsize, testsize, testsize, to);
170 memset(to,
'$',
sizeof(to));
175 ok(
memcmp(to,expected3,testsize) == 0,
"Testing small size %d returned '%*.*s'\n", testsize, testsize, testsize, to);
180 static const struct {
189 {
"a\xf1",
"\xf1", 1 }
196 ok(
r ==
tests[
i].
ret,
"strcspn(\"%s\", \"%s\") = %d, expected %d\n",
212 printf(
"static int result_cp_%d_mbctype[] = { ",
cp);
213 for (
i = 1;
i < 257;
i++)
230static int result_cp_932_mbctype[] = { 0x0,65, 0x8,1, 0x18,26, 0x8,6, 0x28,26, 0x8,4,
231 0x0,1, 0x8,1, 0xc,31, 0x8,1, 0xa,5, 0x9,58, 0xc,29, 0,3 };
232static int result_cp_936_mbctype[] = { 0x0,65, 0x8,1, 0x18,26, 0x8,6, 0x28,26, 0x8,6,
234static int result_cp_949_mbctype[] = { 0x0,66, 0x18,26, 0x8,6, 0x28,26, 0x8,6, 0xc,126,
236static int result_cp_950_mbctype[] = { 0x0,65, 0x8,1, 0x18,26, 0x8,6, 0x28,26, 0x8,4,
237 0x0,2, 0x4,32, 0xc,94, 0,1 };
245 for (
i = 0;
i < 256;
i++)
258#define test_codepage(num) test_cp_table(num, result_cp_##num##_mbctype);
266 unsigned char *mbstring = (
unsigned char *)
"\xb0\xb1\xb2 \xb3\xb4 \xb5";
267 unsigned char *mbstring2 = (
unsigned char *)
"\xb0\xb1\xb2\xb3Q\xb4\xb5";
268 unsigned char *mbsonlylead = (
unsigned char *)
"\xb0\0\xb1\xb2 \xb3";
269 unsigned char buf[16];
302 ok(
_ismbblead(0x1234b0),
"0x1234b0 should not be a lead byte\n");
382 expect_eq(p__mbsnlen(mbstring, 8), 8,
int,
"%d");
383 expect_eq(p__mbsnlen(mbstring, 9), 4,
int,
"%d");
384 expect_eq(p__mbsnlen(mbstring, 10), 4,
int,
"%d");
385 expect_eq(p__mbsnlen(mbsonlylead, 0), 0,
int,
"%d");
386 expect_eq(p__mbsnlen(mbsonlylead, 1), 1,
int,
"%d");
387 expect_eq(p__mbsnlen(mbsonlylead, 2), 0,
int,
"%d");
388 expect_eq(p__mbsnlen(mbstring2, 7), 7,
int,
"%d");
389 expect_eq(p__mbsnlen(mbstring2, 8), 4,
int,
"%d");
390 expect_eq(p__mbsnlen(mbstring2, 9), 4,
int,
"%d");
398 expect_eq(p_mbrlen((
const char*)mbstring, 2,
NULL), 2,
int,
"%d");
399 expect_eq(p_mbrlen((
const char*)&mbstring[2], 2,
NULL), 2,
int,
"%d");
400 expect_eq(p_mbrlen((
const char*)&mbstring[3], 2,
NULL), 1,
int,
"%d");
401 expect_eq(p_mbrlen((
const char*)mbstring, 1,
NULL), -2,
int,
"%d");
402 expect_eq(p_mbrlen((
const char*)mbstring, 1, &
state), -2,
int,
"%d");
403 ok(
state == mbstring[0],
"incorrect state value (%x)\n",
state);
404 expect_eq(p_mbrlen((
const char*)&mbstring[1], 1, &
state), 2,
int,
"%d");
414 ok(
dst == 0x6c28,
"dst = %x, expected 0x6c28\n",
dst);
416 ok(
dst == 0x3f,
"dst = %x, expected 0x3f\n",
dst);
418 ok(
dst == 0x20,
"dst = %x, expected 0x20\n",
dst);
420 ok(
dst == 0,
"dst = %x, expected 0\n",
dst);
422 ok(
dst == 0,
"dst = %x, expected 0\n",
dst);
423 ok(
state == mbstring[0],
"incorrect state value (%x)\n",
state);
425 ok(
dst == 0x6c28,
"dst = %x, expected 0x6c28\n",
dst);
442 err = p__mbccpy_s(
buf, 0, &copied, mbstring);
444 ok(!copied,
"copied = %d\n", copied);
445 ok(
buf[0] == 0xff,
"buf[0] = %x\n",
buf[0]);
449 err = p__mbccpy_s(
buf, 1, &copied, mbstring);
451 ok(!copied,
"copied = %d\n", copied);
452 ok(!
buf[0],
"buf[0] = %x\n",
buf[0]);
456 err = p__mbccpy_s(
buf, 2, &copied, mbstring);
457 ok(!
err,
"_mbccpy_s returned %d\n",
err);
458 ok(copied == 2,
"copied = %d\n", copied);
463 err = p__mbccpy_s(
buf, 2, &copied, (
unsigned char *)
"\xb0");
465 ok(copied == 1,
"copied = %d\n", copied);
472 ok(
ret ==
NULL,
"_mbsncpy returned %p, expected NULL\n",
ret);
478 ok(
ret ==
NULL,
"_mbsncpy returned %p, expected NULL\n",
ret);
485 ok(
ret ==
NULL,
"_mbsncpy returned %p, expected NULL\n",
ret);
486 ok(
errno == 0xdeadbeef,
"_mbsncpy should not change errno\n");
492 ok(
errno == 0xdeadbeef,
"_mbsncpy should not change errno\n");
498 ok(
ret ==
NULL,
"_mbsncpy returned %p, expected NULL\n",
ret);
504 ok(
ret ==
NULL,
"_mbsncpy returned %p, expected NULL\n",
ret);
551 step =
_mbsinc(mbstring) - mbstring;
552 ok(step == 2,
"_mbsinc adds %d (exp. 2)\n", step);
553 step =
_mbsinc(&mbstring[2]) - &mbstring[2];
554 ok(step == 2,
"_mbsinc adds %d (exp. 2)\n", step);
556 step =
_mbsninc(mbsonlylead, 1) - mbsonlylead;
557 ok(step == 0,
"_mbsninc adds %d (exp. 0)\n", step);
558 step =
_mbsninc(mbsonlylead, 2) - mbsonlylead;
559 ok(step == 0,
"_mbsninc adds %d (exp. 0)\n", step);
560 step =
_mbsninc(mbstring2, 0) - mbstring2;
561 ok(step == 0,
"_mbsninc adds %d (exp. 2)\n", step);
562 step =
_mbsninc(mbstring2, 1) - mbstring2;
563 ok(step == 2,
"_mbsninc adds %d (exp. 2)\n", step);
564 step =
_mbsninc(mbstring2, 2) - mbstring2;
565 ok(step == 4,
"_mbsninc adds %d (exp. 4)\n", step);
566 step =
_mbsninc(mbstring2, 3) - mbstring2;
567 ok(step == 5,
"_mbsninc adds %d (exp. 5)\n", step);
568 step =
_mbsninc(mbstring2, 4) - mbstring2;
569 ok(step == 7,
"_mbsninc adds %d (exp. 7)\n", step);
570 step =
_mbsninc(mbstring2, 5) - mbstring2;
571 ok(step == 7,
"_mbsninc adds %d (exp. 7)\n", step);
572 step =
_mbsninc(mbstring2, 17) - mbstring2;
573 ok(step == 7,
"_mbsninc adds %d (exp. 7)\n", step);
586 skip(
"Current locale has double-byte charset - could lead to false positives\n");
614 unsigned char str1[]=
"cabernet";
615 unsigned char str2[]=
"shiraz";
616 unsigned char set[]=
"abc";
617 unsigned char empty[]=
"";
618 unsigned char mbstr[]=
" 2019\x94\x4e" "6\x8c\x8e" "29\x93\xfa";
619 unsigned char mbset1[]=
"0123456789 \x94\x4e";
620 unsigned char mbset2[]=
" \x94\x4e\x8c\x8e";
621 unsigned char mbset3[]=
"\x8e";
625 ok(
ret==3,
"_mbsspn returns %d should be 3\n",
ret);
627 ok(
ret==0,
"_mbsspn returns %d should be 0\n",
ret);
629 ok(
ret==0,
"_mbsspn returns %d should be 0\n",
ret);
632 ok(
ret==0,
"_mbscspn returns %d should be 0\n",
ret);
634 ok(
ret==4,
"_mbscspn returns %d should be 4\n",
ret);
636 ok(
ret==8,
"_mbscspn returns %d should be 8\n",
ret);
640 ok(
ret==8,
"_mbsspn returns %d should be 8\n",
ret);
642 ok(
ret==1,
"_mbsspn returns %d should be 1\n",
ret);
644 ok(
ret==0,
"_mbsspn returns %d should be 0\n",
ret);
646 ok(
ret==2,
"_mbsspn returns %d should be 2\n",
ret);
648 ok(
ret==14,
"_mbsspn returns %d should be 14\n",
ret);
651 ok(
ret==0,
"_mbscspn returns %d should be 0\n",
ret);
653 ok(
ret==0,
"_mbscspn returns %d should be 0\n",
ret);
655 ok(
ret==2,
"_mbscspn returns %d should be 2\n",
ret);
657 ok(
ret==0,
"_mbscspn returns %d should be 0\n",
ret);
659 ok(
ret==0,
"_mbscspn returns %d should be 0\n",
ret);
666 unsigned char str1[]=
"cabernet";
667 unsigned char str2[]=
"shiraz";
668 unsigned char set[]=
"abc";
669 unsigned char empty[]=
"";
670 unsigned char full[]=
"abcenrt";
671 unsigned char mbstr[]=
" 2019\x94\x4e" "6\x8c\x8e" "29\x93\xfa";
672 unsigned char mbset1[]=
"0123456789 \x94\x4e";
673 unsigned char mbset2[]=
" \x94\x4e\x8c\x8e";
678 ok(
ret[0]==
'e',
"_mbsspnp returns %c should be e\n",
ret[0]);
680 ok(
ret[0]==
's',
"_mbsspnp returns %c should be s\n",
ret[0]);
682 ok(
ret[0]==
'c',
"_mbsspnp returns %c should be c\n",
ret[0]);
684 ok(
ret==
NULL,
"_mbsspnp returns %p should be NULL\n",
ret);
688 ok(
ret==mbstr+8,
"_mbsspnp returns %p should be %p\n",
ret, mbstr+8);
690 ok(
ret==mbstr+1,
"_mbsspnp returns %p should be %p\n",
ret, mbstr+1);
692 ok(
ret==mbstr+8,
"_mbsspnp returns %p should be %p\n",
ret, mbstr+8);
694 ok(
ret==mbstr+10,
"_mbsspnp returns %p should be %p\n",
ret, mbstr+10);
705 ok(
errno == 0xdeadbeef,
"errno is %d, expected 0xdeadbeef\n",
errno);
714 ok(
errno == 0xdeadbeef,
"errno is %d, expected 0xdeadbeef\n",
errno);
719 int ret = p_strcmp(
"abc",
"abcd" );
720 ok(
ret == -1,
"wrong ret %d\n",
ret );
721 ret = p_strcmp(
"",
"abc" );
722 ok(
ret == -1,
"wrong ret %d\n",
ret );
723 ret = p_strcmp(
"abc",
"ab\xa0" );
724 ok(
ret == -1,
"wrong ret %d\n",
ret );
725 ret = p_strcmp(
"ab\xb0",
"ab\xa0" );
726 ok(
ret == 1,
"wrong ret %d\n",
ret );
727 ret = p_strcmp(
"ab\xc2",
"ab\xc2" );
728 ok(
ret == 0,
"wrong ret %d\n",
ret );
730 ret = p_strncmp(
"abc",
"abcd", 3 );
731 ok(
ret == 0,
"wrong ret %d\n",
ret );
734 ret = p_strncmp(
"",
"abc", 3 );
735 ok(
ret == -1,
"wrong ret %d\n",
ret );
736 ret = p_strncmp(
"abc",
"ab\xa0", 4 );
737 ok(
ret == -1,
"wrong ret %d\n",
ret );
738 ret = p_strncmp(
"ab\xb0",
"ab\xa0", 3 );
739 ok(
ret == 1,
"wrong ret %d\n",
ret );
741 ret = p_strncmp(
"",
"abc", 3 );
742 ok(
ret == 0 -
'a',
"wrong ret %d\n",
ret );
743 ret = p_strncmp(
"abc",
"ab\xa0", 4 );
744 ok(
ret ==
'c' - 0xa0,
"wrong ret %d\n",
ret );
745 ret = p_strncmp(
"ab\xb0",
"ab\xa0", 3 );
746 ok(
ret == 0xb0 - 0xa0,
"wrong ret %d\n",
ret );
749 ret = p_strncmp(
"ab\xb0",
"ab\xa0", 2 );
750 ok(
ret == 0,
"wrong ret %d\n",
ret );
751 ret = p_strncmp(
"ab\xc2",
"ab\xc2", 3 );
752 ok(
ret == 0,
"wrong ret %d\n",
ret );
753 ret = p_strncmp(
"abc",
"abd", 0 );
754 ok(
ret == 0,
"wrong ret %d\n",
ret );
755 ret = p_strncmp(
"abc",
"abc", 12 );
756 ok(
ret == 0,
"wrong ret %d\n",
ret );
762 const char small[] =
"small";
763 const char big[] =
"atoolongstringforthislittledestination";
774 ok(
ret == 0,
"Copying a string into a big enough destination returned %d, expected 0\n",
ret);
777 "Unexpected return data from strcpy_s: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
782 ok(
ret ==
EINVAL,
"Copying into a destination of size 0 returned %d, expected EINVAL\n",
ret);
785 "Unexpected return data from strcpy_s: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
788 ok(
ret ==
EINVAL,
"Copying into a destination of size 0 returned %d, expected EINVAL\n",
ret);
791 "Unexpected return data from strcpy_s: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
796 ok(
ret ==
ERANGE,
"Copying a big string in a small location returned %d, expected ERANGE\n",
ret);
799 "Unexpected return data from strcpy_s: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
804 ok(
ret ==
EINVAL,
"Copying from a NULL source string returned %d, expected EINVAL\n",
ret);
807 "Unexpected return data from strcpy_s: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
811 ok(
ret ==
EINVAL,
"Copying a big string a NULL dest returned %d, expected EINVAL\n",
ret);
819 "Unexpected return data from strcpy: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
834 ok(
dest[0] == 0,
"dest[0] not 0\n");
838 ok(
ret == 0,
"expected ERROR_SUCCESS got %d\n",
ret);
839 ok(
dest[0] == 0,
"dest[0] not 0\n");
847 ok(
ret == 0,
"expected 0 got %d\n",
ret);
853 ok(
dest[0] == 0,
"dest[0] not 0\n");
856 ret = p_strncpy_s(
dest, 5, big, -1);
858 ok(
dest[4] == 0,
"dest[4] not 0\n");
861 ret = p_strncpy_s(
NULL, 0, (
void*)0xdeadbeef, 0);
872#define okchars(dst, b0, b1, b2, b3, b4, b5, b6, b7) \
873 ok(dst[0] == b0 && dst[1] == b1 && dst[2] == b2 && dst[3] == b3 && \
874 dst[4] == b4 && dst[5] == b5 && dst[6] == b6 && dst[7] == b7, \
875 "Bad result: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",\
876 dst[0], dst[1], dst[2], dst[3], dst[4], dst[5], dst[6], dst[7])
881 static const char tiny[] = {
'T',0,
'I',
'N',
'Y',0};
882 static const char big[] = {
'a',
't',
'o',
'o',
'l',
'o',
'n',
'g',
's',
't',
'r',
'i',
'n',
'g',0};
892 ok(
ret == 0,
"Copying a buffer into a big enough destination returned %d, expected 0\n",
ret);
893 okchars(
dest, tiny[0], tiny[1], tiny[2], tiny[3], tiny[4], tiny[5],
'X',
'X');
899 ok(
ret ==
ERANGE,
"Copying a big buffer to a small destination returned %d, expected ERANGE\n",
ret);
907 ok(
ret ==
EINVAL,
"Copying a NULL source buffer returned %d, expected EINVAL\n",
ret);
915 ok(
ret ==
ERANGE,
"Copying into a destination of size 0 returned %d, expected ERANGE\n",
ret);
917 okchars(
dest,
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X');
922 ok(
ret ==
EINVAL,
"Copying a tiny buffer to a big NULL destination returned %d, expected EINVAL\n",
ret);
929 ok(
ret ==
EINVAL,
"Copying a NULL buffer into a destination of size 0 returned %d, expected EINVAL\n",
ret);
931 okchars(
dest,
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X');
934 ok(!
ret,
"memcpy_s returned %d\n",
ret);
935 ok(!
memcmp(
buf, big,
sizeof(big)),
"unexpected buf\n");
938 ok(!
ret,
"memcpy_s returned %d\n",
ret);
939 ok(!
memcmp(
buf + 1, big,
sizeof(big)),
"unexpected buf\n");
942 ok(!
ret,
"memcpy_s returned %d\n",
ret);
943 ok(!
memcmp(
buf, big,
sizeof(big)),
"unexpected buf\n");
949 static const char tiny[] = {
'T',0,
'I',
'N',
'Y',0};
950 static const char big[] = {
'a',
't',
'o',
'o',
'l',
'o',
'n',
'g',
's',
't',
'r',
'i',
'n',
'g',0};
960 ok(
ret == 0,
"Moving a buffer into a big enough destination returned %d, expected 0\n",
ret);
961 okchars(
dest, tiny[0], tiny[1], tiny[2], tiny[3], tiny[4], tiny[5],
'X',
'X');
966 ok(
ret == 0,
"Moving a buffer up one char returned %d, expected 0\n",
ret);
967 okchars(
dest, big[0], big[0], big[1], big[2], big[3], big[4], big[5], big[6]);
973 ok(
ret ==
ERANGE,
"Moving a big buffer to a small destination returned %d, expected ERANGE\n",
ret);
975 okchars(
dest,
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X');
981 ok(
ret ==
EINVAL,
"Moving a NULL source buffer returned %d, expected EINVAL\n",
ret);
983 okchars(
dest,
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X');
989 ok(
ret ==
ERANGE,
"Moving into a destination of size 0 returned %d, expected ERANGE\n",
ret);
991 okchars(
dest,
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X');
996 ok(
ret ==
EINVAL,
"Moving a tiny buffer to a big NULL destination returned %d, expected EINVAL\n",
ret);
1003 ok(
ret ==
EINVAL,
"Moving a NULL buffer into a destination of size 0 returned %d, expected EINVAL\n",
ret);
1005 okchars(
dest,
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X');
1011 const char *
small =
"sma";
1023 ok(
ret == 0,
"strcat_s: Copying a string into a big enough destination returned %d, expected 0\n",
ret);
1026 "Unexpected return data from strcpy_s: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
1029 ok(
ret == 0,
"strcat_s: Attaching a string to a big enough destination returned %d, expected 0\n",
ret);
1032 "Unexpected return data from strcpy_s: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
1036 ok(
ret ==
ERANGE,
"strcat_s: Attaching a string to a filled up destination returned %d, expected ERANGE\n",
ret);
1039 "Unexpected return data from strcpy_s: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
1047 ok(
ret ==
EINVAL,
"strcat_s: Source len = 0 returned %d, expected EINVAL\n",
ret);
1050 "Unexpected return data from strcpy_s: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
1054 ok(
ret ==
EINVAL,
"strcat_s: len = 0 and src = NULL returned %d, expected EINVAL\n",
ret);
1057 "Unexpected return data from strcpy_s: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
1061 ok(
ret ==
EINVAL,
"strcat_s: Sourcing from NULL returned %d, expected EINVAL\n",
ret);
1064 "Unexpected return data from strcpy_s: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
1068 ok(
ret ==
EINVAL,
"strcat_s: Writing to a NULL string returned %d, expected EINVAL\n",
ret);
1073 unsigned char dst[8],
src[4];
1101 ok(
err == 0,
"_mbscat_s returned %d\n",
err);
1106 ok(!
dst[0],
"dst[0] = %c\n",
dst[0]);
1107 ok(
dst[1] ==
'a',
"dst[1] = %c\n",
dst[1]);
1118 ok(
err == 0,
"_mbscat_s returned %d\n",
err);
1127 ok(
err == 0,
"_mbscat_s returned %d\n",
err);
1153 unsigned char dest[8];
1154 const unsigned char big[] =
"atoolongstringforthislittledestination";
1155 const unsigned char small[] =
"small";
1160 win_skip(
"_mbsnbcpy_s not found\n");
1166 ok(
ret == 0,
"_mbsnbcpy_s: Copying a string into a big enough destination returned %d, expected 0\n",
ret);
1169 "Unexpected return data from _mbsnbcpy_s: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
1175 ok(
ret ==
ERANGE,
"_mbsnbcpy_s: Copying a too long string returned %d, expected ERANGE\n",
ret);
1178 "Unexpected return data from _mbsnbcpy_s: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
1182 ret = p_mbsnbcpy_s(
dest,
sizeof(
dest) - 2, big, 4);
1183 ok(
ret == 0,
"_mbsnbcpy_s: Copying a too long string with a count cap returned %d, expected 0\n",
ret);
1186 "Unexpected return data from _mbsnbcpy_s: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
1191 ok(
ret == 0,
"_mbsnbcpy_s: Copying more data than the source string len returned %d, expected 0\n",
ret);
1194 "Unexpected return data from _mbsnbcpy_s: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
1200 const unsigned char src[] =
"source string";
1201 unsigned char dest[16];
1219 ok(!
dest[0],
"dest buffer was not modified on invalid argument\n");
1225 ok(
dest[
sizeof(
src)] ==
'X',
"unused part of buffer was modified\n");
1230 ok(!
dest[0],
"incorrect dest buffer (%d)\n",
dest[0]);
1231 ok(
dest[1] ==
src[1],
"incorrect dest buffer (%d)\n",
dest[1]);
1236 static const WCHAR szLongText[] =
L"ThisALongstring";
1237 static WCHAR szDest[18];
1238 static WCHAR szDestShort[8];
1249 ret = p_wcscpy_s(
NULL, 18, szLongText);
1256 ret = p_wcscpy_s(szDest, 18,
NULL);
1259 ok(szDest[0] == 0,
"szDest[0] not 0, got %c\n", szDest[0]);
1264 ret = p_wcscpy_s(szDest, 0, szLongText);
1270 ok(szDest[0] == 0 ||
ret ==
EINVAL,
"szDest[0] not 0\n");
1273 ret = p_wcscpy_s(szDest, 18, szLongText);
1274 ok(
ret == 0,
"expected 0 got %d\n",
ret);
1275 ok(
lstrcmpW(szDest, szLongText) == 0,
"szDest != szLongText\n");
1278 ret = p_wcscpy_s(szDest, 18, szDest);
1279 ok(
ret == 0,
"expected 0 got %d\n",
ret);
1280 ok(
lstrcmpW(szDest, szLongText) == 0,
"szDest != szLongText\n");
1285 ret = p_wcscpy_s(szDestShort, 8, szLongText);
1288 ok(szDestShort[0] == 0,
"szDestShort[0] not 0\n");
1300 ret = p_wcsncpy_s(szDest, 18,
NULL, 1);
1302 ok(szDest[0] == 0,
"szDest[0] not 0\n");
1305 ret = p_wcsncpy_s(szDest, 18,
NULL, 0);
1306 ok(
ret == 0,
"expected ERROR_SUCCESS got %d\n",
ret);
1307 ok(szDest[0] == 0,
"szDest[0] not 0\n");
1310 ret = p_wcsncpy_s(szDest, 0, szLongText,
ARRAY_SIZE(szLongText));
1312 ok(szDest[0] == 0 ||
ret ==
EINVAL,
"szDest[0] not 0\n");
1314 ret = p_wcsncpy_s(szDest, 18, szLongText,
ARRAY_SIZE(szLongText));
1315 ok(
ret == 0,
"expected 0 got %d\n",
ret);
1316 ok(
lstrcmpW(szDest, szLongText) == 0,
"szDest != szLongText\n");
1319 ret = p_wcsncpy_s(szDestShort, 8, szLongText,
ARRAY_SIZE(szLongText));
1321 ok(szDestShort[0] == 0,
"szDestShort[0] not 0\n");
1324 ret = p_wcsncpy_s(szDest, 5, szLongText, -1);
1326 ok(szDest[4] == 0,
"szDest[4] not 0\n");
1329 ret = p_wcsncpy_s(
NULL, 0, (
void*)0xdeadbeef, 0);
1332 szDestShort[0] =
'1';
1334 ret = p_wcsncpy_s(szDestShort+1, 4, szDestShort, -1);
1336 ok(szDestShort[0]==
'1' && szDestShort[1]==
'1' && szDestShort[2]==
'1' && szDestShort[3]==
'1',
1342 static const WCHAR mixedString[] =
L"MiXeDlowerUPPER";
1343 static const WCHAR expectedString[] =
L"MIXEDLOWERUPPER";
1356 ok(
ret ==
EINVAL,
"Expected _wcsupr_s to fail with EINVAL, got %d\n",
ret);
1362 ok(
ret ==
EINVAL,
"Expected _wcsupr_s to fail with EINVAL, got %d\n",
ret);
1367 testBuffer[0] =
'\0';
1368 ret = p_wcsupr_s(testBuffer, 0);
1369 ok(
ret ==
EINVAL,
"Expected _wcsupr_s to fail with EINVAL, got %d\n",
ret);
1371 ok(testBuffer[0] ==
'\0',
"Expected the buffer to be unchanged\n");
1374 testBuffer[0] =
'\0';
1375 ret = p_wcsupr_s(testBuffer, 1);
1376 ok(
ret == 0,
"Expected _wcsupr_s to succeed, got %d\n",
ret);
1377 ok(testBuffer[0] ==
'\0',
"Expected the buffer to be unchanged\n");
1381 testBuffer[0] =
'x';
1382 ret = p_wcsupr_s(testBuffer, 0);
1383 ok(
ret ==
EINVAL,
"Expected _wcsupr_s to fail with EINVAL, got %d\n",
ret);
1385 ok(testBuffer[0] ==
'\0',
"Expected the first buffer character to be null\n");
1389 testBuffer[0] =
'x';
1390 ret = p_wcsupr_s(testBuffer, 1);
1391 ok(
ret ==
EINVAL,
"Expected _wcsupr_s to fail with EINVAL, got %d\n",
ret);
1393 ok(testBuffer[0] ==
'\0',
"Expected the first buffer character to be null\n");
1396 wcscpy(testBuffer, mixedString);
1398 ret = p_wcsupr_s(testBuffer, 0);
1399 ok(
ret ==
EINVAL,
"Expected _wcsupr_s to fail with EINVAL, got %d\n",
ret);
1401 ok(testBuffer[0] ==
'\0',
"Expected the first buffer character to be null\n");
1404 wcscpy(testBuffer, mixedString);
1406 ok(
ret == 0,
"Expected _wcsupr_s to succeed, got %d\n",
ret);
1407 ok(!
wcscmp(testBuffer, expectedString),
"Expected the string to be fully upper-case\n");
1410 wcscpy(testBuffer, mixedString);
1413 ok(
ret ==
EINVAL,
"Expected _wcsupr_s to fail with EINVAL, got %d\n",
ret);
1415 ok(testBuffer[0] ==
'\0',
"Expected the first buffer character to be null\n");
1418 wcscpy(testBuffer, mixedString);
1420 ok(
ret == 0,
"Expected _wcsupr_s to succeed, got %d\n",
ret);
1421 ok(!
wcscmp(testBuffer, expectedString),
"Expected the string to be fully upper-case\n");
1426 static const WCHAR mixedString[] =
L"MiXeDlowerUPPER";
1427 static const WCHAR expectedString[] =
L"mixedlowerupper";
1455 ok(
buffer[0] == 0,
"expected empty string\n");
1461 ok(
buffer[0] == 0,
"expected buffer to be unchanged\n");
1469 ok(
buffer[0] ==
'\0',
"expected empty string\n");
1477 ok(
buffer[0] ==
'\0',
"expected empty string\n");
1485 ok(
buffer[0] ==
'\0',
"expected empty string\n");
1490 ok(
ret == 0,
"expected 0, got %d\n",
ret);
1499 ok(
buffer[0] ==
'\0',
"expected empty string\n");
1504 ok(
ret == 0,
"expected 0, got %d\n",
ret);
1511 unsigned int jisjms[][2] = { {0x2020, 0}, {0x2021, 0}, {0x2120, 0}, {0x2121, 0x8140},
1512 {0x7f7f, 0}, {0x7f7e, 0}, {0x7e7f, 0}, {0x7e7e, 0xeffc},
1513 {0x255f, 0x837e}, {0x2560, 0x8380}, {0x2561, 0x8381},
1514 {0x2121FFFF, 0}, {0x2223, 0x81a1}, {0x237e, 0x829e}, {0, 0}};
1522 for (
j = 0; jisjms[
j][0] != 0;
j++)
1526 exp = (
cp[
i] == 932) ? jisjms[
j][1] : jisjms[
j][0];
1527 ok(
ret ==
exp,
"Expected 0x%x, got 0x%x (0x%x, codepage=%d)\n",
1537 unsigned int jmsjis[][2] = { {0x80fc, 0}, {0x813f, 0}, {0x8140, 0x2121},
1538 {0x817e, 0x215f}, {0x817f, 0}, {0x8180, 0x2160},
1539 {0x819e, 0x217e}, {0x819f, 0x2221}, {0x81fc, 0x227e},
1540 {0x81fd, 0}, {0x9ffc, 0x5e7e}, {0x9ffd, 0},
1541 {0xa040, 0}, {0xdffc, 0}, {0xe040, 0x5f21},
1542 {0xeffc, 0x7e7e}, {0xf040, 0}, {0x21, 0}, {0, 0}};
1550 for (
j = 0; jmsjis[
j][0] != 0;
j++)
1554 exp = (
cp[
i] == 932) ? jmsjis[
j][1] : jmsjis[
j][0];
1555 ok(
ret ==
exp,
"Expected 0x%x, got 0x%x (0x%x, codepage=%d)\n",
1564 static const unsigned int mbchira_932[][2] = {
1565 {0x8152, 0x8152}, {0x8153, 0x8153}, {0x8154, 0x8154}, {0x8155, 0x8155},
1566 {0x82a0, 0x82a0}, {0x833f, 0x833f}, {0x8340, 0x829f}, {0x837e, 0x82dd},
1567 {0x837f, 0x837f}, {0x8380, 0x82de}, {0x8393, 0x82f1}, {0x8394, 0x8394},
1568 {0x8396, 0x8396}, {0x8397, 0x8397},
1569 {0xa5, 0xa5}, {0xb0, 0xb0}, {0xdd, 0xdd} };
1576 int ret,
exp = mbchira_932[
i][0];
1586 exp = mbchira_932[
i][1];
1594 static const unsigned int mbckata_932[][2] = {
1595 {0x8152, 0x8152}, {0x8153, 0x8153}, {0x8154, 0x8154}, {0x8155, 0x8155},
1596 {0x833f, 0x833f}, {0x829f, 0x8340}, {0x82dd, 0x837e}, {0x837f, 0x837f},
1597 {0x82de, 0x8380}, {0x8394, 0x8394}, {0x8397, 0x8397},
1598 {0xa5, 0xa5}, {0xb0, 0xb0}, {0xdd, 0xdd} };
1605 int ret,
exp = mbckata_932[
i][0];
1615 exp = mbckata_932[
i][1];
1623 static const unsigned int mbbmbc[][2] = {
1624 {0x1f, 0x1f}, {0x20, 0x8140}, {0x39, 0x8258}, {0x40, 0x8197},
1625 {0x41, 0x8260}, {0x5e, 0x814f}, {0x7e, 0x8150}, {0x7f, 0x7f},
1626 {0x80, 0x80}, {0x81, 0x81}, {0xa0, 0xa0}, {0xa7, 0x8340},
1627 {0xb0, 0x815b}, {0xd1, 0x8380}, {0xff, 0xff}, {0,0}};
1635 for (
j = 0; mbbmbc[
j][0] != 0;
j++)
1639 exp = (
cp[
i] == 932) ? mbbmbc[
j][1] : mbbmbc[
j][0];
1640 ok(
ret ==
exp,
"Expected 0x%x, got 0x%x (0x%x, codepage %d)\n",
1649 static const unsigned int mbcmbb_932[][2] = {
1650 {0x829e, 0x829e}, {0x829f, 0xa7}, {0x82f1, 0xdd}, {0x82f2, 0x82f2},
1651 {0x833f, 0x833f}, {0x8340, 0xa7}, {0x837e, 0xd0}, {0x837f, 0x837f},
1652 {0x8380, 0xd1}, {0x8396, 0xb9}, {0x8397, 0x8397}, {0x813f, 0x813f},
1653 {0x8140, 0x20}, {0x814c, 0x814c}, {0x814f, 0x5e}, {0x8197, 0x40},
1654 {0x8198, 0x8198}, {0x8258, 0x39}, {0x8259, 0x8259}, {0x825f, 0x825f},
1655 {0x8260, 0x41}, {0x82f1, 0xdd}, {0x82f2, 0x82f2}, {0,0}};
1660 for (
i = 0; mbcmbb_932[
i][0] != 0;
i++)
1663 exp = mbcmbb_932[
i][1];
1670 struct katakana_pair {
1674 static const struct katakana_pair
tests[] = {
1707 for(
i = 0;
i < 0x10000;
i++) {
1718 ok(!
err,
"_ismbclegal (932) : Expected 0x%x, got 0x%x (0x%x)\n",
exp,
ret,
i);
1721 for(
i = 0;
i < 0x10000;
i++) {
1730 ok(!
err,
"_ismbclegal (936) : Expected 0x%x, got 0x%x (0x%x)\n",
exp,
ret,
i);
1733 for(
i = 0;
i < 0x10000;
i++) {
1742 ok(!
err,
"_ismbclegal (949) : Expected 0x%x, got 0x%x (0x%x)\n",
exp,
ret,
i);
1745 for(
i = 0;
i < 0x10000;
i++) {
1755 ok(!
err,
"_ismbclegal (950) : Expected 0x%x, got 0x%x (0x%x)\n",
exp,
ret,
i);
1758 for(
i = 0;
i < 0x10000;
i++) {
1775static const struct {
1785 {
"red cabernet",
" ", 0, 4, -1 },
1786 {
"sparkling white riesling",
" ", 0, 10, 16 },
1787 {
" pale cream sherry",
"e ", 1, 6, 9 },
1802 "string (%p) \'%s\' return %p\n",
1804 if( !strret)
continue;
1808 "second call string (%p) \'%s\' return %p\n",
1810 if( !strret)
continue;
1814 "third call string (%p) \'%s\' return %p\n",
1818 strcpy( teststr,
"test a=b" );
1819 strret =
strtok( teststr,
" " );
1820 ok( strret == teststr,
"strret = %p, expected %p\n", strret, teststr );
1822 ok( !strret,
"strret = %p, expected NULL\n", strret );
1824 ok( !strret,
"strret = %p, expected NULL\n", strret );
1829 static char neg[] =
"-0x";
1839 ok(
l==-1234,
"wrong value %ld\n",
l);
1843 ok(ul==1234,
"wrong value %lu\n", ul);
1848 ok(
l==2147483647,
"wrong value %ld\n",
l);
1852 ok(
l==-2147483647L - 1,
"wrong value %ld\n",
l);
1855 ul =
strtoul(
"4294967295UL", &
e, 0);
1856 ok(ul==4294967295ul,
"wrong value %lu\n", ul);
1860 l =
strtol(
"9223372036854775807L", &
e, 0);
1861 ok(
l==2147483647,
"wrong value %ld\n",
l);
1864 ul =
strtoul(
"9223372036854775807L", &
e, 0);
1865 ok(ul==4294967295ul,
"wrong value %lu\n", ul);
1870 ok(ul == -2,
"wrong value %lu\n", ul);
1875 ok(ul == 2,
"wrong value %lu\n", ul);
1880 ok(ul==1,
"wrong value %lu\n", ul);
1885 ok(ul == 1,
"wrong value %lu\n", ul);
1890 ok(
l == 0,
"wrong value %ld\n",
l);
1892 ok(
e == neg,
"e = %p, neg = %p\n",
e, neg);
1897 static const char str[] =
"string";
1905 res = p_strnlen(
str, 20);
1906 ok(
res == 6,
"Returned length = %d\n", (
int)
res);
1909 ok(
res == 3,
"Returned length = %d\n", (
int)
res);
1912 ok(
res == 0,
"Returned length = %d\n", (
int)
res);
1917 static const char no1[] =
"31923";
1918 static const char no2[] =
"-213312";
1919 static const char no3[] =
"12aa";
1920 static const char no4[] =
"abc12";
1921 static const char overflow[] =
"99999999999999999999";
1922 static const char neg_overflow[] =
"-99999999999999999999";
1923 static const char hex[] =
"0x123";
1924 static const char oct[] =
"000123";
1925 static const char blanks[] =
" 12 212.31";
1931 if(!p_strtoi64 || !p_strtoui64) {
1932 win_skip(
"_strtoi64 or _strtoui64 not found\n");
1937 res = p_strtoi64(no1,
NULL, 10);
1938 ok(
res == 31923,
"res != 31923\n");
1939 res = p_strtoi64(no2,
NULL, 10);
1940 ok(
res == -213312,
"res != -213312\n");
1941 res = p_strtoi64(no3,
NULL, 10);
1942 ok(
res == 12,
"res != 12\n");
1943 res = p_strtoi64(no4, &endpos, 10);
1944 ok(
res == 0,
"res != 0\n");
1945 ok(endpos == no4,
"Scanning was not stopped on first character\n");
1946 res = p_strtoi64(
hex, &endpos, 10);
1947 ok(
res == 0,
"res != 0\n");
1948 ok(endpos ==
hex+1,
"Incorrect endpos (%p-%p)\n",
hex, endpos);
1949 res = p_strtoi64(
oct, &endpos, 10);
1950 ok(
res == 123,
"res != 123\n");
1952 res = p_strtoi64(blanks, &endpos, 10);
1953 ok(
res == 12,
"res != 12\n");
1954 ok(endpos == blanks+10,
"Incorrect endpos (%p-%p)\n", blanks, endpos);
1958 res = p_strtoi64(overflow, &endpos, 10);
1960 ok(endpos == overflow+
strlen(overflow),
"Incorrect endpos (%p-%p)\n", overflow, endpos);
1964 res = p_strtoi64(neg_overflow, &endpos, 10);
1966 ok(endpos == neg_overflow+
strlen(neg_overflow),
"Incorrect endpos (%p-%p)\n", neg_overflow, endpos);
1970 res = p_strtoi64(no1, &endpos, 16);
1971 ok(
res == 203043,
"res != 203043\n");
1972 ok(endpos == no1+
strlen(no1),
"Incorrect endpos (%p-%p)\n", no1, endpos);
1973 res = p_strtoi64(no2, &endpos, 16);
1974 ok(
res == -2175762,
"res != -2175762\n");
1975 ok(endpos == no2+
strlen(no2),
"Incorrect endpos (%p-%p)\n", no2, endpos);
1976 res = p_strtoi64(no3, &endpos, 16);
1977 ok(
res == 4778,
"res != 4778\n");
1978 ok(endpos == no3+
strlen(no3),
"Incorrect endpos (%p-%p)\n", no3, endpos);
1979 res = p_strtoi64(no4, &endpos, 16);
1980 ok(
res == 703506,
"res != 703506\n");
1981 ok(endpos == no4+
strlen(no4),
"Incorrect endpos (%p-%p)\n", no4, endpos);
1982 res = p_strtoi64(
hex, &endpos, 16);
1983 ok(
res == 291,
"res != 291\n");
1985 res = p_strtoi64(
oct, &endpos, 16);
1986 ok(
res == 291,
"res != 291\n");
1988 res = p_strtoi64(blanks, &endpos, 16);
1989 ok(
res == 18,
"res != 18\n");
1990 ok(endpos == blanks+10,
"Incorrect endpos (%p-%p)\n", blanks, endpos);
1994 res = p_strtoi64(
hex, &endpos, 36);
1995 ok(
res == 1541019,
"res != 1541019\n");
2000 res = p_strtoi64(no1, &endpos, 0);
2001 ok(
res == 31923,
"res != 31923\n");
2002 ok(endpos == no1+
strlen(no1),
"Incorrect endpos (%p-%p)\n", no1, endpos);
2003 res = p_strtoi64(no2, &endpos, 0);
2004 ok(
res == -213312,
"res != -213312\n");
2005 ok(endpos == no2+
strlen(no2),
"Incorrect endpos (%p-%p)\n", no2, endpos);
2006 res = p_strtoi64(no3, &endpos, 10);
2007 ok(
res == 12,
"res != 12\n");
2008 ok(endpos == no3+2,
"Incorrect endpos (%p-%p)\n", no3, endpos);
2009 res = p_strtoi64(no4, &endpos, 10);
2010 ok(
res == 0,
"res != 0\n");
2011 ok(endpos == no4,
"Incorrect endpos (%p-%p)\n", no4, endpos);
2012 res = p_strtoi64(
hex, &endpos, 10);
2013 ok(
res == 0,
"res != 0\n");
2014 ok(endpos ==
hex+1,
"Incorrect endpos (%p-%p)\n",
hex, endpos);
2015 res = p_strtoi64(
oct, &endpos, 10);
2016 ok(
res == 123,
"res != 123\n");
2018 res = p_strtoi64(blanks, &endpos, 10);
2019 ok(
res == 12,
"res != 12\n");
2020 ok(endpos == blanks+10,
"Incorrect endpos (%p-%p)\n", blanks, endpos);
2024 ures = p_strtoui64(no1, &endpos, 0);
2025 ok(ures == 31923,
"ures != 31923\n");
2026 ok(endpos == no1+
strlen(no1),
"Incorrect endpos (%p-%p)\n", no1, endpos);
2027 ures = p_strtoui64(no2, &endpos, 0);
2028 ok(ures == -213312,
"ures != -213312\n");
2029 ok(endpos == no2+
strlen(no2),
"Incorrect endpos (%p-%p)\n", no2, endpos);
2030 ures = p_strtoui64(no3, &endpos, 10);
2031 ok(ures == 12,
"ures != 12\n");
2032 ok(endpos == no3+2,
"Incorrect endpos (%p-%p)\n", no3, endpos);
2033 ures = p_strtoui64(no4, &endpos, 10);
2034 ok(ures == 0,
"ures != 0\n");
2035 ok(endpos == no4,
"Incorrect endpos (%p-%p)\n", no4, endpos);
2036 ures = p_strtoui64(
hex, &endpos, 10);
2037 ok(ures == 0,
"ures != 0\n");
2038 ok(endpos ==
hex+1,
"Incorrect endpos (%p-%p)\n",
hex, endpos);
2039 ures = p_strtoui64(
oct, &endpos, 10);
2040 ok(ures == 123,
"ures != 123\n");
2042 ures = p_strtoui64(blanks, &endpos, 10);
2043 ok(ures == 12,
"ures != 12\n");
2044 ok(endpos == blanks+10,
"Incorrect endpos (%p-%p)\n", blanks, endpos);
2048 ures = p_strtoui64(overflow, &endpos, 10);
2050 ok(endpos == overflow+
strlen(overflow),
"Incorrect endpos (%p-%p)\n", overflow, endpos);
2054 ures = p_strtoui64(neg_overflow, &endpos, 10);
2055 ok(ures == 1,
"ures != 1\n");
2056 ok(endpos == neg_overflow+
strlen(neg_overflow),
"Incorrect endpos (%p-%p)\n", neg_overflow, endpos);
2079 static const struct {
2085 {
"12.1", 4, 12.1 },
2086 {
"-13.721", 7, -13.721 },
2088 {
".21e12", 6, 210000000000.0 },
2089 {
"214353e-3", 9, 214.353 },
2091 {
"12.1d2", 6, 12.1e2 },
2094 {
"-0.1", 4, -0.1 },
2095 {
"0.1281832188491894198128921", 27, 0.1281832188491894198128921 },
2096 {
"0.82181281288121", 16, 0.82181281288121 },
2097 {
"21921922352523587651128218821", 29, 21921922352523587651128218821.0 },
2098 {
"0.1d238", 7, 0.1e238 },
2099 {
"0.1D-4736", 9, 0,
ERANGE },
2100 {
"3.4028234663852887e38", 21,
FLT_MAX },
2101 {
"1.1754943508222875e-38", 22,
FLT_MIN },
2102 {
"1.7976931348623158e+308", 23,
DBL_MAX },
2104 {
"2.2250738585072014e-308", 23,
DBL_MIN },
2105 {
"-1.7976931348623158e+308", 24, -
DBL_MAX },
2113 const char overflow[] =
"1d9999999999999999999";
2122 if ((
i == 19) && IsReactOS())
2124 skip(
"Skipping i == 19, because it crashes on ReactOS\n");
2134 "%d) errno = %d\n",
i,
errno);
2143 ok(
d == 0.0,
"d = %.16e\n",
d);
2147 end = (
char *)0xdeadbeef;
2149 ok(
d == 0.0,
"d = %.16e\n",
d);
2151 ok(!
end,
"incorrect end ptr %p\n",
end);
2155 ok(
d == 0.0,
"d = %.16e\n",
d);
2161 win_skip(
"system with limited locales\n");
2166 ok(
d == 12.0,
"d = %.16e\n",
d);
2169 ok(
d == 12.1,
"d = %.16e\n",
d);
2176 ok(
end == overflow+21,
"incorrect end (%d)\n", (
int)(
end-overflow));
2185 static const wchar_t wSimple[] =
L"text";
2186 static const wchar_t wHiragana[] =
L"\x3042\x3043";
2187 static const char mSimple[] =
"text";
2188 static const char mHiragana[] = { 0x82,0xa0,0x82,0xa1,0 };
2190 const wchar_t *pwstr;
2198 wOut[4] =
'!'; wOut[5] =
'\0';
2199 mOut[4] =
'!'; mOut[5] =
'\0';
2205 ok(
ret == -1,
"mbstowcs did not return -1\n");
2210 ok(
ret == 4,
"mbstowcs did not return 4\n");
2213 ok(
ret == 4,
"mbstowcs did not return 4\n");
2215 ok(wOut[4] ==
'!',
"wOut[4] != \'!\'\n");
2218 ok(
ret == 0,
"mbstowcs did not return 0, got %d\n", (
int)
ret);
2221 ok(
ret == 0,
"mbstowcs did not return 0, got %d\n", (
int)
ret);
2225 ok(
ret == 4,
"wcstombs did not return 4\n");
2228 ok(
ret == 4,
"wcstombs did not return 4\n");
2229 ok(!
memcmp(mOut, mSimple, 5*
sizeof(
char)),
"mOut = %s\n", mOut);
2232 ok(
ret == 2,
"wcstombs did not return 2\n");
2233 ok(!
memcmp(mOut, mSimple, 5*
sizeof(
char)),
"mOut = %s\n", mOut);
2236 ok(
ret == 0,
"wcstombs did not return 0, got %d\n", (
int)
ret);
2239 ok(
ret == 0,
"wcstombs did not return 0, got %d\n", (
int)
ret);
2240 ok(!mOut[0],
"mOut = %s\n", mOut);
2245 ret = pwcsrtombs(mOut, &pwstr, 4, &
err);
2246 ok(
ret == 4,
"wcsrtombs did not return 4\n");
2248 ok(pwstr == wSimple+4,
"pwstr = %p (wszSimple = %p)\n", pwstr, wSimple);
2249 ok(!
memcmp(mOut, mSimple,
ret),
"mOut = %s\n", mOut);
2252 ret = pwcsrtombs(mOut, &pwstr, 5,
NULL);
2253 ok(
ret == 4,
"wcsrtombs did not return 4\n");
2254 ok(pwstr ==
NULL,
"pwstr != NULL\n");
2255 ok(!
memcmp(mOut, mSimple,
sizeof(mSimple)),
"mOut = %s\n", mOut);
2259 win_skip(
"Japanese_Japan.932 locale not available\n");
2264 ok(
ret == 2,
"mbstowcs did not return 2\n");
2268 ok(
ret == 0,
"mbstowcs did not return 0, got %d\n", (
int)
ret);
2273 ok(
ret == -1,
"mbstowcs did not return -1\n");
2277 ok(
ret == 4,
"wcstombs did not return 4\n");
2278 ok(!
memcmp(mOut, mHiragana,
sizeof(mHiragana)),
"mOut = %s\n", mOut);
2281 ok(
ret == 0,
"wcstombs did not return 0, got %d\n", (
int)
ret);
2282 ok(!mOut[0],
"mOut = %s\n", mOut);
2284 if(!pmbstowcs_s || !pwcstombs_s) {
2286 win_skip(
"mbstowcs_s or wcstombs_s not available\n");
2292 ok(
ret == 1,
"mbstowcs_s did not return 0\n");
2293 ok(!wOut[0],
"wOut[0] = %d\n", wOut[0]);
2297 ok(
ret == 5,
"mbstowcs_s did not return 5\n");
2302 ok(
ret == 3,
"mbstowcs_s did not return 3\n");
2307 ok(
ret == 1,
"mbstowcs_s did not return 1, got %d\n", (
int)
ret);
2310 err = pmbstowcs_s(&
ret,
NULL, 0, mHiragana, 1);
2312 ok(
ret == 3,
"mbstowcs_s did not return 3\n");
2316 ok(
ret == 5,
"wcstombs_s did not return 5\n");
2317 ok(!
memcmp(mOut, mSimple,
sizeof(mSimple)),
"mOut = %s\n", mOut);
2321 ok(
ret == 5,
"wcstombs_s did not return 5\n");
2322 ok(!
memcmp(mOut, mHiragana,
sizeof(mHiragana)),
"mOut = %s\n", mOut);
2326 ok(
ret == 1,
"wcstombs_s did not return 1, got %d\n", (
int)
ret);
2327 ok(!mOut[0],
"mOut = %s\n", mOut);
2329 err = pwcstombs_s(&
ret,
NULL, 0, wHiragana, 1);
2331 ok(
ret == 5,
"wcstombs_s did not return 5\n");
2335 win_skip(
"wcsrtombs not available\n");
2341 ret = pwcsrtombs(mOut, &pwstr, 4, &
err);
2342 ok(
ret == 4,
"wcsrtombs did not return 4\n");
2344 ok(pwstr == wSimple+4,
"pwstr = %p (wszSimple = %p)\n", pwstr, wSimple);
2345 ok(!
memcmp(mOut, mSimple,
ret),
"mOut = %s\n", mOut);
2348 ret = pwcsrtombs(mOut, &pwstr, 5,
NULL);
2349 ok(
ret == 4,
"wcsrtombs did not return 4\n");
2350 ok(pwstr ==
NULL,
"pwstr != NULL\n");
2351 ok(!
memcmp(mOut, mSimple,
sizeof(mSimple)),
"mOut = %s\n", mOut);
2355 win_skip(
"mbsrtowcs not available\n");
2361 ok(
ret == 2,
"mbsrtowcs did not return 2\n");
2362 ok(pmbstr == mHiragana,
"pmbstr = %p, expected %p\n", pmbstr, mHiragana);
2365 ret = p_mbsrtowcs(wOut, &pmbstr, 6,
NULL);
2366 ok(
ret == 2,
"mbsrtowcs did not return 2\n");
2368 ok(!pmbstr,
"pmbstr != NULL\n");
2370 state = mHiragana[0];
2371 pmbstr = mHiragana+1;
2372 ret = p_mbsrtowcs(wOut, &pmbstr, 6, &
state);
2373 ok(
ret == 2,
"mbsrtowcs did not return 2\n");
2374 ok(wOut[0] == 0x3042,
"wOut[0] = %x\n", wOut[0]);
2375 ok(wOut[1] == 0xff61,
"wOut[1] = %x\n", wOut[1]);
2376 ok(wOut[2] == 0,
"wOut[2] = %x\n", wOut[2]);
2377 ok(!pmbstr,
"pmbstr != NULL\n");
2381 ok(
ret == -1,
"mbsrtowcs did not return -1\n");
2384 if(!p_mbsrtowcs_s) {
2386 win_skip(
"mbsrtowcs_s not available\n");
2392 ok(
ret == -1,
"mbsrtowcs_s did not return -1\n");
2395 ok(
ret == -1,
"mbsrtowcs_s did not return -1\n");
2397 err = p_mbsrtowcs_s(&
ret, wOut, 0, &pmbstr, 6,
NULL);
2398 ok(
ret == -1,
"mbsrtowcs_s did not return -1\n");
2404 ok(
ret == 3,
"mbsrtowcs_s did not return 3\n");
2406 ok(pmbstr == mHiragana,
"pmbstr = %p, expected %p\n", pmbstr, mHiragana);
2410 err = p_mbsrtowcs_s(&
ret, wOut, 1, &pmbstr, 6,
NULL);
2411 ok(
ret == 2,
"mbsrtowcs_s did not return 2\n");
2413 ok(!wOut[0],
"wOut[0] = '%c'\n", wOut[0]);
2414 ok(pmbstr == mHiragana+2,
"pmbstr = %p, expected %p\n", pmbstr, mHiragana+2);
2418 err = p_mbsrtowcs_s(&
ret, wOut, 2, &pmbstr, 6,
NULL);
2419 ok(
ret == 3,
"mbsrtowcs_s did not return 3\n");
2421 ok(!wOut[0],
"wOut[0] = '%c'\n", wOut[0]);
2422 ok(pmbstr == mHiragana+4,
"pmbstr = %p, expected %p\n", pmbstr, mHiragana+4);
2426 err = p_mbsrtowcs_s(&
ret, wOut, 3, &pmbstr, 6,
NULL);
2427 ok(
ret == 3,
"mbsrtowcs_s did not return 3\n");
2429 ok(!pmbstr,
"pmbstr != NULL\n");
2438 const wchar_t *wstr;
2455 {
L"", 0,
NULL, 0, 1, 0,
"English_United States.1252" },
2456 {
L"\xfffd", 1,
NULL, 0, 0,
EILSEQ,
"English_United States.1252" },
2457 {
L"\xfffd", 1,
"", 1, 0,
EILSEQ,
"English_United States.1252" },
2458 {
L"\xfffd", 1,
"", 6, 0,
EILSEQ,
"English_United States.1252" },
2459 {
L"text",
_TRUNCATE,
"text", 5, 5, 0,
"English_United States.1252" },
2461 {
L"text", 5,
"", 3, 0,
ERANGE,
"English_United States.1252" },
2469 if(!p__create_locale) {
2470 win_skip(
"_create_locale not available\n");
2494 "%d: expected out %s, got %s for '%s' in locale %s\n",
i,
tests[
i].
str,
out,
2507 win_skip(
"Skipping _gcvt tests\n");
2526 err = p_gcvt_s(
buf, 5, 1.2, 10);
2528 ok(
buf[0] ==
'\0',
"buf[0] = %c\n",
buf[0]);
2531 err = p_gcvt_s(
buf, 4, 123456, 2);
2533 ok(
buf[0] ==
'\0',
"buf[0] = %c\n",
buf[0]);
2543 win_skip(
"Skipping _itoa_s tests\n");
2548 ret = p_itoa_s(0,
NULL, 0, 0);
2549 ok(
ret ==
EINVAL,
"Expected _itoa_s to return EINVAL, got %d\n",
ret);
2555 ok(
ret ==
EINVAL,
"Expected _itoa_s to return EINVAL, got %d\n",
ret);
2557 ok(
buffer[0] ==
'X',
"Expected the output buffer to be untouched\n");
2562 ok(
ret ==
EINVAL,
"Expected _itoa_s to return EINVAL, got %d\n",
ret);
2564 ok(
buffer[0] ==
'\0',
"Expected the output buffer to be null terminated\n");
2569 ok(
ret ==
EINVAL,
"Expected _itoa_s to return EINVAL, got %d\n",
ret);
2571 ok(
buffer[0] ==
'\0',
"Expected the output buffer to be null terminated\n");
2575 ret = p_itoa_s(12345678,
buffer, 4, 10);
2576 ok(
ret ==
ERANGE,
"Expected _itoa_s to return ERANGE, got %d\n",
ret);
2579 "Expected the output buffer to be null terminated with truncated output\n");
2583 ret = p_itoa_s(12345678,
buffer, 8, 10);
2584 ok(
ret ==
ERANGE,
"Expected _itoa_s to return ERANGE, got %d\n",
ret);
2587 "Expected the output buffer to be null terminated with truncated output\n");
2591 ret = p_itoa_s(-12345678,
buffer, 9, 10);
2592 ok(
ret ==
ERANGE,
"Expected _itoa_s to return ERANGE, got %d\n",
ret);
2595 "Expected the output buffer to be null terminated with truncated output\n");
2597 ret = p_itoa_s(12345678,
buffer, 9, 10);
2598 ok(
ret == 0,
"Expected _itoa_s to return 0, got %d\n",
ret);
2600 "Expected output buffer string to be \"12345678\", got \"%s\"\n",
2604 ok(
ret == 0,
"Expected _itoa_s to return 0, got %d\n",
ret);
2606 "Expected output buffer string to be \"1010101010101010\", got \"%s\"\n",
2610 ok(
ret == 0,
"Expected _itoa_s to return 0, got %d\n",
ret);
2612 "Expected output buffer string to be \"nell\", got \"%s\"\n",
2616 ok(
ret == 0,
"Expected _itoa_s to return 0, got %d\n",
ret);
2618 "Expected output buffer string to be \"hag\", got \"%s\"\n",
2622 ok(
ret == 0,
"Expected _itoa_s to return 0, got %d\n",
ret);
2624 "Expected output buffer string to be \"-12345678\", got \"%s\"\n",
2629 "Expected output buffer string to be \"10\", got \"%s\"\n",
buffer);
2639 win_skip(
"Skipping _strlwr_s tests\n");
2645 ok(
ret ==
EINVAL,
"Expected _strlwr_s to return EINVAL, got %d\n",
ret);
2650 ok(
ret ==
EINVAL,
"Expected _strlwr_s to return EINVAL, got %d\n",
ret);
2655 ok(
ret ==
EINVAL,
"Expected _strlwr_s to return EINVAL, got %d\n",
ret);
2661 ok(
ret ==
EINVAL,
"Expected _strlwr_s to return EINVAL, got %d\n",
ret);
2664 "Expected the output buffer to be \"\\0oRrIsTeR\"\n");
2668 ret = p_strlwr_s(
buffer,
sizeof(
"GoRrIsTeR") - 1);
2669 ok(
ret ==
EINVAL,
"Expected _strlwr_s to return EINVAL, got %d\n",
ret);
2672 "Expected the output buffer to be \"\\0oRrIsTeR\"\n");
2675 ret = p_strlwr_s(
buffer,
sizeof(
"GoRrIsTeR"));
2676 ok(
ret == 0,
"Expected _strlwr_s to return 0, got %d\n",
ret);
2678 "Expected the output buffer to be \"gorrister\", got \"%s\"\n",
2681 memcpy(
buffer,
"GoRrIsTeR\0ELLEN",
sizeof(
"GoRrIsTeR\0ELLEN"));
2683 ok(
ret == 0,
"Expected _strlwr_s to return 0, got %d\n",
ret);
2684 ok(!
memcmp(
buffer,
"gorrister\0ELLEN",
sizeof(
"gorrister\0ELLEN")),
2685 "Expected the output buffer to be \"gorrister\\0ELLEN\", got \"%s\"\n",
2688 ret = p_strlwr_s((
char *)
"already_lowercase",
sizeof(
"already_lowercase"));
2689 ok(
ret == 0,
"Expected _strlwr_s to return 0, got %d\n",
ret);
2700 win_skip(
"skipping wcsncat_s tests\n");
2710 ok(
dst[0] ==
'a',
"dst %x\n",
dst[0]);
2721 ok(
dst[0] ==
'a',
"dst %x\n",
dst[0]);
2747 win_skip(
"skipping wcsncat_s tests\n");
2757 ok(
dst[0] ==
'a',
"dst %x\n",
dst[0]);
2760 ok(
dst[0] ==
'a',
"dst %x\n",
dst[0]);
2769 ok(
dst[0] ==
'a',
"dst %x\n",
dst[0]);
2789 unsigned char dest[16];
2790 const unsigned char first[] =
"dinosaur";
2791 const unsigned char second[] =
"duck";
2796 win_skip(
"Skipping _mbsnbcat_s tests\n");
2802 ok(
ret == 0,
"Expected _mbsnbcat_s to return 0, got %d\n",
ret);
2806 ok(
ret ==
EINVAL,
"Expected _mbsnbcat_s to return EINVAL, got %d\n",
ret);
2811 ok(
ret ==
EINVAL,
"Expected _mbsnbcat_s to return EINVAL, got %d\n",
ret);
2817 ok(
ret ==
EINVAL,
"Expected _mbsnbcat_s to return EINVAL, got %d\n",
ret);
2819 ok(
dest[0] ==
'X',
"Expected the output buffer to be untouched\n");
2823 ret = p_mbsnbcat_s(
dest, 0, second, 0);
2824 ok(
ret ==
EINVAL,
"Expected _mbsnbcat_s to return EINVAL, got %d\n",
ret);
2826 ok(
dest[0] ==
'X',
"Expected the output buffer to be untouched\n");
2831 ok(
ret ==
EINVAL,
"Expected _mbsnbcat_s to return EINVAL, got %d\n",
ret);
2833 ok(
dest[0] ==
'\0',
"Expected the output buffer to be null terminated\n");
2838 ok(
ret ==
EINVAL,
"Expected _mbsnbcat_s to return EINVAL, got %d\n",
ret);
2840 ok(
dest[0] ==
'\0',
"Expected the output buffer to be null terminated\n");
2844 ret = p_mbsnbcat_s(
dest,
sizeof(
dest), second,
sizeof(second));
2845 ok(
ret == 0,
"Expected _mbsnbcat_s to return 0, got %d\n",
ret);
2847 "Expected the output buffer string to be \"duck\"\n");
2852 ret = p_mbsnbcat_s(
dest,
sizeof(
dest), second, 0);
2853 ok(
ret == 0,
"Expected _mbsnbcat_s to return 0, got %d\n",
ret);
2855 "Expected the output buffer string to be \"dinosaur\"\n");
2859 ret = p_mbsnbcat_s(
dest,
sizeof(
dest), second,
sizeof(second));
2860 ok(
ret == 0,
"Expected _mbsnbcat_s to return 0, got %d\n",
ret);
2861 ok(!
memcmp(
dest,
"dinosaurduck",
sizeof(
"dinosaurduck")),
2862 "Expected the output buffer string to be \"dinosaurduck\"\n");
2866 ret = p_mbsnbcat_s(
dest,
sizeof(
dest), second,
sizeof(second) + 1);
2867 ok(
ret == 0,
"Expected _mbsnbcat_s to return 0, got %d\n",
ret);
2868 ok(!
memcmp(
dest,
"dinosaurduck",
sizeof(
"dinosaurduck")),
2869 "Expected the output buffer string to be \"dinosaurduck\"\n");
2873 ret = p_mbsnbcat_s(
dest,
sizeof(
dest), second,
sizeof(second) - 1);
2874 ok(
ret == 0,
"Expected _mbsnbcat_s to return 0, got %d\n",
ret);
2875 ok(!
memcmp(
dest,
"dinosaurduck",
sizeof(
"dinosaurduck")),
2876 "Expected the output buffer string to be \"dinosaurduck\"\n");
2880 ret = p_mbsnbcat_s(
dest,
sizeof(
dest), second,
sizeof(second) - 2);
2881 ok(
ret == 0,
"Expected _mbsnbcat_s to return 0, got %d\n",
ret);
2882 ok(!
memcmp(
dest,
"dinosaurduc",
sizeof(
"dinosaurduc")),
2883 "Expected the output buffer string to be \"dinosaurduc\"\n");
2889 ret = p_mbsnbcat_s(
dest,
sizeof(
first) - 1, second,
sizeof(second));
2890 ok(
ret ==
EINVAL,
"Expected _mbsnbcat_s to return EINVAL, got %d\n",
ret);
2892 ok(!
memcmp(
dest,
"\0inosaur",
sizeof(
"\0inosaur") - 1),
2893 "Expected the output buffer string to be \"\\0inosaur\" without ending null terminator\n");
2898 ret = p_mbsnbcat_s(
dest,
sizeof(
first), second,
sizeof(second));
2899 ok(
ret ==
ERANGE,
"Expected _mbsnbcat_s to return ERANGE, got %d\n",
ret);
2901 ok(!
memcmp(
dest,
"\0inosaurd",
sizeof(
"\0inosaurd") - 1),
2902 "Expected the output buffer string to be \"\\0inosaurd\" without ending null terminator\n");
2907 ret = p_mbsnbcat_s(
dest,
sizeof(
first) + 1, second,
sizeof(second));
2908 ok(
ret ==
ERANGE,
"Expected _mbsnbcat_s to return ERANGE, got %d\n",
ret);
2910 ok(!
memcmp(
dest,
"\0inosaurdu",
sizeof(
"\0inosaurdu") - 1),
2911 "Expected the output buffer string to be \"\\0inosaurdu\" without ending null terminator\n");
2917 unsigned char buffer[20];
2922 win_skip(
"Skipping _mbsupr_s tests\n");
2928 ok(
ret == 0,
"Expected _mbsupr_s to return 0, got %d\n",
ret);
2932 ok(
ret ==
EINVAL,
"Expected _mbsupr_s to return EINVAL, got %d\n",
ret);
2937 ok(
ret ==
EINVAL,
"Expected _mbsupr_s to return EINVAL, got %d\n",
ret);
2942 ret = p_mbsupr_s(
buffer,
sizeof(
"abcdefgh"));
2943 ok(
ret == 0,
"Expected _mbsupr_s to return 0, got %d\n",
ret);
2945 "Expected the output buffer to be \"ABCDEFGH\", got \"%s\"\n",
2951 ok(
ret == 0,
"Expected _mbsupr_s to return 0, got %d\n",
ret);
2953 "Expected the output buffer to be \"ABCDEFGH\", got \"%s\"\n",
2958 ret = p_mbsupr_s(
buffer,
sizeof(
"abcdefgh") - 1);
2959 ok(
ret ==
EINVAL,
"Expected _mbsupr_s to return EINVAL, got %d\n",
ret);
2962 memcpy(
buffer,
"abcdefgh\0ijklmnop",
sizeof(
"abcdefgh\0ijklmnop"));
2965 ok(
ret == 0,
"Expected _mbsupr_s to return 0, got %d\n",
ret);
2966 ok(!
memcmp(
buffer,
"ABCDEFGH\0ijklmnop",
sizeof(
"ABCDEFGH\0ijklmnop")),
2967 "Expected the output buffer to be \"ABCDEFGH\\0ijklmnop\", got \"%s\"\n",
2971 memcpy(
buffer,
"\xa2\xa1\xa2\xa2q",
sizeof(
"\xa2\xa1\xa2\xa2q"));
2973 ok(
ret == 0,
"Expected _mbsupr_s to return 0, got %d\n",
ret);
2974 ok(!
memcmp(
buffer,
"\xa2\xf1\xa2\xf2Q",
sizeof(
"\xa2\xf1\xa2\xf2Q")),
2982 unsigned char buffer[20];
2987 win_skip(
"Skipping _mbslwr_s tests\n");
2993 ok(
ret == 0,
"Expected _mbslwr_s to return 0, got %d\n",
ret);
2997 ok(
ret ==
EINVAL,
"Expected _mbslwr_s to return EINVAL, got %d\n",
ret);
3002 ok(
ret ==
EINVAL,
"Expected _mbslwr_s to return EINVAL, got %d\n",
ret);
3007 ret = p_mbslwr_s(
buffer,
sizeof(
"ABCDEFGH"));
3008 ok(
ret == 0,
"Expected _mbslwr_s to return 0, got %d\n",
ret);
3010 "Expected the output buffer to be \"abcdefgh\", got \"%s\"\n",
3016 ok(
ret == 0,
"Expected _mbslwr_s to return 0, got %d\n",
ret);
3018 "Expected the output buffer to be \"abcdefgh\", got \"%s\"\n",
3023 ret = p_mbslwr_s(
buffer,
sizeof(
"ABCDEFGH") - 1);
3024 ok(
ret ==
EINVAL,
"Expected _mbslwr_s to return EINVAL, got %d\n",
ret);
3027 memcpy(
buffer,
"ABCDEFGH\0IJKLMNOP",
sizeof(
"ABCDEFGH\0IJKLMNOP"));
3030 ok(
ret == 0,
"Expected _mbslwr_s to return 0, got %d\n",
ret);
3031 ok(!
memcmp(
buffer,
"abcdefgh\0IJKLMNOP",
sizeof(
"abcdefgh\0IJKLMNOP")),
3032 "Expected the output buffer to be \"abcdefgh\\0IJKLMNOP\", got \"%s\"\n",
3036 memcpy(
buffer,
"\xa2\xf1\xa2\xf2Q",
sizeof(
"\xa2\xf1\xa2\xf2Q"));
3038 ok(
ret == 0,
"Expected _mbsupr_s to return 0, got %d\n",
ret);
3039 ok(!
memcmp(
buffer,
"\xa2\xa1\xa2\xa2q",
sizeof(
"\xa2\xa1\xa2\xa2q")),
3046 const unsigned char delim[] =
"t";
3048 char str[] =
"!.!test";
3056 "_mbstok(NULL, \"t\") = %p, expected NULL (%p)\n",
ret,
str);
3059 ok(!
ret,
"_mbstok(NULL, \"t\") = %p, expected NULL\n",
ret);
3069 win_skip(
"Skipping _ultoa_s tests\n");
3074 ret = p_ultoa_s(0,
NULL, 0, 0);
3075 ok(
ret ==
EINVAL,
"Expected _ultoa_s to return EINVAL, got %d\n",
ret);
3081 ok(
ret ==
EINVAL,
"Expected _ultoa_s to return EINVAL, got %d\n",
ret);
3083 ok(
buffer[0] ==
'X',
"Expected the output buffer to be untouched\n");
3088 ok(
ret ==
EINVAL,
"Expected _ultoa_s to return EINVAL, got %d\n",
ret);
3090 ok(
buffer[0] ==
'\0',
"Expected the output buffer to be null terminated\n");
3095 ok(
ret ==
EINVAL,
"Expected _ultoa_s to return EINVAL, got %d\n",
ret);
3097 ok(
buffer[0] ==
'\0',
"Expected the output buffer to be null terminated\n");
3101 ret = p_ultoa_s(12345678,
buffer, 4, 10);
3102 ok(
ret ==
ERANGE,
"Expected _ultoa_s to return ERANGE, got %d\n",
ret);
3105 "Expected the output buffer to be null terminated with truncated output\n");
3109 ret = p_ultoa_s(12345678,
buffer, 8, 10);
3110 ok(
ret ==
ERANGE,
"Expected _ultoa_s to return ERANGE, got %d\n",
ret);
3113 "Expected the output buffer to be null terminated with truncated output\n");
3115 ret = p_ultoa_s(12345678,
buffer, 9, 10);
3116 ok(
ret == 0,
"Expected _ultoa_s to return 0, got %d\n",
ret);
3118 "Expected output buffer string to be \"12345678\", got \"%s\"\n",
3122 ok(
ret == 0,
"Expected _ultoa_s to return 0, got %d\n",
ret);
3124 "Expected output buffer string to be \"1010101010101010\", got \"%s\"\n",
3128 ok(
ret == 0,
"Expected _ultoa_s to return 0, got %d\n",
ret);
3130 "Expected output buffer string to be \"nell\", got \"%s\"\n",
3134 ok(
ret == 0,
"Expected _ultoa_s to return 0, got %d\n",
ret);
3136 "Expected output buffer string to be \"hag\", got \"%s\"\n",
3145 win_skip(
"Skipping wctob tests\n");
3149 ret = p_wctob(0x8141);
3152 ret = p_wctob(0x81);
3155 ret = p_wctob(0xe0);
3156 ok(
ret == 0x61,
"ret = %x\n",
ret);
3159 ret = p_wctob(0x81);
3163 ret = p_wctob(0x8141);
3166 ret = p_wctob(0x81);
3167 ok(
ret == (
signed char)0x81,
"ret = %x\n",
ret);
3169 ret = p_wctob(0x9f);
3170 ok(
ret == (
signed char)0x9f,
"ret = %x\n",
ret);
3172 ret = p_wctob(0xe0);
3173 ok(
ret == (
signed char)0xe0,
"ret = %x\n",
ret);
3184 win_skip(
"Skipping btowc tests\n");
3191 ret = p_btowc(0x61);
3192 ok(
ret == 0x61,
"ret = %x\n",
ret);
3194 ret = p_btowc(0x81);
3197 ret = p_btowc(0xe0);
3201 ret = p_btowc(0x61);
3202 ok(
ret == 0x61,
"ret = %x\n",
ret);
3204 ret = p_btowc(0x81);
3207 ret = p_btowc(0xe0);
3211 win_skip(
"No codepage 1250 support\n");
3217 ret = p_btowc(0x61);
3218 ok(
ret == 0x61,
"ret = %x\n",
ret);
3220 ret = p_btowc(0x81);
3221 ok(
ret == 0x81,
"ret = %x\n",
ret);
3223 ret = p_btowc(0xe0);
3224 ok(
ret == 0x155,
"ret = %x\n",
ret);
3226 ret = p_btowc(0x100);
3227 ok(
ret == 0x00,
"ret = %x\n",
ret);
3229 ret = p_btowc(0x1e0);
3230 ok(
ret == 0x155,
"ret = %x\n",
ret);
3233 ret = p_btowc(0x61);
3234 ok(
ret == 0x61,
"ret = %x\n",
ret);
3236 ret = p_btowc(0x81);
3237 ok(
ret == 0x81,
"ret = %x\n",
ret);
3239 ret = p_btowc(0x9f);
3240 ok(
ret == 0x9f,
"ret = %x\n",
ret);
3242 ret = p_btowc(0xe0);
3243 ok(
ret == 0xe0,
"ret = %x\n",
ret);
3245 ret = p_btowc(0x100);
3246 ok(
ret == 0x00,
"ret = %x\n",
ret);
3248 ret = p_btowc(0x1e0);
3249 ok(
ret == 0xe0,
"ret = %x\n",
ret);
3257 unsigned char dst[10];
3267 ok(
ret == 2,
"wcrtomb did not return 2\n");
3272 ok(
ret == 2,
"wcrtomb did not return 2\n");
3273 ok(
state == 0,
"state != 0\n");
3274 ok(
dst[0] == 0x82,
"dst[0] = %x, expected 0x82\n",
dst[0]);
3275 ok(
dst[1] == 0xa0,
"dst[1] = %x, expected 0xa0\n",
dst[1]);
3276 ok(
dst[2] ==
'a',
"dst[2] != 'a'\n");
3279 ok(
ret == 2,
"wcrtomb did not return 2\n");
3280 ok(
dst[0] == 0x82,
"dst[0] = %x, expected 0x82\n",
dst[0]);
3281 ok(
dst[1] == 0xa1,
"dst[1] = %x, expected 0xa1\n",
dst[1]);
3284 ok(
ret == 1,
"wcrtomb did not return 1\n");
3285 ok(
dst[0] == 0x20,
"dst[0] = %x, expected 0x20\n",
dst[0]);
3288 ok(
ret == -1,
"wcrtomb did not return -1\n");
3289 ok(
dst[0] == 0x3f,
"dst[0] = %x, expected 0x3f\n",
dst[0]);
3301 ok(
ret == 2,
"ret != 2\n");
3303 ok(
dst[0] == 0x82,
"dst[0] = %x, expected 0x82\n",
dst[0]);
3304 ok(
dst[1] == 0xa0,
"dst[1] = %x, expected 0xa0\n",
dst[1]);
3305 ok(
dst[2] ==
'a',
"dst[2] != 'a'\n");
3309 ok(
ret == 2,
"ret != 2\n");
3311 ok(
dst[0] == 0x82,
"dst[0] = %x, expected 0x82\n",
dst[0]);
3312 ok(
dst[1] == 0xa0,
"dst[1] = %x, expected 0xa0\n",
dst[1]);
3316 ok(
ret == 1,
"ret != 1\n");
3317 ok(
dst[0] == 0x20,
"dst[0] = %x, expected 0x20\n",
dst[0]);
3321 ok(
ret == 1,
"ret != 1\n");
3325 ok(
ret == -1,
"wcrtomb did not return -1\n");
3326 ok(
dst[0] == 0x3f,
"dst[0] = %x, expected 0x3f\n",
dst[0]);
3338 ret = p_tolower(0x41);
3339 ok(
ret == 0x61,
"ret = %x\n",
ret);
3341 ret = p_tolower(0xF4);
3342 ok(
ret == 0xF4,
"ret = %x\n",
ret);
3345 ret = p_tolower((
char)0xF4);
3346 ok(
ret == (
char)0xF4,
"ret = %x\n",
ret);
3350 ret = p_tolower((
char)0xD0);
3351 ok(
ret == (
char)0xD0,
"ret = %x\n",
ret);
3356 ret = p_tolower((
char)0xF4);
3357 ok(
ret == (
char)0xF4,
"ret = %x\n",
ret);
3362 win_skip(
"skipping tolower tests that depends on locale\n");
3369 ret = p_tolower((
signed char)ch);
3378 if(!
len ||
ret==(
unsigned char)lch)
3383 ret = p_tolower((
signed char)ch);
3392 if(!
len ||
ret==(
unsigned char)lch)
3395 ret = p_tolower((
unsigned char)0xD0);
3396 ok(
ret == 0xD0,
"ret = %x\n",
ret);
3400 ret = p_tolower((
signed char)0xD0);
3401 ok(
ret == 0xF0,
"ret = %x\n",
ret);
3403 ret = p_tolower((
unsigned char)0xD0);
3404 ok(
ret == 0xF0,
"ret = %x\n",
ret);
3409 ret = p_tolower((
signed char)0xd0);
3410 ok(
ret == 0xd0,
"Got %#x.\n",
ret);
3413 ret = p_tolower(0xd0);
3414 ok(
ret == 0xd0,
"Got %#x.\n",
ret);
3419 ret = p_tolower((
signed char)0xd0);
3420 ok(
ret == (
signed char)0xd0,
"Got %#x.\n",
ret);
3423 ret = p_tolower(0xd0);
3424 ok(
ret == 0xd0,
"Got %#x.\n",
ret);
3429 ret = p_tolower((
signed char)0xd0);
3430 ok(
ret == (
signed char)0xd0,
"Got %#x.\n",
ret);
3433 ret = p_tolower(0xd0);
3434 ok(
ret == 0xd0,
"Got %#x.\n",
ret);
3439 ret = p_tolower((
signed char)0xd0);
3440 ok(
ret == (
signed char)0xd0,
"Got %#x.\n",
ret);
3443 ret = p_tolower(0xd0);
3444 ok(
ret == 0xd0,
"Got %#x.\n",
ret);
3477 win_skip(
"_atodbl_l is not available\n");
3483 ok(
ret == 0,
"_atodbl_l(&d, \"\", NULL) returned %d, expected 0\n",
ret);
3484 ok(
d.x == 0,
"d.x = %lf, expected 0\n",
d.x);
3486 ok(
ret == 0,
"_atodbl(&d, \"\") returned %d, expected 0\n",
ret);
3487 ok(
d.x == 0,
"d.x = %lf, expected 0\n",
d.x);
3491 ok(
ret == 0,
"_atodbl_l(&d, \"t\", NULL) returned %d, expected 0\n",
ret);
3492 ok(
d.x == 0,
"d.x = %lf, expected 0\n",
d.x);
3494 ok(
ret == 0,
"_atodbl(&d, \"t\") returned %d, expected 0\n",
ret);
3495 ok(
d.x == 0,
"d.x = %lf, expected 0\n",
d.x);
3499 ok(
ret == 0,
"_atodbl_l(&d, \"0\", NULL) returned %d, expected 0\n",
ret);
3500 ok(
d.x == 0,
"d.x = %lf, expected 0\n",
d.x);
3502 ok(
ret == 0,
"_atodbl(&d, \"0\") returned %d, expected 0\n",
ret);
3503 ok(
d.x == 0,
"d.x = %lf, expected 0\n",
d.x);
3507 ok(
ret == 0,
"_atodbl_l(&d, \"123\", NULL) returned %d, expected 0\n",
ret);
3508 ok(
d.x == 123,
"d.x = %lf, expected 123\n",
d.x);
3510 ok(
ret == 0,
"_atodbl(&d, \"123\") returned %d, expected 0\n",
ret);
3511 ok(
d.x == 123,
"d.x = %lf, expected 123\n",
d.x);
3515 for (
i = 1;
i <= 9;
i++) {
3517 if (expected < DBL_MIN || expected >
DBL_MAX)
continue;
3527 ok(
ret ==
_UNDERFLOW,
"_atodbl_l(&d, \"1e-309\", NULL) returned %d, expected _UNDERFLOW\n",
ret);
3530 ok(
ret ==
_UNDERFLOW,
"_atodbl(&d, \"1e-309\") returned %d, expected _UNDERFLOW\n",
ret);
3535 ok(
ret ==
_OVERFLOW,
"_atodbl_l(&d, \"1e309\", NULL) returned %d, expected _OVERFLOW\n",
ret);
3537 ok(
ret ==
_OVERFLOW,
"_atodbl(&d, \"1e309\") returned %d, expected _OVERFLOW\n",
ret);
3545 ok(
ret == 0,
"_stricmp returned %d\n",
ret);
3547 ok(
ret < 0,
"_stricmp returned %d\n",
ret);
3549 ok(
ret > 0,
"_stricmp returned %d\n",
ret);
3551 ok(
ret < 0,
"_stricmp returned %d\n",
ret);
3553 ok(
ret < 0,
"_stricmp returned %d\n",
ret);
3555 ok(
ret > 0,
"_stricmp returned %d\n",
ret);
3563 ok(
ret == 0,
"_stricmp returned %d\n",
ret);
3565 ok(
ret < 0,
"_stricmp returned %d\n",
ret);
3567 ok(
ret > 0,
"_stricmp returned %d\n",
ret);
3569 ok(
ret == 0,
"_stricmp returned %d\n",
ret);
3571 ok(
ret < 0,
"_stricmp returned %d\n",
ret);
3573 ok(
ret == 0,
"_stricmp returned %d\n",
ret);
3575 ok(
ret > 0,
"_stricmp returned %d\n",
ret);
3579 ok(
ret == 0,
"_stricmp returned %d\n",
ret);
3581 ok(
ret < 0,
"_stricmp returned %d\n",
ret);
3583 ok(
ret > 0,
"_stricmp returned %d\n",
ret);
3585 ok(
ret < 0,
"_stricmp returned %d\n",
ret);
3587 ok(
ret < 0,
"_stricmp returned %d\n",
ret);
3589 ok(
ret < 0,
"_stricmp returned %d\n",
ret);
3591 ok(
ret < 0,
"_stricmp returned %d\n",
ret);
3593 ok(
ret < 0,
"_stricmp returned %d\n",
ret);
3595 ok(
ret > 0,
"_stricmp returned %d\n",
ret);
3599 ok(
ret == 0,
"_stricmp returned %d\n",
ret);
3601 ok(
ret < 0,
"_stricmp returned %d\n",
ret);
3603 ok(
ret > 0,
"_stricmp returned %d\n",
ret);
3605 ok(
ret < 0,
"_stricmp returned %d\n",
ret);
3607 ok(
ret < 0,
"_stricmp returned %d\n",
ret);
3609 ok(
ret < 0,
"_stricmp returned %d\n",
ret);
3611 ok(
ret < 0,
"_stricmp returned %d\n",
ret);
3613 ok(
ret > 0,
"_stricmp returned %d\n",
ret);
3624 {
L"-1234", -1234, -1234 },
3625 {
L"\x09\x0a\x0b\x0c\x0d -123", -123, -123 },
3626 {
L"\xa0\x2002\x2003\x2028\x3000 +44", 44, 44 },
3627 { { 0x3231 }, 0, 0 },
3628 { { 0x4e00 }, 0, 0 },
3629 { { 0x0bef }, 0, 0 },
3630 { { 0x0e59 }, 9, 9 },
3631 { { 0xff19 }, 9, 9 },
3632 { { 0x00b9 }, 0, 0 },
3633 { {
'-',0x0e50,
'x',0xff19,
'1' }, -0x91, -0x91 },
3634 { {
'+',0x0e50,0xff17,
'1' }, 071, 071 },
3635 { { 0xff19,
'f',0x0e59,0xff46 }, 0x9f9, 0x9f9, 16 },
3636 {
L"4294967295", 4294967295, 4294967295 },
3637 {
L"4294967296", 4294967296, 4294967296 },
3638 {
L"9223372036854775807", 9223372036854775807, 9223372036854775807 },
3639 {
L"9223372036854775808",
_I64_MAX, 9223372036854775808u },
3642 {
L"-4294967295", -4294967295, -4294967295 },
3643 {
L"-4294967296", -4294967296, -4294967296 },
3644 {
L"-9223372036854775807", -9223372036854775807, -9223372036854775807 },
3645 {
L"-9223372036854775808",
_I64_MIN, 9223372036854775808u },
3646 {
L"-18446744073709551615",
_I64_MIN, 1 },
3647 {
L"-18446744073709551616",
_I64_MIN, 1 },
3649 static const WCHAR zeros[] = {
3650 0x660, 0x6f0, 0x966, 0x9e6, 0xa66, 0xae6, 0xb66, 0xc66, 0xce6,
3651 0xd66, 0xe50, 0xed0, 0xf20, 0x1040, 0x17e0, 0x1810, 0xff10
3659 if (!p_wcstoi64 || !p_wcstoui64) {
3660 win_skip(
"_wcstoi64 or _wcstoui64 not found\n");
3666 if ((
i == 20) && (
_winver < 0x600))
3668 skip(
"Skipping test with i = 20, because it fails on Windows 2003\n");
3676 ok( ures ==
tests[
i].ures,
"%u: %s res %s\n",
3682 WCHAR tmp[] = {zeros[
i] + 4, zeros[
i], zeros[
i] + 5, 0};
3683 res = p_wcstoi64(tmp,
NULL, 0);
3684 ok(
res == 405,
"with zero = U+%04X: got %d, expected 405\n", zeros[
i], (
int)
res);
3685 tmp[1] = zeros[
i] + 10;
3686 res = p_wcstoi64(tmp,
NULL, 16);
3687 ok(
res == 4,
"with zero = U+%04X: got %d, expected 4\n", zeros[
i], (
int)
res);
3697 {
L"-1234", -1234, -1234 },
3698 {
L"\x09\x0a\x0b\x0c\x0d -123", -123, -123 },
3699 {
L"\xa0\x2002\x2003\x2028\x3000 +44", 44, 44 },
3700 { { 0x3231 }, 0, 0 },
3701 { { 0x4e00 }, 0, 0 },
3702 { { 0x0bef }, 0, 0 },
3703 { { 0x0e59 }, 9, 9 },
3704 { { 0xff19 }, 9, 9 },
3705 { { 0x00b9 }, 0, 0 },
3706 { {
'-',0x0e50,
'x',0xff19,
'1' }, -0x91, -0x91 },
3707 { {
'+',0x0e50,0xff17,
'1' }, 071, 071 },
3708 { { 0xff19,
'f',0x0e59,0xff46 }, 0x9f9, 0x9f9, 16 },
3709 {
L"2147483647", 2147483647, 2147483647 },
3710 {
L"2147483648",
LONG_MAX, 2147483648 },
3711 {
L"4294967295",
LONG_MAX, 4294967295 },
3714 {
L"-2147483647", -2147483647, -2147483647 },
3718 {
L"-9223372036854775807",
LONG_MIN, 1 },
3720 static const WCHAR zeros[] = {
3721 0x660, 0x6f0, 0x966, 0x9e6, 0xa66, 0xae6, 0xb66, 0xc66, 0xce6,
3722 0xd66, 0xe50, 0xed0, 0xf20, 0x1040, 0x17e0, 0x1810, 0xff10
3737 ok( ures ==
tests[
i].ures,
"%u: %s res %08lx\n",
3743 WCHAR tmp[] = {zeros[
i] + 4, zeros[
i], zeros[
i] + 5, 0};
3745 ok(
res == 405,
"with zero = U+%04X: got %d, expected 405\n", zeros[
i], (
int)
res);
3746 tmp[1] = zeros[
i] + 10;
3748 ok(
res == 4,
"with zero = U+%04X: got %d, expected 4\n", zeros[
i], (
int)
res);
3757 ok(
r == 0,
"atoi(0) = %d\n",
r);
3760 ok(
r == -1,
"atoi(-1) = %d\n",
r);
3763 ok(
r == 1,
"atoi(1) = %d\n",
r);
3765 r =
atoi(
"4294967296");
3766 ok(
r == 0,
"atoi(4294967296) = %d\n",
r);
3774 ok(
r == 0,
"atol(0) = %d\n",
r);
3777 ok(
r == -1,
"atol(-1) = %d\n",
r);
3780 ok(
r == 1,
"atol(1) = %d\n",
r);
3782 r =
atol(
"4294967296");
3783 ok(
r == 0,
"atol(4294967296) = %d\n",
r);
3791 ok(
d == 0.0,
"d = %lf\n",
d);
3794 ok(
d == 1.0,
"d = %lf\n",
d);
3797 ok(
d == -1.0,
"d = %lf\n",
d);
3807 ok(
d == 0.0,
"d = %lf\n",
d);
3812 ok(
d == 0.0,
"d = %lf\n",
d);
3818#define TEST_STRNCPY_LEN 10
3820 char *(
__cdecl *p_strncpy)(
char*,
const char*,
size_t);
3823 char not_null_terminated[] = {
'0',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0'};
3869 ok(
ret == 3,
"ret = %d\n", (
int)
ret);
3872 ok(
ret == 3,
"ret = %d\n", (
int)
ret);
3873 ok(
dest[0] ==
'a',
"dest[0] = %d\n",
dest[0]);
3877 ok(
ret == 3,
"ret = %d\n", (
int)
ret);
3883 ok(
ret == 3,
"ret = %d\n", (
int)
ret);
3884 ok(
dest[0] ==
's',
"dest[0] = %d\n",
dest[0]);
3885 ok(
dest[1] ==
'a',
"dest[1] = %d\n",
dest[1]);
3889 ok(
ret == 0,
"ret = %d\n", (
int)
ret);
3902 ok(
dest[0] ==
'a',
"dest[0] = %d\n",
dest[0]);
3906 ok(
dest[0],
"dest[0] = 0\n");
3923 win_skip(
"_strnset_s not available\n");
3927 r = p__strnset_s(
NULL, 0,
'a', 0);
3928 ok(
r == 0,
"r = %d\n",
r);
3931 r = p__strnset_s(
buf,
sizeof(
buf),
'a', 2);
3932 ok(
r == 0,
"r = %d\n",
r);
3935 r = p__strnset_s(
buf, 0,
'a', 0);
3938 r = p__strnset_s(
NULL, 0,
'a', 1);
3942 r = p__strnset_s(
buf,
sizeof(
buf)-1,
'c', 2);
3949 wchar_t text[] =
L"text";
3953 win_skip(
"_wcsnset_s not available\n");
3957 r = p__wcsnset_s(
NULL, 0,
'a', 0);
3958 ok(
r == 0,
"r = %d\n",
r);
3960 r = p__wcsnset_s(
text, 0,
'a', 1);
3962 ok(
text[0] ==
't',
"text[0] = %d\n",
text[0]);
3964 r = p__wcsnset_s(
NULL, 2,
'a', 1);
3967 r = p__wcsnset_s(
text, 2,
'a', 3);
3970 ok(
text[1] ==
'e',
"text[1] = %d\n",
text[1]);
3973 r = p__wcsnset_s(
text, 5,
'a', 1);
3974 ok(
r == 0,
"r = %d\n",
r);
3975 ok(
text[0] ==
'a',
"text[0] = %d\n",
text[0]);
3976 ok(
text[1] ==
'e',
"text[1] = %d\n",
text[1]);
3979 r = p__wcsnset_s(
text, 5,
'b', 3);
3980 ok(
r == 0,
"r = %d\n",
r);
3981 ok(
text[0] ==
'b',
"text[0] = %d\n",
text[0]);
3983 ok(
text[2] ==
'x',
"text[2] = %d\n",
text[2]);
3992 win_skip(
"_wcsset_s not available\n");
3996 r = p__wcsset_s(
NULL, 0,
'a');
4000 r = p__wcsset_s(
str, 0,
'a');
4002 ok(
str[0] ==
'a',
"str[0] = %d\n",
str[0]);
4006 r = p__wcsset_s(
str, 2,
'c');
4008 ok(!
str[0],
"str[0] = %d\n",
str[0]);
4009 ok(
str[1] ==
'b',
"str[1] = %d\n",
str[1]);
4014 r = p__wcsset_s(
str, 3,
'c');
4015 ok(
r == 0,
"r = %d\n",
r);
4016 ok(
str[0] ==
'c',
"str[0] = %d\n",
str[0]);
4017 ok(
str[1] == 0,
"str[1] = %d\n",
str[1]);
4018 ok(
str[2] ==
'b',
"str[2] = %d\n",
str[2]);
4023 static const unsigned char a[] = {
'a',0},
b[] = {
'b',0};
4118 static const char *
s1 =
"abc";
4119 static const char *
s2 =
"aBd";
4153 static const char *
s1 =
"abc";
4154 static const char *
s2 =
"aBd";
4159 win_skip(
"_memicmp_l not found.\n");
4166 ok(
errno == 0xdeadbeef,
"errno is %d, expected 0xdeadbeef\n",
errno);
4186 ok(
errno == 0xdeadbeef,
"errno is %d, expected 0xdeadbeef\n",
errno);
4191 ok(
errno == 0xdeadbeef,
"errno is %d, expected 0xdeadbeef\n",
errno);
4196 const char str[] =
"123";
4197 const char *const_p;
4203 ok(
mem !=
NULL,
"VirtualAlloc failed\n");
4209 ok(
p == str2,
"_strupr returned %p\n",
p);
4210 ok(!
strcmp(str2,
"ABC"),
"str2 = %s\n", str2);
4213 ok(
p ==
mem,
"_strupr returned %p\n",
p);
4216 const_p =
"ALREADY_UPPERCASE";
4218 ok(
p == const_p,
"_strupr returned %p\n",
p);
4222 win_skip(
"English locale _strupr tests\n");
4228 ok(
p == str2,
"_strupr returned %p\n",
p);
4229 ok(!
strcmp(str2,
"ABC"),
"str2 = %s\n", str2);
4234 ok(
p ==
mem,
"_strupr returned %p\n",
p);
4252 {
"English",
"ABCD",
"ABCD", 4, 0 },
4253 {
"English",
"ABCD",
"ABCD", 10, 0 },
4255 {
"English",
"ABC",
"ABCD", 3, 0 },
4256 {
"English",
"ABC",
"ABCD", 4, -1 },
4257 {
"English",
"ABC",
"ABCD", 10, -1 },
4259 {
"English",
"ABCD",
"ABC", 3, 0 },
4260 {
"English",
"ABCD",
"ABC", 4, 1 },
4261 {
"English",
"ABCD",
"ABC", 10, 1 },
4263 {
"English",
"ABCe",
"ABCf", 3, 0 },
4264 {
"English",
"abcd",
"ABCD", 10, -1 },
4266 {
"English",
"AB D",
"AB-D", 4, 1 },
4267 {
"English",
"AB D",
"AB'D", 4, 1 },
4269 {
"C",
"ABCD",
"ABCD", 4, 0 },
4270 {
"C",
"ABCD",
"ABCD", 10, 0 },
4272 {
"C",
"ABC",
"ABCD", 3, 0 },
4273 {
"C",
"ABC",
"ABCD", 10, -1 },
4275 {
"C",
"ABCD",
"ABC", 3, 0 },
4276 {
"C",
"ABCD",
"ABC", 10, 1 },
4278 {
"C",
"ABCe",
"ABCf", 3, 0 },
4279 {
"C",
"abcd",
"ABCD", 10, 1 },
4281 {
"C",
"AB D",
"AB-D", 4, -1 },
4282 {
"C",
"AB D",
"AB'D", 4, -1 },
4301 memset(str1, 0xee,
sizeof(str1));
4304 memset(str2, 0xff,
sizeof(str2));
4309 ok(!
ret,
"expected 0, got %d for %s, %s, %d for locale %s\n",
4312 ok(
ret < 0,
"expected < 0, got %d for %s, %s, %d for locale %s\n",
4315 ok(
ret > 0,
"expected > 0, got %d for %s, %s, %d for locale %s\n",
4318 memset(str1W, 0xee,
sizeof(str1W));
4322 memset(str2W, 0xff,
sizeof(str2W));
4328 ok(!
ret,
"expected 0, got %d for %s, %s, %d for locale %s\n",
4331 ok(
ret < 0,
"expected < 0, got %d for %s, %s, %d for locale %s\n",
4334 ok(
ret > 0,
"expected > 0, got %d for %s, %s, %d for locale %s\n",
4348 {
"English",
"ABCD",
"ABCD", 0 },
4349 {
"English",
"ABC",
"ABCD", -1 },
4350 {
"English",
"ABCD",
"ABC", 1 },
4351 {
"English",
"ABCe",
"ABCf", -1 },
4352 {
"English",
"abcd",
"ABCD", -1 },
4353 {
"English",
"AB D",
"AB-D", 1 },
4354 {
"English",
"AB D",
"AB'D", 1 },
4356 {
"C",
"ABCD",
"ABCD", 0 },
4357 {
"C",
"ABC",
"ABCD", -1 },
4358 {
"C",
"ABCD",
"ABC", 1 },
4359 {
"C",
"ABCe",
"ABCf", -1 },
4360 {
"C",
"abcd",
"ABCD", 1 },
4361 {
"C",
"AB D",
"AB-D", -1 },
4362 {
"C",
"AB D",
"AB'D", -1 },
4381 memset(str1, 0xee,
sizeof(str1));
4384 memset(str2, 0xff,
sizeof(str2));
4389 ok(!
ret,
"expected 0, got %d for %s, %s for locale %s\n",
4392 ok(
ret < 0,
"expected < 0, got %d for %s, %s for locale %s\n",
4395 ok(
ret > 0,
"expected > 0, got %d for %s, %s for locale %s\n",
4398 memset(str1W, 0xee,
sizeof(str1W));
4402 memset(str2W, 0xff,
sizeof(str2W));
4408 ok(!
ret,
"expected 0, got %d for %s, %s for locale %s\n",
4411 ok(
ret < 0,
"expected < 0, got %d for %s, %s for locale %s\n",
4414 ok(
ret > 0,
"expected > 0, got %d for %s, %s for locale %s\n",
4429 {
"English",
"abcd",
"ABCD", 4, 0 },
4430 {
"English",
"abcd",
"ABCD", 10, 0 },
4432 {
"English",
"abc",
"ABCD", 3, 0 },
4433 {
"English",
"abc",
"ABCD", 4, -1 },
4434 {
"English",
"abc",
"ABCD", 10, -1 },
4436 {
"English",
"abcd",
"ABC", 3, 0 },
4437 {
"English",
"abcd",
"ABC", 4, 1 },
4438 {
"English",
"abcd",
"ABC", 10, 1 },
4440 {
"English",
"abcE",
"ABCF", 3, 0 },
4442 {
"C",
"abcd",
"ABCD", 4, 0 },
4443 {
"C",
"abcd",
"ABCD", 10, 0 },
4445 {
"C",
"abc",
"ABCD", 3, 0 },
4446 {
"C",
"abc",
"ABCD", 10, -1 },
4448 {
"C",
"abcd",
"ABC", 3, 0 },
4449 {
"C",
"abcd",
"ABC", 10, 1 },
4451 {
"C",
"abce",
"ABCf", 3, 0 },
4470 memset(str1, 0xee,
sizeof(str1));
4473 memset(str2, 0xff,
sizeof(str2));
4480 ok(
ret < 0,
"expected < 0, got %d for %s, %s, %d\n",
ret, str1, str2, (
int)
tests[
i].
count);
4482 ok(
ret > 0,
"expected > 0, got %d for %s, %s, %d\n",
ret, str1, str2, (
int)
tests[
i].
count);
4484 memset(str1W, 0xee,
sizeof(str1W));
4488 memset(str2W, 0xff,
sizeof(str2W));
4496 ok(
ret < 0,
"expected < 0, got %d for %s, %s, %d\n",
ret, str1, str2, (
int)
tests[
i].
count);
4498 ok(
ret > 0,
"expected > 0, got %d for %s, %s, %d\n",
ret, str1, str2, (
int)
tests[
i].
count);
4523 win_skip(
"__strncnt() is not available.\n");
4532 ret = p___strncnt(strncnt_tests[
i].
str, strncnt_tests[
i].
size);
4533 ok(
ret == strncnt_tests[
i].
ret,
"%u: unexpected return value %u.\n",
i, (
int)
ret);
4542 static const char *locales[] = {
NULL,
"C" };
4546 for (
i = 0;
i <= 0xffff;
i++)
4548 ret = p_towlower(
i);
4549 if (
i >=
'A' &&
i <=
'Z')
4551 exp =
i +
'a' -
'A';
4555 ok(
ret ==
i,
"expected self %x, got %x for C locale\n",
i,
ret);
4557 ret = p_towupper(
i);
4558 if (
i >=
'a' &&
i <=
'z')
4560 exp =
i +
'A' -
'a';
4564 ok(
ret ==
i,
"expected self %x, got %x for C locale\n",
i,
ret);
4567 if (!p__towlower_l || !p__towupper_l || !p__create_locale)
4569 win_skip(
"_towlower_l/_towupper_l/_create_locale not available\n");
4576 for (
j = 0;
j <= 0xffff;
j++) {
4578 if (
j >=
'A' &&
j <=
'Z')
4580 exp =
j +
'a' -
'A';
4584 ok(
ret ==
j,
"expected self %x, got %x for C locale\n",
j,
ret);
4587 if (
j >=
'a' &&
j <=
'z')
4589 exp =
j +
'A' -
'a';
4593 ok(
ret ==
j,
"expected self %x, got %x for C locale\n",
j,
ret);
4602 static char long_str[1024];
4611 {
"aabc",
"abc", 1 },
4612 {
"aaaa",
"aaaa", 0 },
4613 {
"simple",
"simple", 0 },
4614 {
"aaaaxaaaaxaaaa",
"aaaaa", -1 },
4615 {
"aaaaxaaaaxaaaaa",
"aaaaa", 10 },
4616 {
"abcabcdababcdabcdabde",
"abcdabd", 13 },
4617 {
"abababababcabababcababbba",
"abababcaba", 4 },
4618 { long_str, long_str+1, 0 }
4620 const char *
r, *
exp;
4623 memset(long_str,
'a',
sizeof(long_str)-1);
4629 ok(
r ==
exp,
"%d) strstr returned %p, expected %p\n",
i,
r,
exp);
4635 static const struct {
4660 ok(
r == -1,
"wcscmp returned %d\n",
r);
4663 ok(
r == 1,
"wcscmp returned %d\n",
r);
4666 ok(!
r,
"wcscmp returned %d\n",
r);
4676 buf[2*
i] =
v->ld[
i] / 16 +
'0';
4677 if(
buf[2*
i] >
'9')
buf[2*
i] -= 10 +
'0' -
'a';
4678 buf[2*
i+1] =
v->ld[
i] % 16 +
'0';
4679 if(
buf[2*
i+1] >
'9')
buf[2*
i+1] -= 10 +
'0' -
'a';
4687 static const struct {
4697 {
"-0.0", 4, 0, {{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80 }} },
4698 {
"1e0", 3, 0, {{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x3f }} },
4699 {
"1.7976931348623158e+308", 23, 0, {{ 0xaf, 0xfb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x43 }} },
4700 {
"1.7976931348623159e+308", 23, 0, {{ 0xb1, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x43 }} },
4701 {
"3.65e-4951", 10, 0, {{ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }} },
4702 {
"1.82e-4951", 10, 0, {{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }},
TRUE },
4703 {
"1e-99999", 8, 1, {{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }} },
4704 {
"1.18e+4932", 10, 0, {{ 0x25, 0x75, 0x06, 0x68, 0x8a, 0xf1, 0xe7, 0xfd, 0xfe, 0x7f }} },
4705 {
"1.19e+4932", 10, 2, {{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f }} },
4706 {
"1e+99999", 8, 2, {{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f }} },
4737 struct test ucases[] = {
4738 {
"English",
'I',
'i'},
4739 {
"English", 0x0130},
4741 {
"Turkish",
'I',
'i'},
4742 {
"Turkish", 0x0130},
4744 struct test lcases[] = {
4745 {
"English",
'i',
'I'},
4746 {
"English", 0x0131},
4748 {
"Turkish",
'i',
'I'},
4749 {
"Turkish", 0x0131},
4754 win_skip(
"skipping special case tests for %s\n", ucases[
i].
lang);
4758 ret = p_towlower(ucases[
i].ch);
4759 exp = ucases[
i].exp ? ucases[
i].exp : ucases[
i].ch;
4760 ok(
ret ==
exp,
"expected lowercase %x, got %x for locale %s\n",
exp,
ret, ucases[
i].
lang);
4765 win_skip(
"skipping special case tests for %s\n", lcases[
i].
lang);
4769 ret = p_towupper(lcases[
i].ch);
4770 exp = lcases[
i].exp ? lcases[
i].exp : lcases[
i].ch;
4771 ok(
ret ==
exp,
"expected uppercase %x, got %x for locale %s\n",
exp,
ret, lcases[
i].
lang);
4776 if (!p__towlower_l || !p__towupper_l || !p__create_locale)
4778 win_skip(
"_towlower_l/_towupper_l/_create_locale not available\n");
4785 win_skip(
"locale %s not available. skipping\n", ucases[
i].
lang);
4790 exp = ucases[
i].exp ? ucases[
i].exp : ucases[
i].ch;
4791 ok(
ret ==
exp,
"expected lowercase %x, got %x for locale %s\n",
exp,
ret, ucases[
i].
lang);
4799 win_skip(
"locale %s not available. skipping\n", lcases[
i].
lang);
4804 exp = lcases[
i].exp ? lcases[
i].exp : lcases[
i].ch;
4805 ok(
ret ==
exp,
"expected uppercase %x, got %x for locale %s\n",
exp,
ret, lcases[
i].
lang);
4814 static const char *test_locales[] =
4818 "English_Australia",
4826 "Portuguese_Brazil",
4828 "Spanish_Argentina",
4841 for (
c = 0;
c < 256; ++
c)
4870 ok(
p ==
dst,
"Unexpected return value.\n");
4877 unsigned char buf[64], *
ret;
4931 static const struct {
4937 {
"\xce\xac",
"ceac" },
4938 {
"\xce\xac\xc4\xe1",
"\xce\xac" },
4939 {
"\xce\xac""abc",
"\xce\xac" },
4940 {
"abc\xce\xac",
"abc" },
4941 {
"\xce\xac\xc4\xe1",
"\xc4\xe1" },
4942 {
"\xce\xac",
"\xc4\xe1" },
4943 {
"\xb8\xdf",
"\xb8\xdb" },
4951 win_skip(
"_strnicmp_l isn't available.\n");
4958 ok(
ret > 0,
"tests[%d]: Got %d.\n",
i,
ret);
4961 ok(
ret < 0,
"tests[%d]: Got %d.\n",
i,
ret);
4964 if (!p__create_locale)
4965 win_skip(
"_create_locale isn't available.\n");
4974 ok(
ret > 0,
"tests[%d]: Got %d.\n",
i,
ret);
4977 ok(
ret < 0,
"tests[%d]: Got %d.\n",
i,
ret);
4985 win_skip(
"Skip testing _strnicmp_l with 936 code page.\n");
4992 ok(
ret > 0,
"tests[%d]: Got %d.\n",
i,
ret);
4995 ok(
ret < 0,
"tests[%d]: Got %d.\n",
i,
ret);
5007 ret = p_toupper((
signed char)0xf0);
5008 ok(
ret == 0xd0,
"Got %#x.\n",
ret);
5011 ret = p_toupper(0xf0);
5012 ok(
ret == 0xd0,
"Got %#x.\n",
ret);
5017 ret = p_toupper((
signed char)0xa5);
5018 ok(
ret == 0xa5,
"Got %#x.\n",
ret);
5021 ret = p_toupper((
signed char)0xb9);
5022 ok(
ret == 0xa5,
"Got %#x.\n",
ret);
5028 ret = p_toupper((
signed char)0xf0);
5029 ok(
ret == (
signed char)0xf0,
"Got %#x.\n",
ret);
5032 ret = p_toupper(0xf0);
5033 ok(
ret == 0xf0,
"Got %#x.\n",
ret);
5038 ret = p_toupper((
signed char)0xf0);
5039 ok(
ret == (
signed char)0xf0,
"Got %#x.\n",
ret);
5042 ret = p_toupper(0xf0);
5043 ok(
ret == 0xf0,
"Got %#x.\n",
ret);
5053 static const char xilstring[]=
"c:/xilinx";
5059 ok(
hMsvcrt != 0,
"GetModuleHandleA failed\n");
5066 SET(p_strcpy,
"strcpy");
5067 SET(p_strcmp,
"strcmp");
5068 SET(p_strncmp,
"strncmp");
5134 "Got result %s\n",
mem+5);
ios_base &_STLP_CALL oct(ios_base &__s)
int strcmp(const char *String1, const char *String2)
char * strstr(char *String1, 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 * strtok(char *String, const char *Delimiters)
_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)
static const WCHAR empty[]
#define GetProcAddress(x, y)
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
#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)
_Check_return_ _CRTIMP int __cdecl _tolower_l(_In_ int c, _In_opt_ _locale_t locale)
int _atodbl(void *value, char *str)
double pow(double x, double y)
GLint GLint GLint GLint GLint x
GLuint GLuint GLsizei count
GLint GLint GLint GLint GLint GLint y
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 size_t __cdecl _mbscspn(_In_z_ const unsigned char *_Str, _In_z_ const unsigned char *_Control)
_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)
_CRTIMP unsigned char *__cdecl _mbsrev(_Inout_z_ unsigned char *_Str)
_Check_return_ _CRTIMP int __cdecl _mbbtype(_In_ unsigned char _Ch, _In_ int _CType)
_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_ long __cdecl wcstol(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
_Check_return_ int __cdecl atoi(_In_z_ const char *_Str)
_Check_return_ unsigned long __cdecl wcstoul(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
_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)
_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)
_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)
#define memcpy(s1, s2, n)
static struct test_info tests[]
#define sprintf(buf, format,...)
static struct _PeImage bin
#define todo_wine_if(is_todo)
int __cdecl _setmbcp(int)
int __cdecl _ismbblead(unsigned int)
unsigned int __cdecl _control87(unsigned int, 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_SpecialCasing(void)
static void test_ismbckata(void)
static void test_mbctokata(void)
static void test_mbcp(void)
static void test_wcsncpy(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[]
int CDECL __STRINGTOLD(_LDOUBLE *, char **, const char *, int)
static void test___strncnt(void)
static void test__strtod(void)
static void test_mbcjisjms(void)
#define expect_bin(buf, value, len)
static void test_strcmp(void)
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_strncat_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__strnicmp_l(void)
static void test_memmove_s(void)
static void test_mbsrev(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 char const wchar_t _locale_t
static void test__wcsupr_s(void)
static void test_iswdigit(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__wcstol(void)
static BOOL compare_double(double f, double g, unsigned int ulps)
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_strstr(void)
static void test__wcstoi64(void)
static void test__stricmp(void)
static void test_wcscmp(void)
static void test__tolower_l(void)
static void test__memicmp_l(void)
static void test___STRINGTOLD(void)
static void test_gcvt(void)
static void test_btowc(void)
static void test_mbctombb(void)
static void test__wcstombs_s_l(void)
static void test__ismbclx(void)
static void test_wctomb(void)
static void test__tcscoll(void)
static void test__mbsnbcpy_s(void)
static void test__atodbl(void)
static void test_toupper(void)
static int * p__mb_cur_max
static const char * debugstr_ldouble(_LDOUBLE *v)
static void test__tcsnicoll(void)
static void test__ultoa_s(void)
static void test_atof(void)
static void test__mbstok(void)
static const struct @1721 testcases_strtok[]
static void test_wctob(void)
static void test__strupr(void)
static void test_wcsdup(void)
static void test_mbcjmsjis(void)
static void test_atol(void)
#define okchars(dst, b0, b1, b2, b3, b4, b5, b6, b7)
static void test__mbbtype(void)
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 double mul_pow10(double x, double exp)
static void test_strcspn(void)
static void test_wcsncat_s(void)
static const char haystack[]
_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 char *__cdecl strdup(_In_opt_z_ const char *_Src)
_Check_return_ _CRTIMP int __cdecl wcscoll(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_Check_return_ _CRTIMP int __cdecl _strnicoll(_In_z_ const char *_Str1, _In_z_ const char *_Str2, _In_ size_t _MaxCount)
_Check_return_ _CRTIMP wchar_t *__cdecl wcsdup(_In_z_ const wchar_t *_Str)
_Check_return_ _CRTIMP size_t __cdecl strcspn(_In_z_ const char *_Str, _In_z_ const char *_Control)
_Check_return_ _CRTIMP int __cdecl _wcsncoll(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2, _In_ size_t _MaxCount)
const char int int int static __inline const char * wine_dbgstr_a(const char *s)
static const WCHAR lang[]
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
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)