46 static char buf[2][1024];
58#define expect_eq(expr, value, type, format) { type ret = (expr); ok((value) == ret, #expr " expected " format " got " format "\n", value, ret); }
59#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_strcmp)(
const char *,
const char *);
75static int (
__cdecl *p__mbscpy_s)(
unsigned char*,
size_t,
const unsigned char*);
120static int (
__cdecl *p__mbccpy_s)(
unsigned char*,
size_t,
int*,
const unsigned char*);
131#define SETNOFAIL(x,y) x = (void*)GetProcAddress(hMsvcrt,y)
132#define SET(x,y) SETNOFAIL(x,y); ok(x != NULL, "Export '%s' not found\n", y)
137 char original[] =
"BADCFEHGJILKNMPORQTSVUXWZY@#";
138 char expected1[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZ@#";
139 char expected2[] =
"ABCDEFGHIJKLMNOPQRSTUVWX$";
140 char expected3[] =
"$";
148 memset(to,
'$',
sizeof(to));
153 ok(
memcmp(to,expected1,testsize) == 0,
"Testing even size %d returned '%*.*s'\n", testsize, testsize, testsize, to);
156 memset(to,
'$',
sizeof(to));
161 ok(
memcmp(to,expected2,testsize) == 0,
"Testing odd size %d returned '%*.*s'\n", testsize, testsize, testsize, to);
164 memset(to,
'$',
sizeof(to));
167 memcpy(to, original, testsize);
168 _swab( to, to, testsize );
169 ok(
memcmp(to,expected1,testsize) == 0,
"Testing overlapped size %d returned '%*.*s'\n", testsize, testsize, testsize, to);
172 memset(to,
'$',
sizeof(to));
177 ok(
memcmp(to,expected3,testsize) == 0,
"Testing small size %d returned '%*.*s'\n", testsize, testsize, testsize, to);
182 static const struct {
191 {
"a\xf1",
"\xf1", 1 }
198 ok(
r ==
tests[
i].
ret,
"strcspn(\"%s\", \"%s\") = %d, expected %d\n",
214 printf(
"static int result_cp_%d_mbctype[] = { ",
cp);
215 for (
i = 1;
i < 257;
i++)
232static int result_cp_932_mbctype[] = { 0x0,65, 0x8,1, 0x18,26, 0x8,6, 0x28,26, 0x8,4,
233 0x0,1, 0x8,1, 0xc,31, 0x8,1, 0xa,5, 0x9,58, 0xc,29, 0,3 };
234static int result_cp_936_mbctype[] = { 0x0,65, 0x8,1, 0x18,26, 0x8,6, 0x28,26, 0x8,6,
236static int result_cp_949_mbctype[] = { 0x0,66, 0x18,26, 0x8,6, 0x28,26, 0x8,6, 0xc,126,
238static int result_cp_950_mbctype[] = { 0x0,65, 0x8,1, 0x18,26, 0x8,6, 0x28,26, 0x8,4,
239 0x0,2, 0x4,32, 0xc,94, 0,1 };
247 for (
i = 0;
i < 256;
i++)
260#define test_codepage(num) test_cp_table(num, result_cp_##num##_mbctype);
268 unsigned char *mbstring = (
unsigned char *)
"\xb0\xb1\xb2 \xb3\xb4 \xb5";
269 unsigned char *mbstring2 = (
unsigned char *)
"\xb0\xb1\xb2\xb3Q\xb4\xb5";
270 unsigned char *mbsonlylead = (
unsigned char *)
"\xb0\0\xb1\xb2 \xb3";
271 unsigned char buf[16];
304 ok(
_ismbblead(0x1234b0),
"0x1234b0 should not be a lead byte\n");
384 expect_eq(p__mbsnlen(mbstring, 8), 8,
int,
"%d");
385 expect_eq(p__mbsnlen(mbstring, 9), 4,
int,
"%d");
386 expect_eq(p__mbsnlen(mbstring, 10), 4,
int,
"%d");
387 expect_eq(p__mbsnlen(mbsonlylead, 0), 0,
int,
"%d");
388 expect_eq(p__mbsnlen(mbsonlylead, 1), 1,
int,
"%d");
389 expect_eq(p__mbsnlen(mbsonlylead, 2), 0,
int,
"%d");
390 expect_eq(p__mbsnlen(mbstring2, 7), 7,
int,
"%d");
391 expect_eq(p__mbsnlen(mbstring2, 8), 4,
int,
"%d");
392 expect_eq(p__mbsnlen(mbstring2, 9), 4,
int,
"%d");
400 expect_eq(p_mbrlen((
const char*)mbstring, 2,
NULL), 2,
int,
"%d");
401 expect_eq(p_mbrlen((
const char*)&mbstring[2], 2,
NULL), 2,
int,
"%d");
402 expect_eq(p_mbrlen((
const char*)&mbstring[3], 2,
NULL), 1,
int,
"%d");
403 expect_eq(p_mbrlen((
const char*)mbstring, 1,
NULL), -2,
int,
"%d");
404 expect_eq(p_mbrlen((
const char*)mbstring, 1, &
state), -2,
int,
"%d");
405 ok(
state == mbstring[0],
"incorrect state value (%x)\n",
state);
406 expect_eq(p_mbrlen((
const char*)&mbstring[1], 1, &
state), 2,
int,
"%d");
416 ok(
dst == 0x6c28,
"dst = %x, expected 0x6c28\n",
dst);
418 ok(
dst == 0x3f,
"dst = %x, expected 0x3f\n",
dst);
420 ok(
dst == 0x20,
"dst = %x, expected 0x20\n",
dst);
422 ok(
dst == 0,
"dst = %x, expected 0\n",
dst);
424 ok(
dst == 0,
"dst = %x, expected 0\n",
dst);
425 ok(
state == mbstring[0],
"incorrect state value (%x)\n",
state);
427 ok(
dst == 0x6c28,
"dst = %x, expected 0x6c28\n",
dst);
444 err = p__mbccpy_s(
buf, 0, &copied, mbstring);
446 ok(!copied,
"copied = %d\n", copied);
447 ok(
buf[0] == 0xff,
"buf[0] = %x\n",
buf[0]);
451 err = p__mbccpy_s(
buf, 1, &copied, mbstring);
453 ok(!copied,
"copied = %d\n", copied);
454 ok(!
buf[0],
"buf[0] = %x\n",
buf[0]);
458 err = p__mbccpy_s(
buf, 2, &copied, mbstring);
459 ok(!
err,
"_mbccpy_s returned %d\n",
err);
460 ok(copied == 2,
"copied = %d\n", copied);
465 err = p__mbccpy_s(
buf, 2, &copied, (
unsigned char *)
"\xb0");
467 ok(copied == 1,
"copied = %d\n", copied);
474 ok(
ret ==
NULL,
"_mbsncpy returned %p, expected NULL\n",
ret);
480 ok(
ret ==
NULL,
"_mbsncpy returned %p, expected NULL\n",
ret);
487 ok(
ret ==
NULL,
"_mbsncpy returned %p, expected NULL\n",
ret);
488 ok(
errno == 0xdeadbeef,
"_mbsncpy should not change errno\n");
494 ok(
errno == 0xdeadbeef,
"_mbsncpy should not change errno\n");
500 ok(
ret ==
NULL,
"_mbsncpy returned %p, expected NULL\n",
ret);
506 ok(
ret ==
NULL,
"_mbsncpy returned %p, expected NULL\n",
ret);
553 step =
_mbsinc(mbstring) - mbstring;
554 ok(step == 2,
"_mbsinc adds %d (exp. 2)\n", step);
555 step =
_mbsinc(&mbstring[2]) - &mbstring[2];
556 ok(step == 2,
"_mbsinc adds %d (exp. 2)\n", step);
558 step =
_mbsninc(mbsonlylead, 1) - mbsonlylead;
559 ok(step == 0,
"_mbsninc adds %d (exp. 0)\n", step);
560 step =
_mbsninc(mbsonlylead, 2) - mbsonlylead;
561 ok(step == 0,
"_mbsninc adds %d (exp. 0)\n", step);
562 step =
_mbsninc(mbstring2, 0) - mbstring2;
563 ok(step == 0,
"_mbsninc adds %d (exp. 2)\n", step);
564 step =
_mbsninc(mbstring2, 1) - mbstring2;
565 ok(step == 2,
"_mbsninc adds %d (exp. 2)\n", step);
566 step =
_mbsninc(mbstring2, 2) - mbstring2;
567 ok(step == 4,
"_mbsninc adds %d (exp. 4)\n", step);
568 step =
_mbsninc(mbstring2, 3) - mbstring2;
569 ok(step == 5,
"_mbsninc adds %d (exp. 5)\n", step);
570 step =
_mbsninc(mbstring2, 4) - mbstring2;
571 ok(step == 7,
"_mbsninc adds %d (exp. 7)\n", step);
572 step =
_mbsninc(mbstring2, 5) - mbstring2;
573 ok(step == 7,
"_mbsninc adds %d (exp. 7)\n", step);
574 step =
_mbsninc(mbstring2, 17) - mbstring2;
575 ok(step == 7,
"_mbsninc adds %d (exp. 7)\n", step);
588 skip(
"Current locale has double-byte charset - could lead to false positives\n");
616 unsigned char str1[]=
"cabernet";
617 unsigned char str2[]=
"shiraz";
618 unsigned char set[]=
"abc";
619 unsigned char empty[]=
"";
620 unsigned char mbstr[]=
" 2019\x94\x4e" "6\x8c\x8e" "29\x93\xfa";
621 unsigned char mbset1[]=
"0123456789 \x94\x4e";
622 unsigned char mbset2[]=
" \x94\x4e\x8c\x8e";
623 unsigned char mbset3[]=
"\x8e";
627 ok(
ret==3,
"_mbsspn returns %d should be 3\n",
ret);
629 ok(
ret==0,
"_mbsspn returns %d should be 0\n",
ret);
631 ok(
ret==0,
"_mbsspn returns %d should be 0\n",
ret);
634 ok(
ret==0,
"_mbscspn returns %d should be 0\n",
ret);
636 ok(
ret==4,
"_mbscspn returns %d should be 4\n",
ret);
638 ok(
ret==8,
"_mbscspn returns %d should be 8\n",
ret);
642 ok(
ret==8,
"_mbsspn returns %d should be 8\n",
ret);
644 ok(
ret==1,
"_mbsspn returns %d should be 1\n",
ret);
646 ok(
ret==0,
"_mbsspn returns %d should be 0\n",
ret);
648 ok(
ret==2,
"_mbsspn returns %d should be 2\n",
ret);
650 ok(
ret==14,
"_mbsspn returns %d should be 14\n",
ret);
653 ok(
ret==0,
"_mbscspn returns %d should be 0\n",
ret);
655 ok(
ret==0,
"_mbscspn returns %d should be 0\n",
ret);
657 ok(
ret==2,
"_mbscspn returns %d should be 2\n",
ret);
659 ok(
ret==0,
"_mbscspn returns %d should be 0\n",
ret);
661 ok(
ret==0,
"_mbscspn returns %d should be 0\n",
ret);
668 unsigned char str1[]=
"cabernet";
669 unsigned char str2[]=
"shiraz";
670 unsigned char set[]=
"abc";
671 unsigned char empty[]=
"";
672 unsigned char full[]=
"abcenrt";
673 unsigned char mbstr[]=
" 2019\x94\x4e" "6\x8c\x8e" "29\x93\xfa";
674 unsigned char mbset1[]=
"0123456789 \x94\x4e";
675 unsigned char mbset2[]=
" \x94\x4e\x8c\x8e";
680 ok(
ret[0]==
'e',
"_mbsspnp returns %c should be e\n",
ret[0]);
682 ok(
ret[0]==
's',
"_mbsspnp returns %c should be s\n",
ret[0]);
684 ok(
ret[0]==
'c',
"_mbsspnp returns %c should be c\n",
ret[0]);
686 ok(
ret==
NULL,
"_mbsspnp returns %p should be NULL\n",
ret);
690 ok(
ret==mbstr+8,
"_mbsspnp returns %p should be %p\n",
ret, mbstr+8);
692 ok(
ret==mbstr+1,
"_mbsspnp returns %p should be %p\n",
ret, mbstr+1);
694 ok(
ret==mbstr+8,
"_mbsspnp returns %p should be %p\n",
ret, mbstr+8);
696 ok(
ret==mbstr+10,
"_mbsspnp returns %p should be %p\n",
ret, mbstr+10);
707 ok(
errno == 0xdeadbeef,
"errno is %d, expected 0xdeadbeef\n",
errno);
716 ok(
errno == 0xdeadbeef,
"errno is %d, expected 0xdeadbeef\n",
errno);
721 int ret = p_strcmp(
"abc",
"abcd" );
722 ok(
ret == -1,
"wrong ret %d\n",
ret );
723 ret = p_strcmp(
"",
"abc" );
724 ok(
ret == -1,
"wrong ret %d\n",
ret );
725 ret = p_strcmp(
"abc",
"ab\xa0" );
726 ok(
ret == -1,
"wrong ret %d\n",
ret );
727 ret = p_strcmp(
"ab\xb0",
"ab\xa0" );
728 ok(
ret == 1,
"wrong ret %d\n",
ret );
729 ret = p_strcmp(
"ab\xc2",
"ab\xc2" );
730 ok(
ret == 0,
"wrong ret %d\n",
ret );
732 ret = p_strncmp(
"abc",
"abcd", 3 );
733 ok(
ret == 0,
"wrong ret %d\n",
ret );
736 ret = p_strncmp(
"",
"abc", 3 );
737 ok(
ret == -1,
"wrong ret %d\n",
ret );
738 ret = p_strncmp(
"abc",
"ab\xa0", 4 );
739 ok(
ret == -1,
"wrong ret %d\n",
ret );
740 ret = p_strncmp(
"ab\xb0",
"ab\xa0", 3 );
741 ok(
ret == 1,
"wrong ret %d\n",
ret );
743 ret = p_strncmp(
"",
"abc", 3 );
744 ok(
ret == 0 -
'a',
"wrong ret %d\n",
ret );
745 ret = p_strncmp(
"abc",
"ab\xa0", 4 );
746 ok(
ret ==
'c' - 0xa0,
"wrong ret %d\n",
ret );
747 ret = p_strncmp(
"ab\xb0",
"ab\xa0", 3 );
748 ok(
ret == 0xb0 - 0xa0,
"wrong ret %d\n",
ret );
751 ret = p_strncmp(
"ab\xb0",
"ab\xa0", 2 );
752 ok(
ret == 0,
"wrong ret %d\n",
ret );
753 ret = p_strncmp(
"ab\xc2",
"ab\xc2", 3 );
754 ok(
ret == 0,
"wrong ret %d\n",
ret );
755 ret = p_strncmp(
"abc",
"abd", 0 );
756 ok(
ret == 0,
"wrong ret %d\n",
ret );
757 ret = p_strncmp(
"abc",
"abc", 12 );
758 ok(
ret == 0,
"wrong ret %d\n",
ret );
764 const char small[] =
"small";
765 const char big[] =
"atoolongstringforthislittledestination";
776 ok(
ret == 0,
"Copying a string into a big enough destination returned %d, expected 0\n",
ret);
779 "Unexpected return data from strcpy_s: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
784 ok(
ret ==
EINVAL,
"Copying into a destination of size 0 returned %d, expected EINVAL\n",
ret);
787 "Unexpected return data from strcpy_s: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
790 ok(
ret ==
EINVAL,
"Copying into a destination of size 0 returned %d, expected EINVAL\n",
ret);
793 "Unexpected return data from strcpy_s: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
798 ok(
ret ==
ERANGE,
"Copying a big string in a small location returned %d, expected ERANGE\n",
ret);
801 "Unexpected return data from strcpy_s: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
806 ok(
ret ==
EINVAL,
"Copying from a NULL source string returned %d, expected EINVAL\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",
813 ok(
ret ==
EINVAL,
"Copying a big string a NULL dest returned %d, expected EINVAL\n",
ret);
821 "Unexpected return data from strcpy: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
836 ok(
dest[0] == 0,
"dest[0] not 0\n");
840 ok(
ret == 0,
"expected ERROR_SUCCESS got %d\n",
ret);
841 ok(
dest[0] == 0,
"dest[0] not 0\n");
849 ok(
ret == 0,
"expected 0 got %d\n",
ret);
855 ok(
dest[0] == 0,
"dest[0] not 0\n");
858 ret = p_strncpy_s(
dest, 5, big, -1);
860 ok(
dest[4] == 0,
"dest[4] not 0\n");
863 ret = p_strncpy_s(
NULL, 0, (
void*)0xdeadbeef, 0);
874#define okchars(dst, b0, b1, b2, b3, b4, b5, b6, b7) \
875 ok(dst[0] == b0 && dst[1] == b1 && dst[2] == b2 && dst[3] == b3 && \
876 dst[4] == b4 && dst[5] == b5 && dst[6] == b6 && dst[7] == b7, \
877 "Bad result: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",\
878 dst[0], dst[1], dst[2], dst[3], dst[4], dst[5], dst[6], dst[7])
883 static const char tiny[] = {
'T',0,
'I',
'N',
'Y',0};
884 static const char big[] = {
'a',
't',
'o',
'o',
'l',
'o',
'n',
'g',
's',
't',
'r',
'i',
'n',
'g',0};
894 ok(
ret == 0,
"Copying a buffer into a big enough destination returned %d, expected 0\n",
ret);
895 okchars(
dest, tiny[0], tiny[1], tiny[2], tiny[3], tiny[4], tiny[5],
'X',
'X');
901 ok(
ret ==
ERANGE,
"Copying a big buffer to a small destination returned %d, expected ERANGE\n",
ret);
909 ok(
ret ==
EINVAL,
"Copying a NULL source buffer returned %d, expected EINVAL\n",
ret);
917 ok(
ret ==
ERANGE,
"Copying into a destination of size 0 returned %d, expected ERANGE\n",
ret);
919 okchars(
dest,
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X');
924 ok(
ret ==
EINVAL,
"Copying a tiny buffer to a big NULL destination returned %d, expected EINVAL\n",
ret);
931 ok(
ret ==
EINVAL,
"Copying a NULL buffer into a destination of size 0 returned %d, expected EINVAL\n",
ret);
933 okchars(
dest,
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X');
936 ok(!
ret,
"memcpy_s returned %d\n",
ret);
937 ok(!
memcmp(
buf, big,
sizeof(big)),
"unexpected buf\n");
940 ok(!
ret,
"memcpy_s returned %d\n",
ret);
941 ok(!
memcmp(
buf + 1, big,
sizeof(big)),
"unexpected buf\n");
944 ok(!
ret,
"memcpy_s returned %d\n",
ret);
945 ok(!
memcmp(
buf, big,
sizeof(big)),
"unexpected buf\n");
951 static const char tiny[] = {
'T',0,
'I',
'N',
'Y',0};
952 static const char big[] = {
'a',
't',
'o',
'o',
'l',
'o',
'n',
'g',
's',
't',
'r',
'i',
'n',
'g',0};
962 ok(
ret == 0,
"Moving a buffer into a big enough destination returned %d, expected 0\n",
ret);
963 okchars(
dest, tiny[0], tiny[1], tiny[2], tiny[3], tiny[4], tiny[5],
'X',
'X');
968 ok(
ret == 0,
"Moving a buffer up one char returned %d, expected 0\n",
ret);
969 okchars(
dest, big[0], big[0], big[1], big[2], big[3], big[4], big[5], big[6]);
975 ok(
ret ==
ERANGE,
"Moving a big buffer to a small destination returned %d, expected ERANGE\n",
ret);
977 okchars(
dest,
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X');
983 ok(
ret ==
EINVAL,
"Moving a NULL source buffer returned %d, expected EINVAL\n",
ret);
985 okchars(
dest,
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X');
991 ok(
ret ==
ERANGE,
"Moving into a destination of size 0 returned %d, expected ERANGE\n",
ret);
993 okchars(
dest,
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X');
998 ok(
ret ==
EINVAL,
"Moving a tiny buffer to a big NULL destination returned %d, expected EINVAL\n",
ret);
1005 ok(
ret ==
EINVAL,
"Moving a NULL buffer into a destination of size 0 returned %d, expected EINVAL\n",
ret);
1007 okchars(
dest,
'X',
'X',
'X',
'X',
'X',
'X',
'X',
'X');
1013 const char *
small =
"sma";
1025 ok(
ret == 0,
"strcat_s: Copying a string into a big enough destination returned %d, expected 0\n",
ret);
1028 "Unexpected return data from strcpy_s: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
1031 ok(
ret == 0,
"strcat_s: Attaching a string to a big enough destination returned %d, expected 0\n",
ret);
1034 "Unexpected return data from strcpy_s: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
1038 ok(
ret ==
ERANGE,
"strcat_s: Attaching a string to a filled up destination returned %d, expected ERANGE\n",
ret);
1041 "Unexpected return data from strcpy_s: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
1049 ok(
ret ==
EINVAL,
"strcat_s: Source len = 0 returned %d, expected EINVAL\n",
ret);
1052 "Unexpected return data from strcpy_s: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
1056 ok(
ret ==
EINVAL,
"strcat_s: len = 0 and src = NULL returned %d, expected EINVAL\n",
ret);
1059 "Unexpected return data from strcpy_s: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
1063 ok(
ret ==
EINVAL,
"strcat_s: Sourcing from NULL returned %d, expected EINVAL\n",
ret);
1066 "Unexpected return data from strcpy_s: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
1070 ok(
ret ==
EINVAL,
"strcat_s: Writing to a NULL string returned %d, expected EINVAL\n",
ret);
1075 unsigned char dst[8],
src[4];
1103 ok(
err == 0,
"_mbscat_s returned %d\n",
err);
1108 ok(!
dst[0],
"dst[0] = %c\n",
dst[0]);
1109 ok(
dst[1] ==
'a',
"dst[1] = %c\n",
dst[1]);
1120 ok(
err == 0,
"_mbscat_s returned %d\n",
err);
1129 ok(
err == 0,
"_mbscat_s returned %d\n",
err);
1155 unsigned char dest[8];
1156 const unsigned char big[] =
"atoolongstringforthislittledestination";
1157 const unsigned char small[] =
"small";
1162 win_skip(
"_mbsnbcpy_s not found\n");
1168 ok(
ret == 0,
"_mbsnbcpy_s: Copying a string into a big enough destination returned %d, expected 0\n",
ret);
1171 "Unexpected return data from _mbsnbcpy_s: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
1177 ok(
ret ==
ERANGE,
"_mbsnbcpy_s: Copying a too long string returned %d, expected ERANGE\n",
ret);
1180 "Unexpected return data from _mbsnbcpy_s: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
1184 ret = p_mbsnbcpy_s(
dest,
sizeof(
dest) - 2, big, 4);
1185 ok(
ret == 0,
"_mbsnbcpy_s: Copying a too long string with a count cap returned %d, expected 0\n",
ret);
1188 "Unexpected return data from _mbsnbcpy_s: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
1193 ok(
ret == 0,
"_mbsnbcpy_s: Copying more data than the source string len returned %d, expected 0\n",
ret);
1196 "Unexpected return data from _mbsnbcpy_s: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n",
1202 const unsigned char src[] =
"source string";
1203 unsigned char dest[16];
1221 ok(!
dest[0],
"dest buffer was not modified on invalid argument\n");
1227 ok(
dest[
sizeof(
src)] ==
'X',
"unused part of buffer was modified\n");
1232 ok(!
dest[0],
"incorrect dest buffer (%d)\n",
dest[0]);
1233 ok(
dest[1] ==
src[1],
"incorrect dest buffer (%d)\n",
dest[1]);
1238 static const WCHAR szLongText[] =
L"ThisALongstring";
1239 static WCHAR szDest[18];
1240 static WCHAR szDestShort[8];
1251 ret = p_wcscpy_s(
NULL, 18, szLongText);
1258 ret = p_wcscpy_s(szDest, 18,
NULL);
1261 ok(szDest[0] == 0,
"szDest[0] not 0, got %c\n", szDest[0]);
1266 ret = p_wcscpy_s(szDest, 0, szLongText);
1272 ok(szDest[0] == 0 ||
ret ==
EINVAL,
"szDest[0] not 0\n");
1275 ret = p_wcscpy_s(szDest, 18, szLongText);
1276 ok(
ret == 0,
"expected 0 got %d\n",
ret);
1277 ok(
lstrcmpW(szDest, szLongText) == 0,
"szDest != szLongText\n");
1280 ret = p_wcscpy_s(szDest, 18, szDest);
1281 ok(
ret == 0,
"expected 0 got %d\n",
ret);
1282 ok(
lstrcmpW(szDest, szLongText) == 0,
"szDest != szLongText\n");
1287 ret = p_wcscpy_s(szDestShort, 8, szLongText);
1290 ok(szDestShort[0] == 0,
"szDestShort[0] not 0\n");
1302 ret = p_wcsncpy_s(szDest, 18,
NULL, 1);
1304 ok(szDest[0] == 0,
"szDest[0] not 0\n");
1307 ret = p_wcsncpy_s(szDest, 18,
NULL, 0);
1308 ok(
ret == 0,
"expected ERROR_SUCCESS got %d\n",
ret);
1309 ok(szDest[0] == 0,
"szDest[0] not 0\n");
1312 ret = p_wcsncpy_s(szDest, 0, szLongText,
ARRAY_SIZE(szLongText));
1314 ok(szDest[0] == 0 ||
ret ==
EINVAL,
"szDest[0] not 0\n");
1316 ret = p_wcsncpy_s(szDest, 18, szLongText,
ARRAY_SIZE(szLongText));
1317 ok(
ret == 0,
"expected 0 got %d\n",
ret);
1318 ok(
lstrcmpW(szDest, szLongText) == 0,
"szDest != szLongText\n");
1321 ret = p_wcsncpy_s(szDestShort, 8, szLongText,
ARRAY_SIZE(szLongText));
1323 ok(szDestShort[0] == 0,
"szDestShort[0] not 0\n");
1326 ret = p_wcsncpy_s(szDest, 5, szLongText, -1);
1328 ok(szDest[4] == 0,
"szDest[4] not 0\n");
1331 ret = p_wcsncpy_s(
NULL, 0, (
void*)0xdeadbeef, 0);
1334 szDestShort[0] =
'1';
1336 ret = p_wcsncpy_s(szDestShort+1, 4, szDestShort, -1);
1338 ok(szDestShort[0]==
'1' && szDestShort[1]==
'1' && szDestShort[2]==
'1' && szDestShort[3]==
'1',
1344 static const WCHAR mixedString[] =
L"MiXeDlowerUPPER";
1345 static const WCHAR expectedString[] =
L"MIXEDLOWERUPPER";
1358 ok(
ret ==
EINVAL,
"Expected _wcsupr_s to fail with EINVAL, got %d\n",
ret);
1364 ok(
ret ==
EINVAL,
"Expected _wcsupr_s to fail with EINVAL, got %d\n",
ret);
1369 testBuffer[0] =
'\0';
1370 ret = p_wcsupr_s(testBuffer, 0);
1371 ok(
ret ==
EINVAL,
"Expected _wcsupr_s to fail with EINVAL, got %d\n",
ret);
1373 ok(testBuffer[0] ==
'\0',
"Expected the buffer to be unchanged\n");
1376 testBuffer[0] =
'\0';
1377 ret = p_wcsupr_s(testBuffer, 1);
1378 ok(
ret == 0,
"Expected _wcsupr_s to succeed, got %d\n",
ret);
1379 ok(testBuffer[0] ==
'\0',
"Expected the buffer to be unchanged\n");
1383 testBuffer[0] =
'x';
1384 ret = p_wcsupr_s(testBuffer, 0);
1385 ok(
ret ==
EINVAL,
"Expected _wcsupr_s to fail with EINVAL, got %d\n",
ret);
1387 ok(testBuffer[0] ==
'\0',
"Expected the first buffer character to be null\n");
1391 testBuffer[0] =
'x';
1392 ret = p_wcsupr_s(testBuffer, 1);
1393 ok(
ret ==
EINVAL,
"Expected _wcsupr_s to fail with EINVAL, got %d\n",
ret);
1395 ok(testBuffer[0] ==
'\0',
"Expected the first buffer character to be null\n");
1398 wcscpy(testBuffer, mixedString);
1400 ret = p_wcsupr_s(testBuffer, 0);
1401 ok(
ret ==
EINVAL,
"Expected _wcsupr_s to fail with EINVAL, got %d\n",
ret);
1403 ok(testBuffer[0] ==
'\0',
"Expected the first buffer character to be null\n");
1406 wcscpy(testBuffer, mixedString);
1408 ok(
ret == 0,
"Expected _wcsupr_s to succeed, got %d\n",
ret);
1409 ok(!
wcscmp(testBuffer, expectedString),
"Expected the string to be fully upper-case\n");
1412 wcscpy(testBuffer, mixedString);
1415 ok(
ret ==
EINVAL,
"Expected _wcsupr_s to fail with EINVAL, got %d\n",
ret);
1417 ok(testBuffer[0] ==
'\0',
"Expected the first buffer character to be null\n");
1420 wcscpy(testBuffer, mixedString);
1422 ok(
ret == 0,
"Expected _wcsupr_s to succeed, got %d\n",
ret);
1423 ok(!
wcscmp(testBuffer, expectedString),
"Expected the string to be fully upper-case\n");
1428 static const WCHAR mixedString[] =
L"MiXeDlowerUPPER";
1429 static const WCHAR expectedString[] =
L"mixedlowerupper";
1457 ok(
buffer[0] == 0,
"expected empty string\n");
1463 ok(
buffer[0] == 0,
"expected buffer to be unchanged\n");
1471 ok(
buffer[0] ==
'\0',
"expected empty string\n");
1479 ok(
buffer[0] ==
'\0',
"expected empty string\n");
1487 ok(
buffer[0] ==
'\0',
"expected empty string\n");
1492 ok(
ret == 0,
"expected 0, got %d\n",
ret);
1501 ok(
buffer[0] ==
'\0',
"expected empty string\n");
1506 ok(
ret == 0,
"expected 0, got %d\n",
ret);
1513 unsigned int jisjms[][2] = { {0x2020, 0}, {0x2021, 0}, {0x2120, 0}, {0x2121, 0x8140},
1514 {0x7f7f, 0}, {0x7f7e, 0}, {0x7e7f, 0}, {0x7e7e, 0xeffc},
1515 {0x255f, 0x837e}, {0x2560, 0x8380}, {0x2561, 0x8381},
1516 {0x2121FFFF, 0}, {0x2223, 0x81a1}, {0x237e, 0x829e}, {0, 0}};
1524 for (
j = 0; jisjms[
j][0] != 0;
j++)
1528 exp = (
cp[
i] == 932) ? jisjms[
j][1] : jisjms[
j][0];
1529 ok(
ret ==
exp,
"Expected 0x%x, got 0x%x (0x%x, codepage=%d)\n",
1539 unsigned int jmsjis[][2] = { {0x80fc, 0}, {0x813f, 0}, {0x8140, 0x2121},
1540 {0x817e, 0x215f}, {0x817f, 0}, {0x8180, 0x2160},
1541 {0x819e, 0x217e}, {0x819f, 0x2221}, {0x81fc, 0x227e},
1542 {0x81fd, 0}, {0x9ffc, 0x5e7e}, {0x9ffd, 0},
1543 {0xa040, 0}, {0xdffc, 0}, {0xe040, 0x5f21},
1544 {0xeffc, 0x7e7e}, {0xf040, 0}, {0x21, 0}, {0, 0}};
1552 for (
j = 0; jmsjis[
j][0] != 0;
j++)
1556 exp = (
cp[
i] == 932) ? jmsjis[
j][1] : jmsjis[
j][0];
1557 ok(
ret ==
exp,
"Expected 0x%x, got 0x%x (0x%x, codepage=%d)\n",
1566 static const unsigned int mbchira_932[][2] = {
1567 {0x8152, 0x8152}, {0x8153, 0x8153}, {0x8154, 0x8154}, {0x8155, 0x8155},
1568 {0x82a0, 0x82a0}, {0x833f, 0x833f}, {0x8340, 0x829f}, {0x837e, 0x82dd},
1569 {0x837f, 0x837f}, {0x8380, 0x82de}, {0x8393, 0x82f1}, {0x8394, 0x8394},
1570 {0x8396, 0x8396}, {0x8397, 0x8397},
1571 {0xa5, 0xa5}, {0xb0, 0xb0}, {0xdd, 0xdd} };
1578 int ret,
exp = mbchira_932[
i][0];
1588 exp = mbchira_932[
i][1];
1596 static const unsigned int mbckata_932[][2] = {
1597 {0x8152, 0x8152}, {0x8153, 0x8153}, {0x8154, 0x8154}, {0x8155, 0x8155},
1598 {0x833f, 0x833f}, {0x829f, 0x8340}, {0x82dd, 0x837e}, {0x837f, 0x837f},
1599 {0x82de, 0x8380}, {0x8394, 0x8394}, {0x8397, 0x8397},
1600 {0xa5, 0xa5}, {0xb0, 0xb0}, {0xdd, 0xdd} };
1607 int ret,
exp = mbckata_932[
i][0];
1617 exp = mbckata_932[
i][1];
1625 static const unsigned int mbbmbc[][2] = {
1626 {0x1f, 0x1f}, {0x20, 0x8140}, {0x39, 0x8258}, {0x40, 0x8197},
1627 {0x41, 0x8260}, {0x5e, 0x814f}, {0x7e, 0x8150}, {0x7f, 0x7f},
1628 {0x80, 0x80}, {0x81, 0x81}, {0xa0, 0xa0}, {0xa7, 0x8340},
1629 {0xb0, 0x815b}, {0xd1, 0x8380}, {0xff, 0xff}, {0,0}};
1637 for (
j = 0; mbbmbc[
j][0] != 0;
j++)
1641 exp = (
cp[
i] == 932) ? mbbmbc[
j][1] : mbbmbc[
j][0];
1642 ok(
ret ==
exp,
"Expected 0x%x, got 0x%x (0x%x, codepage %d)\n",
1651 static const unsigned int mbcmbb_932[][2] = {
1652 {0x829e, 0x829e}, {0x829f, 0xa7}, {0x82f1, 0xdd}, {0x82f2, 0x82f2},
1653 {0x833f, 0x833f}, {0x8340, 0xa7}, {0x837e, 0xd0}, {0x837f, 0x837f},
1654 {0x8380, 0xd1}, {0x8396, 0xb9}, {0x8397, 0x8397}, {0x813f, 0x813f},
1655 {0x8140, 0x20}, {0x814c, 0x814c}, {0x814f, 0x5e}, {0x8197, 0x40},
1656 {0x8198, 0x8198}, {0x8258, 0x39}, {0x8259, 0x8259}, {0x825f, 0x825f},
1657 {0x8260, 0x41}, {0x82f1, 0xdd}, {0x82f2, 0x82f2}, {0,0}};
1662 for (
i = 0; mbcmbb_932[
i][0] != 0;
i++)
1665 exp = mbcmbb_932[
i][1];
1672 struct katakana_pair {
1676 static const struct katakana_pair
tests[] = {
1709 for(
i = 0;
i < 0x10000;
i++) {
1720 ok(!
err,
"_ismbclegal (932) : Expected 0x%x, got 0x%x (0x%x)\n",
exp,
ret,
i);
1723 for(
i = 0;
i < 0x10000;
i++) {
1732 ok(!
err,
"_ismbclegal (936) : Expected 0x%x, got 0x%x (0x%x)\n",
exp,
ret,
i);
1735 for(
i = 0;
i < 0x10000;
i++) {
1744 ok(!
err,
"_ismbclegal (949) : Expected 0x%x, got 0x%x (0x%x)\n",
exp,
ret,
i);
1747 for(
i = 0;
i < 0x10000;
i++) {
1757 ok(!
err,
"_ismbclegal (950) : Expected 0x%x, got 0x%x (0x%x)\n",
exp,
ret,
i);
1760 for(
i = 0;
i < 0x10000;
i++) {
1777static const struct {
1787 {
"red cabernet",
" ", 0, 4, -1 },
1788 {
"sparkling white riesling",
" ", 0, 10, 16 },
1789 {
" pale cream sherry",
"e ", 1, 6, 9 },
1804 "string (%p) \'%s\' return %p\n",
1806 if( !strret)
continue;
1810 "second call string (%p) \'%s\' return %p\n",
1812 if( !strret)
continue;
1816 "third call string (%p) \'%s\' return %p\n",
1820 strcpy( teststr,
"test a=b" );
1821 strret =
strtok( teststr,
" " );
1822 ok( strret == teststr,
"strret = %p, expected %p\n", strret, teststr );
1824 ok( !strret,
"strret = %p, expected NULL\n", strret );
1826 ok( !strret,
"strret = %p, expected NULL\n", strret );
1831 static char neg[] =
"-0x";
1841 ok(
l==-1234,
"wrong value %ld\n",
l);
1845 ok(ul==1234,
"wrong value %lu\n", ul);
1850 ok(
l==2147483647,
"wrong value %ld\n",
l);
1854 ok(
l==-2147483647L - 1,
"wrong value %ld\n",
l);
1857 ul =
strtoul(
"4294967295UL", &
e, 0);
1858 ok(ul==4294967295ul,
"wrong value %lu\n", ul);
1862 l =
strtol(
"9223372036854775807L", &
e, 0);
1863 ok(
l==2147483647,
"wrong value %ld\n",
l);
1866 ul =
strtoul(
"9223372036854775807L", &
e, 0);
1867 ok(ul==4294967295ul,
"wrong value %lu\n", ul);
1872 ok(ul == -2,
"wrong value %lu\n", ul);
1877 ok(ul == 2,
"wrong value %lu\n", ul);
1882 ok(ul==1,
"wrong value %lu\n", ul);
1887 ok(ul == 1,
"wrong value %lu\n", ul);
1892 ok(
l == 0,
"wrong value %ld\n",
l);
1894 ok(
e == neg,
"e = %p, neg = %p\n",
e, neg);
1899 static const char str[] =
"string";
1907 res = p_strnlen(
str, 20);
1908 ok(
res == 6,
"Returned length = %d\n", (
int)
res);
1911 ok(
res == 3,
"Returned length = %d\n", (
int)
res);
1914 ok(
res == 0,
"Returned length = %d\n", (
int)
res);
1919 static const char no1[] =
"31923";
1920 static const char no2[] =
"-213312";
1921 static const char no3[] =
"12aa";
1922 static const char no4[] =
"abc12";
1923 static const char overflow[] =
"99999999999999999999";
1924 static const char neg_overflow[] =
"-99999999999999999999";
1925 static const char hex[] =
"0x123";
1926 static const char oct[] =
"000123";
1927 static const char blanks[] =
" 12 212.31";
1933 if(!p_strtoi64 || !p_strtoui64) {
1934 win_skip(
"_strtoi64 or _strtoui64 not found\n");
1939 res = p_strtoi64(no1,
NULL, 10);
1940 ok(
res == 31923,
"res != 31923\n");
1941 res = p_strtoi64(no2,
NULL, 10);
1942 ok(
res == -213312,
"res != -213312\n");
1943 res = p_strtoi64(no3,
NULL, 10);
1944 ok(
res == 12,
"res != 12\n");
1945 res = p_strtoi64(no4, &endpos, 10);
1946 ok(
res == 0,
"res != 0\n");
1947 ok(endpos == no4,
"Scanning was not stopped on first character\n");
1948 res = p_strtoi64(
hex, &endpos, 10);
1949 ok(
res == 0,
"res != 0\n");
1950 ok(endpos ==
hex+1,
"Incorrect endpos (%p-%p)\n",
hex, endpos);
1951 res = p_strtoi64(
oct, &endpos, 10);
1952 ok(
res == 123,
"res != 123\n");
1954 res = p_strtoi64(blanks, &endpos, 10);
1955 ok(
res == 12,
"res != 12\n");
1956 ok(endpos == blanks+10,
"Incorrect endpos (%p-%p)\n", blanks, endpos);
1960 res = p_strtoi64(overflow, &endpos, 10);
1962 ok(endpos == overflow+
strlen(overflow),
"Incorrect endpos (%p-%p)\n", overflow, endpos);
1966 res = p_strtoi64(neg_overflow, &endpos, 10);
1968 ok(endpos == neg_overflow+
strlen(neg_overflow),
"Incorrect endpos (%p-%p)\n", neg_overflow, endpos);
1972 res = p_strtoi64(no1, &endpos, 16);
1973 ok(
res == 203043,
"res != 203043\n");
1974 ok(endpos == no1+
strlen(no1),
"Incorrect endpos (%p-%p)\n", no1, endpos);
1975 res = p_strtoi64(no2, &endpos, 16);
1976 ok(
res == -2175762,
"res != -2175762\n");
1977 ok(endpos == no2+
strlen(no2),
"Incorrect endpos (%p-%p)\n", no2, endpos);
1978 res = p_strtoi64(no3, &endpos, 16);
1979 ok(
res == 4778,
"res != 4778\n");
1980 ok(endpos == no3+
strlen(no3),
"Incorrect endpos (%p-%p)\n", no3, endpos);
1981 res = p_strtoi64(no4, &endpos, 16);
1982 ok(
res == 703506,
"res != 703506\n");
1983 ok(endpos == no4+
strlen(no4),
"Incorrect endpos (%p-%p)\n", no4, endpos);
1984 res = p_strtoi64(
hex, &endpos, 16);
1985 ok(
res == 291,
"res != 291\n");
1987 res = p_strtoi64(
oct, &endpos, 16);
1988 ok(
res == 291,
"res != 291\n");
1990 res = p_strtoi64(blanks, &endpos, 16);
1991 ok(
res == 18,
"res != 18\n");
1992 ok(endpos == blanks+10,
"Incorrect endpos (%p-%p)\n", blanks, endpos);
1996 res = p_strtoi64(
hex, &endpos, 36);
1997 ok(
res == 1541019,
"res != 1541019\n");
2002 res = p_strtoi64(no1, &endpos, 0);
2003 ok(
res == 31923,
"res != 31923\n");
2004 ok(endpos == no1+
strlen(no1),
"Incorrect endpos (%p-%p)\n", no1, endpos);
2005 res = p_strtoi64(no2, &endpos, 0);
2006 ok(
res == -213312,
"res != -213312\n");
2007 ok(endpos == no2+
strlen(no2),
"Incorrect endpos (%p-%p)\n", no2, endpos);
2008 res = p_strtoi64(no3, &endpos, 10);
2009 ok(
res == 12,
"res != 12\n");
2010 ok(endpos == no3+2,
"Incorrect endpos (%p-%p)\n", no3, endpos);
2011 res = p_strtoi64(no4, &endpos, 10);
2012 ok(
res == 0,
"res != 0\n");
2013 ok(endpos == no4,
"Incorrect endpos (%p-%p)\n", no4, endpos);
2014 res = p_strtoi64(
hex, &endpos, 10);
2015 ok(
res == 0,
"res != 0\n");
2016 ok(endpos ==
hex+1,
"Incorrect endpos (%p-%p)\n",
hex, endpos);
2017 res = p_strtoi64(
oct, &endpos, 10);
2018 ok(
res == 123,
"res != 123\n");
2020 res = p_strtoi64(blanks, &endpos, 10);
2021 ok(
res == 12,
"res != 12\n");
2022 ok(endpos == blanks+10,
"Incorrect endpos (%p-%p)\n", blanks, endpos);
2026 ures = p_strtoui64(no1, &endpos, 0);
2027 ok(ures == 31923,
"ures != 31923\n");
2028 ok(endpos == no1+
strlen(no1),
"Incorrect endpos (%p-%p)\n", no1, endpos);
2029 ures = p_strtoui64(no2, &endpos, 0);
2030 ok(ures == -213312,
"ures != -213312\n");
2031 ok(endpos == no2+
strlen(no2),
"Incorrect endpos (%p-%p)\n", no2, endpos);
2032 ures = p_strtoui64(no3, &endpos, 10);
2033 ok(ures == 12,
"ures != 12\n");
2034 ok(endpos == no3+2,
"Incorrect endpos (%p-%p)\n", no3, endpos);
2035 ures = p_strtoui64(no4, &endpos, 10);
2036 ok(ures == 0,
"ures != 0\n");
2037 ok(endpos == no4,
"Incorrect endpos (%p-%p)\n", no4, endpos);
2038 ures = p_strtoui64(
hex, &endpos, 10);
2039 ok(ures == 0,
"ures != 0\n");
2040 ok(endpos ==
hex+1,
"Incorrect endpos (%p-%p)\n",
hex, endpos);
2041 ures = p_strtoui64(
oct, &endpos, 10);
2042 ok(ures == 123,
"ures != 123\n");
2044 ures = p_strtoui64(blanks, &endpos, 10);
2045 ok(ures == 12,
"ures != 12\n");
2046 ok(endpos == blanks+10,
"Incorrect endpos (%p-%p)\n", blanks, endpos);
2050 ures = p_strtoui64(overflow, &endpos, 10);
2052 ok(endpos == overflow+
strlen(overflow),
"Incorrect endpos (%p-%p)\n", overflow, endpos);
2056 ures = p_strtoui64(neg_overflow, &endpos, 10);
2057 ok(ures == 1,
"ures != 1\n");
2058 ok(endpos == neg_overflow+
strlen(neg_overflow),
"Incorrect endpos (%p-%p)\n", neg_overflow, endpos);
2081 static const struct {
2087 {
"12.1", 4, 12.1 },
2088 {
"-13.721", 7, -13.721 },
2090 {
".21e12", 6, 210000000000.0 },
2091 {
"214353e-3", 9, 214.353 },
2093 {
"12.1d2", 6, 12.1e2 },
2096 {
"-0.1", 4, -0.1 },
2097 {
"0.1281832188491894198128921", 27, 0.1281832188491894198128921 },
2098 {
"0.82181281288121", 16, 0.82181281288121 },
2099 {
"21921922352523587651128218821", 29, 21921922352523587651128218821.0 },
2100 {
"0.1d238", 7, 0.1e238 },
2101 {
"0.1D-4736", 9, 0,
ERANGE },
2102 {
"3.4028234663852887e38", 21,
FLT_MAX },
2103 {
"1.1754943508222875e-38", 22,
FLT_MIN },
2104 {
"1.7976931348623158e+308", 23,
DBL_MAX },
2106 {
"2.2250738585072014e-308", 23,
DBL_MIN },
2107 {
"-1.7976931348623158e+308", 24, -
DBL_MAX },
2115 const char overflow[] =
"1d9999999999999999999";
2124 if ((
i == 19) && IsReactOS())
2126 skip(
"Skipping i == 19, because it crashes on ReactOS\n");
2136 "%d) errno = %d\n",
i,
errno);
2145 ok(
d == 0.0,
"d = %.16e\n",
d);
2149 end = (
char *)0xdeadbeef;
2151 ok(
d == 0.0,
"d = %.16e\n",
d);
2153 ok(!
end,
"incorrect end ptr %p\n",
end);
2157 ok(
d == 0.0,
"d = %.16e\n",
d);
2163 win_skip(
"system with limited locales\n");
2168 ok(
d == 12.0,
"d = %.16e\n",
d);
2171 ok(
d == 12.1,
"d = %.16e\n",
d);
2178 ok(
end == overflow+21,
"incorrect end (%d)\n", (
int)(
end-overflow));
2187 static const wchar_t wSimple[] =
L"text";
2188 static const wchar_t wHiragana[] =
L"\x3042\x3043";
2189 static const char mSimple[] =
"text";
2190 static const char mHiragana[] = { 0x82,0xa0,0x82,0xa1,0 };
2192 const wchar_t *pwstr;
2200 wOut[4] =
'!'; wOut[5] =
'\0';
2201 mOut[4] =
'!'; mOut[5] =
'\0';
2207 ok(
ret == -1,
"mbstowcs did not return -1\n");
2212 ok(
ret == 4,
"mbstowcs did not return 4\n");
2215 ok(
ret == 4,
"mbstowcs did not return 4\n");
2217 ok(wOut[4] ==
'!',
"wOut[4] != \'!\'\n");
2220 ok(
ret == 0,
"mbstowcs did not return 0, got %d\n", (
int)
ret);
2223 ok(
ret == 0,
"mbstowcs did not return 0, got %d\n", (
int)
ret);
2227 ok(
ret == 4,
"wcstombs did not return 4\n");
2230 ok(
ret == 4,
"wcstombs did not return 4\n");
2231 ok(!
memcmp(mOut, mSimple, 5*
sizeof(
char)),
"mOut = %s\n", mOut);
2234 ok(
ret == 2,
"wcstombs did not return 2\n");
2235 ok(!
memcmp(mOut, mSimple, 5*
sizeof(
char)),
"mOut = %s\n", mOut);
2238 ok(
ret == 0,
"wcstombs did not return 0, got %d\n", (
int)
ret);
2241 ok(
ret == 0,
"wcstombs did not return 0, got %d\n", (
int)
ret);
2242 ok(!mOut[0],
"mOut = %s\n", mOut);
2247 ret = pwcsrtombs(mOut, &pwstr, 4, &
err);
2248 ok(
ret == 4,
"wcsrtombs did not return 4\n");
2250 ok(pwstr == wSimple+4,
"pwstr = %p (wszSimple = %p)\n", pwstr, wSimple);
2251 ok(!
memcmp(mOut, mSimple,
ret),
"mOut = %s\n", mOut);
2254 ret = pwcsrtombs(mOut, &pwstr, 5,
NULL);
2255 ok(
ret == 4,
"wcsrtombs did not return 4\n");
2256 ok(pwstr ==
NULL,
"pwstr != NULL\n");
2257 ok(!
memcmp(mOut, mSimple,
sizeof(mSimple)),
"mOut = %s\n", mOut);
2261 win_skip(
"Japanese_Japan.932 locale not available\n");
2266 ok(
ret == 2,
"mbstowcs did not return 2\n");
2270 ok(
ret == 0,
"mbstowcs did not return 0, got %d\n", (
int)
ret);
2275 ok(
ret == -1,
"mbstowcs did not return -1\n");
2279 ok(
ret == 4,
"wcstombs did not return 4\n");
2280 ok(!
memcmp(mOut, mHiragana,
sizeof(mHiragana)),
"mOut = %s\n", mOut);
2283 ok(
ret == 0,
"wcstombs did not return 0, got %d\n", (
int)
ret);
2284 ok(!mOut[0],
"mOut = %s\n", mOut);
2286 if(!pmbstowcs_s || !pwcstombs_s) {
2288 win_skip(
"mbstowcs_s or wcstombs_s not available\n");
2294 ok(
ret == 1,
"mbstowcs_s did not return 0\n");
2295 ok(!wOut[0],
"wOut[0] = %d\n", wOut[0]);
2299 ok(
ret == 5,
"mbstowcs_s did not return 5\n");
2304 ok(
ret == 3,
"mbstowcs_s did not return 3\n");
2309 ok(
ret == 1,
"mbstowcs_s did not return 1, got %d\n", (
int)
ret);
2312 err = pmbstowcs_s(&
ret,
NULL, 0, mHiragana, 1);
2314 ok(
ret == 3,
"mbstowcs_s did not return 3\n");
2318 ok(
ret == 5,
"wcstombs_s did not return 5\n");
2319 ok(!
memcmp(mOut, mSimple,
sizeof(mSimple)),
"mOut = %s\n", mOut);
2323 ok(
ret == 5,
"wcstombs_s did not return 5\n");
2324 ok(!
memcmp(mOut, mHiragana,
sizeof(mHiragana)),
"mOut = %s\n", mOut);
2328 ok(
ret == 1,
"wcstombs_s did not return 1, got %d\n", (
int)
ret);
2329 ok(!mOut[0],
"mOut = %s\n", mOut);
2331 err = pwcstombs_s(&
ret,
NULL, 0, wHiragana, 1);
2333 ok(
ret == 5,
"wcstombs_s did not return 5\n");
2337 win_skip(
"wcsrtombs not available\n");
2343 ret = pwcsrtombs(mOut, &pwstr, 4, &
err);
2344 ok(
ret == 4,
"wcsrtombs did not return 4\n");
2346 ok(pwstr == wSimple+4,
"pwstr = %p (wszSimple = %p)\n", pwstr, wSimple);
2347 ok(!
memcmp(mOut, mSimple,
ret),
"mOut = %s\n", mOut);
2350 ret = pwcsrtombs(mOut, &pwstr, 5,
NULL);
2351 ok(
ret == 4,
"wcsrtombs did not return 4\n");
2352 ok(pwstr ==
NULL,
"pwstr != NULL\n");
2353 ok(!
memcmp(mOut, mSimple,
sizeof(mSimple)),
"mOut = %s\n", mOut);
2357 win_skip(
"mbsrtowcs not available\n");
2363 ok(
ret == 2,
"mbsrtowcs did not return 2\n");
2364 ok(pmbstr == mHiragana,
"pmbstr = %p, expected %p\n", pmbstr, mHiragana);
2367 ret = p_mbsrtowcs(wOut, &pmbstr, 6,
NULL);
2368 ok(
ret == 2,
"mbsrtowcs did not return 2\n");
2370 ok(!pmbstr,
"pmbstr != NULL\n");
2372 state = mHiragana[0];
2373 pmbstr = mHiragana+1;
2374 ret = p_mbsrtowcs(wOut, &pmbstr, 6, &
state);
2375 ok(
ret == 2,
"mbsrtowcs did not return 2\n");
2376 ok(wOut[0] == 0x3042,
"wOut[0] = %x\n", wOut[0]);
2377 ok(wOut[1] == 0xff61,
"wOut[1] = %x\n", wOut[1]);
2378 ok(wOut[2] == 0,
"wOut[2] = %x\n", wOut[2]);
2379 ok(!pmbstr,
"pmbstr != NULL\n");
2383 ok(
ret == -1,
"mbsrtowcs did not return -1\n");
2386 if(!p_mbsrtowcs_s) {
2388 win_skip(
"mbsrtowcs_s not available\n");
2394 ok(
ret == -1,
"mbsrtowcs_s did not return -1\n");
2397 ok(
ret == -1,
"mbsrtowcs_s did not return -1\n");
2399 err = p_mbsrtowcs_s(&
ret, wOut, 0, &pmbstr, 6,
NULL);
2400 ok(
ret == -1,
"mbsrtowcs_s did not return -1\n");
2406 ok(
ret == 3,
"mbsrtowcs_s did not return 3\n");
2408 ok(pmbstr == mHiragana,
"pmbstr = %p, expected %p\n", pmbstr, mHiragana);
2412 err = p_mbsrtowcs_s(&
ret, wOut, 1, &pmbstr, 6,
NULL);
2413 ok(
ret == 2,
"mbsrtowcs_s did not return 2\n");
2415 ok(!wOut[0],
"wOut[0] = '%c'\n", wOut[0]);
2416 ok(pmbstr == mHiragana+2,
"pmbstr = %p, expected %p\n", pmbstr, mHiragana+2);
2420 err = p_mbsrtowcs_s(&
ret, wOut, 2, &pmbstr, 6,
NULL);
2421 ok(
ret == 3,
"mbsrtowcs_s did not return 3\n");
2423 ok(!wOut[0],
"wOut[0] = '%c'\n", wOut[0]);
2424 ok(pmbstr == mHiragana+4,
"pmbstr = %p, expected %p\n", pmbstr, mHiragana+4);
2428 err = p_mbsrtowcs_s(&
ret, wOut, 3, &pmbstr, 6,
NULL);
2429 ok(
ret == 3,
"mbsrtowcs_s did not return 3\n");
2431 ok(!pmbstr,
"pmbstr != NULL\n");
2440 const wchar_t *wstr;
2457 {
L"", 0,
NULL, 0, 1, 0,
"English_United States.1252" },
2458 {
L"\xfffd", 1,
NULL, 0, 0,
EILSEQ,
"English_United States.1252" },
2459 {
L"\xfffd", 1,
"", 1, 0,
EILSEQ,
"English_United States.1252" },
2460 {
L"\xfffd", 1,
"", 6, 0,
EILSEQ,
"English_United States.1252" },
2461 {
L"text",
_TRUNCATE,
"text", 5, 5, 0,
"English_United States.1252" },
2463 {
L"text", 5,
"", 3, 0,
ERANGE,
"English_United States.1252" },
2471 if(!p__create_locale) {
2472 win_skip(
"_create_locale not available\n");
2496 "%d: expected out %s, got %s for '%s' in locale %s\n",
i,
tests[
i].
str,
out,
2509 win_skip(
"Skipping _gcvt tests\n");
2528 err = p_gcvt_s(
buf, 5, 1.2, 10);
2530 ok(
buf[0] ==
'\0',
"buf[0] = %c\n",
buf[0]);
2533 err = p_gcvt_s(
buf, 4, 123456, 2);
2535 ok(
buf[0] ==
'\0',
"buf[0] = %c\n",
buf[0]);
2545 win_skip(
"Skipping _itoa_s tests\n");
2550 ret = p_itoa_s(0,
NULL, 0, 0);
2551 ok(
ret ==
EINVAL,
"Expected _itoa_s to return EINVAL, got %d\n",
ret);
2557 ok(
ret ==
EINVAL,
"Expected _itoa_s to return EINVAL, got %d\n",
ret);
2559 ok(
buffer[0] ==
'X',
"Expected the output buffer to be untouched\n");
2564 ok(
ret ==
EINVAL,
"Expected _itoa_s to return EINVAL, got %d\n",
ret);
2566 ok(
buffer[0] ==
'\0',
"Expected the output buffer to be null terminated\n");
2571 ok(
ret ==
EINVAL,
"Expected _itoa_s to return EINVAL, got %d\n",
ret);
2573 ok(
buffer[0] ==
'\0',
"Expected the output buffer to be null terminated\n");
2577 ret = p_itoa_s(12345678,
buffer, 4, 10);
2578 ok(
ret ==
ERANGE,
"Expected _itoa_s to return ERANGE, got %d\n",
ret);
2581 "Expected the output buffer to be null terminated with truncated output\n");
2585 ret = p_itoa_s(12345678,
buffer, 8, 10);
2586 ok(
ret ==
ERANGE,
"Expected _itoa_s to return ERANGE, got %d\n",
ret);
2589 "Expected the output buffer to be null terminated with truncated output\n");
2593 ret = p_itoa_s(-12345678,
buffer, 9, 10);
2594 ok(
ret ==
ERANGE,
"Expected _itoa_s to return ERANGE, got %d\n",
ret);
2597 "Expected the output buffer to be null terminated with truncated output\n");
2599 ret = p_itoa_s(12345678,
buffer, 9, 10);
2600 ok(
ret == 0,
"Expected _itoa_s to return 0, got %d\n",
ret);
2602 "Expected output buffer string to be \"12345678\", got \"%s\"\n",
2606 ok(
ret == 0,
"Expected _itoa_s to return 0, got %d\n",
ret);
2608 "Expected output buffer string to be \"1010101010101010\", got \"%s\"\n",
2612 ok(
ret == 0,
"Expected _itoa_s to return 0, got %d\n",
ret);
2614 "Expected output buffer string to be \"nell\", got \"%s\"\n",
2618 ok(
ret == 0,
"Expected _itoa_s to return 0, got %d\n",
ret);
2620 "Expected output buffer string to be \"hag\", got \"%s\"\n",
2624 ok(
ret == 0,
"Expected _itoa_s to return 0, got %d\n",
ret);
2626 "Expected output buffer string to be \"-12345678\", got \"%s\"\n",
2631 "Expected output buffer string to be \"10\", got \"%s\"\n",
buffer);
2641 win_skip(
"Skipping _strlwr_s tests\n");
2647 ok(
ret ==
EINVAL,
"Expected _strlwr_s to return EINVAL, got %d\n",
ret);
2652 ok(
ret ==
EINVAL,
"Expected _strlwr_s to return EINVAL, got %d\n",
ret);
2657 ok(
ret ==
EINVAL,
"Expected _strlwr_s to return EINVAL, got %d\n",
ret);
2663 ok(
ret ==
EINVAL,
"Expected _strlwr_s to return EINVAL, got %d\n",
ret);
2666 "Expected the output buffer to be \"\\0oRrIsTeR\"\n");
2670 ret = p_strlwr_s(
buffer,
sizeof(
"GoRrIsTeR") - 1);
2671 ok(
ret ==
EINVAL,
"Expected _strlwr_s to return EINVAL, got %d\n",
ret);
2674 "Expected the output buffer to be \"\\0oRrIsTeR\"\n");
2677 ret = p_strlwr_s(
buffer,
sizeof(
"GoRrIsTeR"));
2678 ok(
ret == 0,
"Expected _strlwr_s to return 0, got %d\n",
ret);
2680 "Expected the output buffer to be \"gorrister\", got \"%s\"\n",
2683 memcpy(
buffer,
"GoRrIsTeR\0ELLEN",
sizeof(
"GoRrIsTeR\0ELLEN"));
2685 ok(
ret == 0,
"Expected _strlwr_s to return 0, got %d\n",
ret);
2686 ok(!
memcmp(
buffer,
"gorrister\0ELLEN",
sizeof(
"gorrister\0ELLEN")),
2687 "Expected the output buffer to be \"gorrister\\0ELLEN\", got \"%s\"\n",
2690 ret = p_strlwr_s((
char *)
"already_lowercase",
sizeof(
"already_lowercase"));
2691 ok(
ret == 0,
"Expected _strlwr_s to return 0, got %d\n",
ret);
2702 win_skip(
"skipping wcsncat_s tests\n");
2712 ok(
dst[0] ==
'a',
"dst %x\n",
dst[0]);
2723 ok(
dst[0] ==
'a',
"dst %x\n",
dst[0]);
2749 win_skip(
"skipping wcsncat_s tests\n");
2759 ok(
dst[0] ==
'a',
"dst %x\n",
dst[0]);
2762 ok(
dst[0] ==
'a',
"dst %x\n",
dst[0]);
2771 ok(
dst[0] ==
'a',
"dst %x\n",
dst[0]);
2791 unsigned char dest[16];
2792 const unsigned char first[] =
"dinosaur";
2793 const unsigned char second[] =
"duck";
2798 win_skip(
"Skipping _mbsnbcat_s tests\n");
2804 ok(
ret == 0,
"Expected _mbsnbcat_s to return 0, got %d\n",
ret);
2808 ok(
ret ==
EINVAL,
"Expected _mbsnbcat_s to return EINVAL, got %d\n",
ret);
2813 ok(
ret ==
EINVAL,
"Expected _mbsnbcat_s to return EINVAL, got %d\n",
ret);
2819 ok(
ret ==
EINVAL,
"Expected _mbsnbcat_s to return EINVAL, got %d\n",
ret);
2821 ok(
dest[0] ==
'X',
"Expected the output buffer to be untouched\n");
2825 ret = p_mbsnbcat_s(
dest, 0, second, 0);
2826 ok(
ret ==
EINVAL,
"Expected _mbsnbcat_s to return EINVAL, got %d\n",
ret);
2828 ok(
dest[0] ==
'X',
"Expected the output buffer to be untouched\n");
2833 ok(
ret ==
EINVAL,
"Expected _mbsnbcat_s to return EINVAL, got %d\n",
ret);
2835 ok(
dest[0] ==
'\0',
"Expected the output buffer to be null terminated\n");
2840 ok(
ret ==
EINVAL,
"Expected _mbsnbcat_s to return EINVAL, got %d\n",
ret);
2842 ok(
dest[0] ==
'\0',
"Expected the output buffer to be null terminated\n");
2846 ret = p_mbsnbcat_s(
dest,
sizeof(
dest), second,
sizeof(second));
2847 ok(
ret == 0,
"Expected _mbsnbcat_s to return 0, got %d\n",
ret);
2849 "Expected the output buffer string to be \"duck\"\n");
2854 ret = p_mbsnbcat_s(
dest,
sizeof(
dest), second, 0);
2855 ok(
ret == 0,
"Expected _mbsnbcat_s to return 0, got %d\n",
ret);
2857 "Expected the output buffer string to be \"dinosaur\"\n");
2861 ret = p_mbsnbcat_s(
dest,
sizeof(
dest), second,
sizeof(second));
2862 ok(
ret == 0,
"Expected _mbsnbcat_s to return 0, got %d\n",
ret);
2863 ok(!
memcmp(
dest,
"dinosaurduck",
sizeof(
"dinosaurduck")),
2864 "Expected the output buffer string to be \"dinosaurduck\"\n");
2868 ret = p_mbsnbcat_s(
dest,
sizeof(
dest), second,
sizeof(second) + 1);
2869 ok(
ret == 0,
"Expected _mbsnbcat_s to return 0, got %d\n",
ret);
2870 ok(!
memcmp(
dest,
"dinosaurduck",
sizeof(
"dinosaurduck")),
2871 "Expected the output buffer string to be \"dinosaurduck\"\n");
2875 ret = p_mbsnbcat_s(
dest,
sizeof(
dest), second,
sizeof(second) - 1);
2876 ok(
ret == 0,
"Expected _mbsnbcat_s to return 0, got %d\n",
ret);
2877 ok(!
memcmp(
dest,
"dinosaurduck",
sizeof(
"dinosaurduck")),
2878 "Expected the output buffer string to be \"dinosaurduck\"\n");
2882 ret = p_mbsnbcat_s(
dest,
sizeof(
dest), second,
sizeof(second) - 2);
2883 ok(
ret == 0,
"Expected _mbsnbcat_s to return 0, got %d\n",
ret);
2884 ok(!
memcmp(
dest,
"dinosaurduc",
sizeof(
"dinosaurduc")),
2885 "Expected the output buffer string to be \"dinosaurduc\"\n");
2891 ret = p_mbsnbcat_s(
dest,
sizeof(
first) - 1, second,
sizeof(second));
2892 ok(
ret ==
EINVAL,
"Expected _mbsnbcat_s to return EINVAL, got %d\n",
ret);
2894 ok(!
memcmp(
dest,
"\0inosaur",
sizeof(
"\0inosaur") - 1),
2895 "Expected the output buffer string to be \"\\0inosaur\" without ending null terminator\n");
2900 ret = p_mbsnbcat_s(
dest,
sizeof(
first), second,
sizeof(second));
2901 ok(
ret ==
ERANGE,
"Expected _mbsnbcat_s to return ERANGE, got %d\n",
ret);
2903 ok(!
memcmp(
dest,
"\0inosaurd",
sizeof(
"\0inosaurd") - 1),
2904 "Expected the output buffer string to be \"\\0inosaurd\" without ending null terminator\n");
2909 ret = p_mbsnbcat_s(
dest,
sizeof(
first) + 1, second,
sizeof(second));
2910 ok(
ret ==
ERANGE,
"Expected _mbsnbcat_s to return ERANGE, got %d\n",
ret);
2912 ok(!
memcmp(
dest,
"\0inosaurdu",
sizeof(
"\0inosaurdu") - 1),
2913 "Expected the output buffer string to be \"\\0inosaurdu\" without ending null terminator\n");
2919 unsigned char buffer[20];
2924 win_skip(
"Skipping _mbsupr_s tests\n");
2930 ok(
ret == 0,
"Expected _mbsupr_s to return 0, got %d\n",
ret);
2934 ok(
ret ==
EINVAL,
"Expected _mbsupr_s to return EINVAL, got %d\n",
ret);
2939 ok(
ret ==
EINVAL,
"Expected _mbsupr_s to return EINVAL, got %d\n",
ret);
2944 ret = p_mbsupr_s(
buffer,
sizeof(
"abcdefgh"));
2945 ok(
ret == 0,
"Expected _mbsupr_s to return 0, got %d\n",
ret);
2947 "Expected the output buffer to be \"ABCDEFGH\", got \"%s\"\n",
2953 ok(
ret == 0,
"Expected _mbsupr_s to return 0, got %d\n",
ret);
2955 "Expected the output buffer to be \"ABCDEFGH\", got \"%s\"\n",
2960 ret = p_mbsupr_s(
buffer,
sizeof(
"abcdefgh") - 1);
2961 ok(
ret ==
EINVAL,
"Expected _mbsupr_s to return EINVAL, got %d\n",
ret);
2964 memcpy(
buffer,
"abcdefgh\0ijklmnop",
sizeof(
"abcdefgh\0ijklmnop"));
2967 ok(
ret == 0,
"Expected _mbsupr_s to return 0, got %d\n",
ret);
2968 ok(!
memcmp(
buffer,
"ABCDEFGH\0ijklmnop",
sizeof(
"ABCDEFGH\0ijklmnop")),
2969 "Expected the output buffer to be \"ABCDEFGH\\0ijklmnop\", got \"%s\"\n",
2973 memcpy(
buffer,
"\xa2\xa1\xa2\xa2q",
sizeof(
"\xa2\xa1\xa2\xa2q"));
2975 ok(
ret == 0,
"Expected _mbsupr_s to return 0, got %d\n",
ret);
2976 ok(!
memcmp(
buffer,
"\xa2\xf1\xa2\xf2Q",
sizeof(
"\xa2\xf1\xa2\xf2Q")),
2984 unsigned char buffer[20];
2989 win_skip(
"Skipping _mbslwr_s tests\n");
2995 ok(
ret == 0,
"Expected _mbslwr_s to return 0, got %d\n",
ret);
2999 ok(
ret ==
EINVAL,
"Expected _mbslwr_s to return EINVAL, got %d\n",
ret);
3004 ok(
ret ==
EINVAL,
"Expected _mbslwr_s to return EINVAL, got %d\n",
ret);
3009 ret = p_mbslwr_s(
buffer,
sizeof(
"ABCDEFGH"));
3010 ok(
ret == 0,
"Expected _mbslwr_s to return 0, got %d\n",
ret);
3012 "Expected the output buffer to be \"abcdefgh\", got \"%s\"\n",
3018 ok(
ret == 0,
"Expected _mbslwr_s to return 0, got %d\n",
ret);
3020 "Expected the output buffer to be \"abcdefgh\", got \"%s\"\n",
3025 ret = p_mbslwr_s(
buffer,
sizeof(
"ABCDEFGH") - 1);
3026 ok(
ret ==
EINVAL,
"Expected _mbslwr_s to return EINVAL, got %d\n",
ret);
3029 memcpy(
buffer,
"ABCDEFGH\0IJKLMNOP",
sizeof(
"ABCDEFGH\0IJKLMNOP"));
3032 ok(
ret == 0,
"Expected _mbslwr_s to return 0, got %d\n",
ret);
3033 ok(!
memcmp(
buffer,
"abcdefgh\0IJKLMNOP",
sizeof(
"abcdefgh\0IJKLMNOP")),
3034 "Expected the output buffer to be \"abcdefgh\\0IJKLMNOP\", got \"%s\"\n",
3038 memcpy(
buffer,
"\xa2\xf1\xa2\xf2Q",
sizeof(
"\xa2\xf1\xa2\xf2Q"));
3040 ok(
ret == 0,
"Expected _mbsupr_s to return 0, got %d\n",
ret);
3041 ok(!
memcmp(
buffer,
"\xa2\xa1\xa2\xa2q",
sizeof(
"\xa2\xa1\xa2\xa2q")),
3048 const unsigned char delim[] =
"t";
3050 char str[] =
"!.!test";
3058 "_mbstok(NULL, \"t\") = %p, expected NULL (%p)\n",
ret,
str);
3061 ok(!
ret,
"_mbstok(NULL, \"t\") = %p, expected NULL\n",
ret);
3071 win_skip(
"Skipping _ultoa_s tests\n");
3076 ret = p_ultoa_s(0,
NULL, 0, 0);
3077 ok(
ret ==
EINVAL,
"Expected _ultoa_s to return EINVAL, got %d\n",
ret);
3083 ok(
ret ==
EINVAL,
"Expected _ultoa_s to return EINVAL, got %d\n",
ret);
3085 ok(
buffer[0] ==
'X',
"Expected the output buffer to be untouched\n");
3090 ok(
ret ==
EINVAL,
"Expected _ultoa_s to return EINVAL, got %d\n",
ret);
3092 ok(
buffer[0] ==
'\0',
"Expected the output buffer to be null terminated\n");
3097 ok(
ret ==
EINVAL,
"Expected _ultoa_s to return EINVAL, got %d\n",
ret);
3099 ok(
buffer[0] ==
'\0',
"Expected the output buffer to be null terminated\n");
3103 ret = p_ultoa_s(12345678,
buffer, 4, 10);
3104 ok(
ret ==
ERANGE,
"Expected _ultoa_s to return ERANGE, got %d\n",
ret);
3107 "Expected the output buffer to be null terminated with truncated output\n");
3111 ret = p_ultoa_s(12345678,
buffer, 8, 10);
3112 ok(
ret ==
ERANGE,
"Expected _ultoa_s to return ERANGE, got %d\n",
ret);
3115 "Expected the output buffer to be null terminated with truncated output\n");
3117 ret = p_ultoa_s(12345678,
buffer, 9, 10);
3118 ok(
ret == 0,
"Expected _ultoa_s to return 0, got %d\n",
ret);
3120 "Expected output buffer string to be \"12345678\", got \"%s\"\n",
3124 ok(
ret == 0,
"Expected _ultoa_s to return 0, got %d\n",
ret);
3126 "Expected output buffer string to be \"1010101010101010\", got \"%s\"\n",
3130 ok(
ret == 0,
"Expected _ultoa_s to return 0, got %d\n",
ret);
3132 "Expected output buffer string to be \"nell\", got \"%s\"\n",
3136 ok(
ret == 0,
"Expected _ultoa_s to return 0, got %d\n",
ret);
3138 "Expected output buffer string to be \"hag\", got \"%s\"\n",
3147 win_skip(
"Skipping wctob tests\n");
3151 ret = p_wctob(0x8141);
3154 ret = p_wctob(0x81);
3157 ret = p_wctob(0xe0);
3158 ok(
ret == 0x61,
"ret = %x\n",
ret);
3161 ret = p_wctob(0x81);
3165 ret = p_wctob(0x8141);
3168 ret = p_wctob(0x81);
3169 ok(
ret == (
signed char)0x81,
"ret = %x\n",
ret);
3171 ret = p_wctob(0x9f);
3172 ok(
ret == (
signed char)0x9f,
"ret = %x\n",
ret);
3174 ret = p_wctob(0xe0);
3175 ok(
ret == (
signed char)0xe0,
"ret = %x\n",
ret);
3186 win_skip(
"Skipping btowc tests\n");
3193 ret = p_btowc(0x61);
3194 ok(
ret == 0x61,
"ret = %x\n",
ret);
3196 ret = p_btowc(0x81);
3199 ret = p_btowc(0xe0);
3203 ret = p_btowc(0x61);
3204 ok(
ret == 0x61,
"ret = %x\n",
ret);
3206 ret = p_btowc(0x81);
3209 ret = p_btowc(0xe0);
3213 win_skip(
"No codepage 1250 support\n");
3219 ret = p_btowc(0x61);
3220 ok(
ret == 0x61,
"ret = %x\n",
ret);
3222 ret = p_btowc(0x81);
3223 ok(
ret == 0x81,
"ret = %x\n",
ret);
3225 ret = p_btowc(0xe0);
3226 ok(
ret == 0x155,
"ret = %x\n",
ret);
3228 ret = p_btowc(0x100);
3229 ok(
ret == 0x00,
"ret = %x\n",
ret);
3231 ret = p_btowc(0x1e0);
3232 ok(
ret == 0x155,
"ret = %x\n",
ret);
3235 ret = p_btowc(0x61);
3236 ok(
ret == 0x61,
"ret = %x\n",
ret);
3238 ret = p_btowc(0x81);
3239 ok(
ret == 0x81,
"ret = %x\n",
ret);
3241 ret = p_btowc(0x9f);
3242 ok(
ret == 0x9f,
"ret = %x\n",
ret);
3244 ret = p_btowc(0xe0);
3245 ok(
ret == 0xe0,
"ret = %x\n",
ret);
3247 ret = p_btowc(0x100);
3248 ok(
ret == 0x00,
"ret = %x\n",
ret);
3250 ret = p_btowc(0x1e0);
3251 ok(
ret == 0xe0,
"ret = %x\n",
ret);
3259 unsigned char dst[10];
3269 ok(
ret == 2,
"wcrtomb did not return 2\n");
3274 ok(
ret == 2,
"wcrtomb did not return 2\n");
3275 ok(
state == 0,
"state != 0\n");
3276 ok(
dst[0] == 0x82,
"dst[0] = %x, expected 0x82\n",
dst[0]);
3277 ok(
dst[1] == 0xa0,
"dst[1] = %x, expected 0xa0\n",
dst[1]);
3278 ok(
dst[2] ==
'a',
"dst[2] != 'a'\n");
3281 ok(
ret == 2,
"wcrtomb did not return 2\n");
3282 ok(
dst[0] == 0x82,
"dst[0] = %x, expected 0x82\n",
dst[0]);
3283 ok(
dst[1] == 0xa1,
"dst[1] = %x, expected 0xa1\n",
dst[1]);
3286 ok(
ret == 1,
"wcrtomb did not return 1\n");
3287 ok(
dst[0] == 0x20,
"dst[0] = %x, expected 0x20\n",
dst[0]);
3290 ok(
ret == -1,
"wcrtomb did not return -1\n");
3291 ok(
dst[0] == 0x3f,
"dst[0] = %x, expected 0x3f\n",
dst[0]);
3303 ok(
ret == 2,
"ret != 2\n");
3305 ok(
dst[0] == 0x82,
"dst[0] = %x, expected 0x82\n",
dst[0]);
3306 ok(
dst[1] == 0xa0,
"dst[1] = %x, expected 0xa0\n",
dst[1]);
3307 ok(
dst[2] ==
'a',
"dst[2] != 'a'\n");
3311 ok(
ret == 2,
"ret != 2\n");
3313 ok(
dst[0] == 0x82,
"dst[0] = %x, expected 0x82\n",
dst[0]);
3314 ok(
dst[1] == 0xa0,
"dst[1] = %x, expected 0xa0\n",
dst[1]);
3318 ok(
ret == 1,
"ret != 1\n");
3319 ok(
dst[0] == 0x20,
"dst[0] = %x, expected 0x20\n",
dst[0]);
3323 ok(
ret == 1,
"ret != 1\n");
3327 ok(
ret == -1,
"wcrtomb did not return -1\n");
3328 ok(
dst[0] == 0x3f,
"dst[0] = %x, expected 0x3f\n",
dst[0]);
3340 ret = p_tolower(0x41);
3341 ok(
ret == 0x61,
"ret = %x\n",
ret);
3343 ret = p_tolower(0xF4);
3344 ok(
ret == 0xF4,
"ret = %x\n",
ret);
3347 ret = p_tolower((
char)0xF4);
3348 ok(
ret == (
char)0xF4,
"ret = %x\n",
ret);
3352 ret = p_tolower((
char)0xD0);
3353 ok(
ret == (
char)0xD0,
"ret = %x\n",
ret);
3358 ret = p_tolower((
char)0xF4);
3359 ok(
ret == (
char)0xF4,
"ret = %x\n",
ret);
3364 win_skip(
"skipping tolower tests that depends on locale\n");
3371 ret = p_tolower((
signed char)ch);
3380 if(!
len ||
ret==(
unsigned char)lch)
3385 ret = p_tolower((
signed char)ch);
3394 if(!
len ||
ret==(
unsigned char)lch)
3397 ret = p_tolower((
unsigned char)0xD0);
3398 ok(
ret == 0xD0,
"ret = %x\n",
ret);
3402 ret = p_tolower((
signed char)0xD0);
3403 ok(
ret == 0xF0,
"ret = %x\n",
ret);
3405 ret = p_tolower((
unsigned char)0xD0);
3406 ok(
ret == 0xF0,
"ret = %x\n",
ret);
3411 ret = p_tolower((
signed char)0xd0);
3412 ok(
ret == 0xd0,
"Got %#x.\n",
ret);
3415 ret = p_tolower(0xd0);
3416 ok(
ret == 0xd0,
"Got %#x.\n",
ret);
3421 ret = p_tolower((
signed char)0xd0);
3422 ok(
ret == (
signed char)0xd0,
"Got %#x.\n",
ret);
3425 ret = p_tolower(0xd0);
3426 ok(
ret == 0xd0,
"Got %#x.\n",
ret);
3431 ret = p_tolower((
signed char)0xd0);
3432 ok(
ret == (
signed char)0xd0,
"Got %#x.\n",
ret);
3435 ret = p_tolower(0xd0);
3436 ok(
ret == 0xd0,
"Got %#x.\n",
ret);
3441 ret = p_tolower((
signed char)0xd0);
3442 ok(
ret == (
signed char)0xd0,
"Got %#x.\n",
ret);
3445 ret = p_tolower(0xd0);
3446 ok(
ret == 0xd0,
"Got %#x.\n",
ret);
3479 win_skip(
"_atodbl_l is not available\n");
3485 ok(
ret == 0,
"_atodbl_l(&d, \"\", NULL) returned %d, expected 0\n",
ret);
3486 ok(
d.x == 0,
"d.x = %lf, expected 0\n",
d.x);
3488 ok(
ret == 0,
"_atodbl(&d, \"\") returned %d, expected 0\n",
ret);
3489 ok(
d.x == 0,
"d.x = %lf, expected 0\n",
d.x);
3493 ok(
ret == 0,
"_atodbl_l(&d, \"t\", NULL) returned %d, expected 0\n",
ret);
3494 ok(
d.x == 0,
"d.x = %lf, expected 0\n",
d.x);
3496 ok(
ret == 0,
"_atodbl(&d, \"t\") returned %d, expected 0\n",
ret);
3497 ok(
d.x == 0,
"d.x = %lf, expected 0\n",
d.x);
3501 ok(
ret == 0,
"_atodbl_l(&d, \"0\", NULL) returned %d, expected 0\n",
ret);
3502 ok(
d.x == 0,
"d.x = %lf, expected 0\n",
d.x);
3504 ok(
ret == 0,
"_atodbl(&d, \"0\") returned %d, expected 0\n",
ret);
3505 ok(
d.x == 0,
"d.x = %lf, expected 0\n",
d.x);
3509 ok(
ret == 0,
"_atodbl_l(&d, \"123\", NULL) returned %d, expected 0\n",
ret);
3510 ok(
d.x == 123,
"d.x = %lf, expected 123\n",
d.x);
3512 ok(
ret == 0,
"_atodbl(&d, \"123\") returned %d, expected 0\n",
ret);
3513 ok(
d.x == 123,
"d.x = %lf, expected 123\n",
d.x);
3517 for (
i = 1;
i <= 9;
i++) {
3519 if (expected < DBL_MIN || expected >
DBL_MAX)
continue;
3529 ok(
ret ==
_UNDERFLOW,
"_atodbl_l(&d, \"1e-309\", NULL) returned %d, expected _UNDERFLOW\n",
ret);
3532 ok(
ret ==
_UNDERFLOW,
"_atodbl(&d, \"1e-309\") returned %d, expected _UNDERFLOW\n",
ret);
3537 ok(
ret ==
_OVERFLOW,
"_atodbl_l(&d, \"1e309\", NULL) returned %d, expected _OVERFLOW\n",
ret);
3539 ok(
ret ==
_OVERFLOW,
"_atodbl(&d, \"1e309\") returned %d, expected _OVERFLOW\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);
3557 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);
3577 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);
3597 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);
3615 ok(
ret > 0,
"_stricmp returned %d\n",
ret);
3626 {
L"-1234", -1234, -1234 },
3627 {
L"\x09\x0a\x0b\x0c\x0d -123", -123, -123 },
3628 {
L"\xa0\x2002\x2003\x2028\x3000 +44", 44, 44 },
3629 { { 0x3231 }, 0, 0 },
3630 { { 0x4e00 }, 0, 0 },
3631 { { 0x0bef }, 0, 0 },
3632 { { 0x0e59 }, 9, 9 },
3633 { { 0xff19 }, 9, 9 },
3634 { { 0x00b9 }, 0, 0 },
3635 { {
'-',0x0e50,
'x',0xff19,
'1' }, -0x91, -0x91 },
3636 { {
'+',0x0e50,0xff17,
'1' }, 071, 071 },
3637 { { 0xff19,
'f',0x0e59,0xff46 }, 0x9f9, 0x9f9, 16 },
3638 {
L"4294967295", 4294967295, 4294967295 },
3639 {
L"4294967296", 4294967296, 4294967296 },
3640 {
L"9223372036854775807", 9223372036854775807, 9223372036854775807 },
3641 {
L"9223372036854775808",
_I64_MAX, 9223372036854775808u },
3644 {
L"-4294967295", -4294967295, -4294967295 },
3645 {
L"-4294967296", -4294967296, -4294967296 },
3646 {
L"-9223372036854775807", -9223372036854775807, -9223372036854775807 },
3647 {
L"-9223372036854775808",
_I64_MIN, 9223372036854775808u },
3648 {
L"-18446744073709551615",
_I64_MIN, 1 },
3649 {
L"-18446744073709551616",
_I64_MIN, 1 },
3651 static const WCHAR zeros[] = {
3652 0x660, 0x6f0, 0x966, 0x9e6, 0xa66, 0xae6, 0xb66, 0xc66, 0xce6,
3653 0xd66, 0xe50, 0xed0, 0xf20, 0x1040, 0x17e0, 0x1810, 0xff10
3661 if (!p_wcstoi64 || !p_wcstoui64) {
3662 win_skip(
"_wcstoi64 or _wcstoui64 not found\n");
3669 if ((
i == 20) && (
_winver < 0x600))
3671 skip(
"Skipping test with i = 20, because it fails on Windows 2003\n");
3680 ok( ures ==
tests[
i].ures,
"%u: %s res %s\n",
3686 WCHAR tmp[] = {zeros[
i] + 4, zeros[
i], zeros[
i] + 5, 0};
3687 res = p_wcstoi64(tmp,
NULL, 0);
3688 ok(
res == 405,
"with zero = U+%04X: got %d, expected 405\n", zeros[
i], (
int)
res);
3689 tmp[1] = zeros[
i] + 10;
3690 res = p_wcstoi64(tmp,
NULL, 16);
3691 ok(
res == 4,
"with zero = U+%04X: got %d, expected 4\n", zeros[
i], (
int)
res);
3701 {
L"-1234", -1234, -1234 },
3702 {
L"\x09\x0a\x0b\x0c\x0d -123", -123, -123 },
3703 {
L"\xa0\x2002\x2003\x2028\x3000 +44", 44, 44 },
3704 { { 0x3231 }, 0, 0 },
3705 { { 0x4e00 }, 0, 0 },
3706 { { 0x0bef }, 0, 0 },
3707 { { 0x0e59 }, 9, 9 },
3708 { { 0xff19 }, 9, 9 },
3709 { { 0x00b9 }, 0, 0 },
3710 { {
'-',0x0e50,
'x',0xff19,
'1' }, -0x91, -0x91 },
3711 { {
'+',0x0e50,0xff17,
'1' }, 071, 071 },
3712 { { 0xff19,
'f',0x0e59,0xff46 }, 0x9f9, 0x9f9, 16 },
3713 {
L"2147483647", 2147483647, 2147483647 },
3714 {
L"2147483648",
LONG_MAX, 2147483648 },
3715 {
L"4294967295",
LONG_MAX, 4294967295 },
3718 {
L"-2147483647", -2147483647, -2147483647 },
3722 {
L"-9223372036854775807",
LONG_MIN, 1 },
3724 static const WCHAR zeros[] = {
3725 0x660, 0x6f0, 0x966, 0x9e6, 0xa66, 0xae6, 0xb66, 0xc66, 0xce6,
3726 0xd66, 0xe50, 0xed0, 0xf20, 0x1040, 0x17e0, 0x1810, 0xff10
3741 ok( ures ==
tests[
i].ures,
"%u: %s res %08lx\n",
3747 WCHAR tmp[] = {zeros[
i] + 4, zeros[
i], zeros[
i] + 5, 0};
3749 ok(
res == 405,
"with zero = U+%04X: got %d, expected 405\n", zeros[
i], (
int)
res);
3750 tmp[1] = zeros[
i] + 10;
3752 ok(
res == 4,
"with zero = U+%04X: got %d, expected 4\n", zeros[
i], (
int)
res);
3761 ok(
r == 0,
"atoi(0) = %d\n",
r);
3764 ok(
r == -1,
"atoi(-1) = %d\n",
r);
3767 ok(
r == 1,
"atoi(1) = %d\n",
r);
3769 r =
atoi(
"4294967296");
3770 ok(
r == 0,
"atoi(4294967296) = %d\n",
r);
3778 ok(
r == 0,
"atol(0) = %d\n",
r);
3781 ok(
r == -1,
"atol(-1) = %d\n",
r);
3784 ok(
r == 1,
"atol(1) = %d\n",
r);
3786 r =
atol(
"4294967296");
3787 ok(
r == 0,
"atol(4294967296) = %d\n",
r);
3795 ok(
d == 0.0,
"d = %lf\n",
d);
3798 ok(
d == 1.0,
"d = %lf\n",
d);
3801 ok(
d == -1.0,
"d = %lf\n",
d);
3811 ok(
d == 0.0,
"d = %lf\n",
d);
3816 ok(
d == 0.0,
"d = %lf\n",
d);
3822#define TEST_STRNCPY_LEN 10
3824 char *(
__cdecl *p_strncpy)(
char*,
const char*,
size_t);
3827 char not_null_terminated[] = {
'0',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0'};
3873 ok(
ret == 3,
"ret = %d\n", (
int)
ret);
3876 ok(
ret == 3,
"ret = %d\n", (
int)
ret);
3877 ok(
dest[0] ==
'a',
"dest[0] = %d\n",
dest[0]);
3881 ok(
ret == 3,
"ret = %d\n", (
int)
ret);
3887 ok(
ret == 3,
"ret = %d\n", (
int)
ret);
3888 ok(
dest[0] ==
's',
"dest[0] = %d\n",
dest[0]);
3889 ok(
dest[1] ==
'a',
"dest[1] = %d\n",
dest[1]);
3893 ok(
ret == 0,
"ret = %d\n", (
int)
ret);
3906 ok(
dest[0] ==
'a',
"dest[0] = %d\n",
dest[0]);
3910 ok(
dest[0],
"dest[0] = 0\n");
3927 win_skip(
"_strnset_s not available\n");
3931 r = p__strnset_s(
NULL, 0,
'a', 0);
3932 ok(
r == 0,
"r = %d\n",
r);
3935 r = p__strnset_s(
buf,
sizeof(
buf),
'a', 2);
3936 ok(
r == 0,
"r = %d\n",
r);
3939 r = p__strnset_s(
buf, 0,
'a', 0);
3942 r = p__strnset_s(
NULL, 0,
'a', 1);
3946 r = p__strnset_s(
buf,
sizeof(
buf)-1,
'c', 2);
3953 wchar_t text[] =
L"text";
3957 win_skip(
"_wcsnset_s not available\n");
3961 r = p__wcsnset_s(
NULL, 0,
'a', 0);
3962 ok(
r == 0,
"r = %d\n",
r);
3964 r = p__wcsnset_s(
text, 0,
'a', 1);
3966 ok(
text[0] ==
't',
"text[0] = %d\n",
text[0]);
3968 r = p__wcsnset_s(
NULL, 2,
'a', 1);
3971 r = p__wcsnset_s(
text, 2,
'a', 3);
3974 ok(
text[1] ==
'e',
"text[1] = %d\n",
text[1]);
3977 r = p__wcsnset_s(
text, 5,
'a', 1);
3978 ok(
r == 0,
"r = %d\n",
r);
3979 ok(
text[0] ==
'a',
"text[0] = %d\n",
text[0]);
3980 ok(
text[1] ==
'e',
"text[1] = %d\n",
text[1]);
3983 r = p__wcsnset_s(
text, 5,
'b', 3);
3984 ok(
r == 0,
"r = %d\n",
r);
3985 ok(
text[0] ==
'b',
"text[0] = %d\n",
text[0]);
3987 ok(
text[2] ==
'x',
"text[2] = %d\n",
text[2]);
3996 win_skip(
"_wcsset_s not available\n");
4000 r = p__wcsset_s(
NULL, 0,
'a');
4004 r = p__wcsset_s(
str, 0,
'a');
4006 ok(
str[0] ==
'a',
"str[0] = %d\n",
str[0]);
4010 r = p__wcsset_s(
str, 2,
'c');
4012 ok(!
str[0],
"str[0] = %d\n",
str[0]);
4013 ok(
str[1] ==
'b',
"str[1] = %d\n",
str[1]);
4018 r = p__wcsset_s(
str, 3,
'c');
4019 ok(
r == 0,
"r = %d\n",
r);
4020 ok(
str[0] ==
'c',
"str[0] = %d\n",
str[0]);
4021 ok(
str[1] == 0,
"str[1] = %d\n",
str[1]);
4022 ok(
str[2] ==
'b',
"str[2] = %d\n",
str[2]);
4027 static const unsigned char a[] = {
'a',0},
b[] = {
'b',0};
4122 static const char *
s1 =
"abc";
4123 static const char *
s2 =
"aBd";
4157 static const char *
s1 =
"abc";
4158 static const char *
s2 =
"aBd";
4163 win_skip(
"_memicmp_l not found.\n");
4170 ok(
errno == 0xdeadbeef,
"errno is %d, expected 0xdeadbeef\n",
errno);
4190 ok(
errno == 0xdeadbeef,
"errno is %d, expected 0xdeadbeef\n",
errno);
4195 ok(
errno == 0xdeadbeef,
"errno is %d, expected 0xdeadbeef\n",
errno);
4200 const char str[] =
"123";
4201 const char *const_p;
4207 ok(
mem !=
NULL,
"VirtualAlloc failed\n");
4213 ok(
p == str2,
"_strupr returned %p\n",
p);
4214 ok(!
strcmp(str2,
"ABC"),
"str2 = %s\n", str2);
4217 ok(
p ==
mem,
"_strupr returned %p\n",
p);
4220 const_p =
"ALREADY_UPPERCASE";
4222 ok(
p == const_p,
"_strupr returned %p\n",
p);
4226 win_skip(
"English locale _strupr tests\n");
4232 ok(
p == str2,
"_strupr returned %p\n",
p);
4233 ok(!
strcmp(str2,
"ABC"),
"str2 = %s\n", str2);
4238 ok(
p ==
mem,
"_strupr returned %p\n",
p);
4256 {
"English",
"ABCD",
"ABCD", 4, 0 },
4257 {
"English",
"ABCD",
"ABCD", 10, 0 },
4259 {
"English",
"ABC",
"ABCD", 3, 0 },
4260 {
"English",
"ABC",
"ABCD", 4, -1 },
4261 {
"English",
"ABC",
"ABCD", 10, -1 },
4263 {
"English",
"ABCD",
"ABC", 3, 0 },
4264 {
"English",
"ABCD",
"ABC", 4, 1 },
4265 {
"English",
"ABCD",
"ABC", 10, 1 },
4267 {
"English",
"ABCe",
"ABCf", 3, 0 },
4268 {
"English",
"abcd",
"ABCD", 10, -1 },
4270 {
"English",
"AB D",
"AB-D", 4, 1 },
4271 {
"English",
"AB D",
"AB'D", 4, 1 },
4273 {
"C",
"ABCD",
"ABCD", 4, 0 },
4274 {
"C",
"ABCD",
"ABCD", 10, 0 },
4276 {
"C",
"ABC",
"ABCD", 3, 0 },
4277 {
"C",
"ABC",
"ABCD", 10, -1 },
4279 {
"C",
"ABCD",
"ABC", 3, 0 },
4280 {
"C",
"ABCD",
"ABC", 10, 1 },
4282 {
"C",
"ABCe",
"ABCf", 3, 0 },
4283 {
"C",
"abcd",
"ABCD", 10, 1 },
4285 {
"C",
"AB D",
"AB-D", 4, -1 },
4286 {
"C",
"AB D",
"AB'D", 4, -1 },
4305 memset(str1, 0xee,
sizeof(str1));
4308 memset(str2, 0xff,
sizeof(str2));
4313 ok(!
ret,
"expected 0, got %d for %s, %s, %d for locale %s\n",
4316 ok(
ret < 0,
"expected < 0, got %d for %s, %s, %d for locale %s\n",
4319 ok(
ret > 0,
"expected > 0, got %d for %s, %s, %d for locale %s\n",
4322 memset(str1W, 0xee,
sizeof(str1W));
4326 memset(str2W, 0xff,
sizeof(str2W));
4332 ok(!
ret,
"expected 0, got %d for %s, %s, %d for locale %s\n",
4335 ok(
ret < 0,
"expected < 0, got %d for %s, %s, %d for locale %s\n",
4338 ok(
ret > 0,
"expected > 0, got %d for %s, %s, %d for locale %s\n",
4352 {
"English",
"ABCD",
"ABCD", 0 },
4353 {
"English",
"ABC",
"ABCD", -1 },
4354 {
"English",
"ABCD",
"ABC", 1 },
4355 {
"English",
"ABCe",
"ABCf", -1 },
4356 {
"English",
"abcd",
"ABCD", -1 },
4357 {
"English",
"AB D",
"AB-D", 1 },
4358 {
"English",
"AB D",
"AB'D", 1 },
4360 {
"C",
"ABCD",
"ABCD", 0 },
4361 {
"C",
"ABC",
"ABCD", -1 },
4362 {
"C",
"ABCD",
"ABC", 1 },
4363 {
"C",
"ABCe",
"ABCf", -1 },
4364 {
"C",
"abcd",
"ABCD", 1 },
4365 {
"C",
"AB D",
"AB-D", -1 },
4366 {
"C",
"AB D",
"AB'D", -1 },
4385 memset(str1, 0xee,
sizeof(str1));
4388 memset(str2, 0xff,
sizeof(str2));
4393 ok(!
ret,
"expected 0, got %d for %s, %s for locale %s\n",
4396 ok(
ret < 0,
"expected < 0, got %d for %s, %s for locale %s\n",
4399 ok(
ret > 0,
"expected > 0, got %d for %s, %s for locale %s\n",
4402 memset(str1W, 0xee,
sizeof(str1W));
4406 memset(str2W, 0xff,
sizeof(str2W));
4412 ok(!
ret,
"expected 0, got %d for %s, %s for locale %s\n",
4415 ok(
ret < 0,
"expected < 0, got %d for %s, %s for locale %s\n",
4418 ok(
ret > 0,
"expected > 0, got %d for %s, %s for locale %s\n",
4433 {
"English",
"abcd",
"ABCD", 4, 0 },
4434 {
"English",
"abcd",
"ABCD", 10, 0 },
4436 {
"English",
"abc",
"ABCD", 3, 0 },
4437 {
"English",
"abc",
"ABCD", 4, -1 },
4438 {
"English",
"abc",
"ABCD", 10, -1 },
4440 {
"English",
"abcd",
"ABC", 3, 0 },
4441 {
"English",
"abcd",
"ABC", 4, 1 },
4442 {
"English",
"abcd",
"ABC", 10, 1 },
4444 {
"English",
"abcE",
"ABCF", 3, 0 },
4446 {
"C",
"abcd",
"ABCD", 4, 0 },
4447 {
"C",
"abcd",
"ABCD", 10, 0 },
4449 {
"C",
"abc",
"ABCD", 3, 0 },
4450 {
"C",
"abc",
"ABCD", 10, -1 },
4452 {
"C",
"abcd",
"ABC", 3, 0 },
4453 {
"C",
"abcd",
"ABC", 10, 1 },
4455 {
"C",
"abce",
"ABCf", 3, 0 },
4474 memset(str1, 0xee,
sizeof(str1));
4477 memset(str2, 0xff,
sizeof(str2));
4484 ok(
ret < 0,
"expected < 0, got %d for %s, %s, %d\n",
ret, str1, str2, (
int)
tests[
i].
count);
4486 ok(
ret > 0,
"expected > 0, got %d for %s, %s, %d\n",
ret, str1, str2, (
int)
tests[
i].
count);
4488 memset(str1W, 0xee,
sizeof(str1W));
4492 memset(str2W, 0xff,
sizeof(str2W));
4500 ok(
ret < 0,
"expected < 0, got %d for %s, %s, %d\n",
ret, str1, str2, (
int)
tests[
i].
count);
4502 ok(
ret > 0,
"expected > 0, got %d for %s, %s, %d\n",
ret, str1, str2, (
int)
tests[
i].
count);
4527 win_skip(
"__strncnt() is not available.\n");
4536 ret = p___strncnt(strncnt_tests[
i].
str, strncnt_tests[
i].
size);
4537 ok(
ret == strncnt_tests[
i].
ret,
"%u: unexpected return value %u.\n",
i, (
int)
ret);
4546 static const char *locales[] = {
NULL,
"C" };
4550 for (
i = 0;
i <= 0xffff;
i++)
4552 ret = p_towlower(
i);
4553 if (
i >=
'A' &&
i <=
'Z')
4555 exp =
i +
'a' -
'A';
4559 ok(
ret ==
i,
"expected self %x, got %x for C locale\n",
i,
ret);
4561 ret = p_towupper(
i);
4562 if (
i >=
'a' &&
i <=
'z')
4564 exp =
i +
'A' -
'a';
4568 ok(
ret ==
i,
"expected self %x, got %x for C locale\n",
i,
ret);
4571 if (!p__towlower_l || !p__towupper_l || !p__create_locale)
4573 win_skip(
"_towlower_l/_towupper_l/_create_locale not available\n");
4580 for (
j = 0;
j <= 0xffff;
j++) {
4582 if (
j >=
'A' &&
j <=
'Z')
4584 exp =
j +
'a' -
'A';
4588 ok(
ret ==
j,
"expected self %x, got %x for C locale\n",
j,
ret);
4591 if (
j >=
'a' &&
j <=
'z')
4593 exp =
j +
'A' -
'a';
4597 ok(
ret ==
j,
"expected self %x, got %x for C locale\n",
j,
ret);
4606 static char long_str[1024];
4615 {
"aabc",
"abc", 1 },
4616 {
"aaaa",
"aaaa", 0 },
4617 {
"simple",
"simple", 0 },
4618 {
"aaaaxaaaaxaaaa",
"aaaaa", -1 },
4619 {
"aaaaxaaaaxaaaaa",
"aaaaa", 10 },
4620 {
"abcabcdababcdabcdabde",
"abcdabd", 13 },
4621 {
"abababababcabababcababbba",
"abababcaba", 4 },
4622 { long_str, long_str+1, 0 }
4624 const char *
r, *
exp;
4627 memset(long_str,
'a',
sizeof(long_str)-1);
4633 ok(
r ==
exp,
"%d) strstr returned %p, expected %p\n",
i,
r,
exp);
4639 static const struct {
4664 ok(
r == -1,
"wcscmp returned %d\n",
r);
4667 ok(
r == 1,
"wcscmp returned %d\n",
r);
4670 ok(!
r,
"wcscmp returned %d\n",
r);
4680 buf[2*
i] =
v->ld[
i] / 16 +
'0';
4681 if(
buf[2*
i] >
'9')
buf[2*
i] -= 10 +
'0' -
'a';
4682 buf[2*
i+1] =
v->ld[
i] % 16 +
'0';
4683 if(
buf[2*
i+1] >
'9')
buf[2*
i+1] -= 10 +
'0' -
'a';
4691 static const struct {
4701 {
"-0.0", 4, 0, {{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80 }} },
4702 {
"1e0", 3, 0, {{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x3f }} },
4703 {
"1.7976931348623158e+308", 23, 0, {{ 0xaf, 0xfb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x43 }} },
4704 {
"1.7976931348623159e+308", 23, 0, {{ 0xb1, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x43 }} },
4705 {
"3.65e-4951", 10, 0, {{ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }} },
4706 {
"1.82e-4951", 10, 0, {{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }},
TRUE },
4707 {
"1e-99999", 8, 1, {{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }} },
4708 {
"1.18e+4932", 10, 0, {{ 0x25, 0x75, 0x06, 0x68, 0x8a, 0xf1, 0xe7, 0xfd, 0xfe, 0x7f }} },
4709 {
"1.19e+4932", 10, 2, {{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f }} },
4710 {
"1e+99999", 8, 2, {{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f }} },
4741 struct test ucases[] = {
4742 {
"English",
'I',
'i'},
4743 {
"English", 0x0130},
4745 {
"Turkish",
'I',
'i'},
4746 {
"Turkish", 0x0130},
4748 struct test lcases[] = {
4749 {
"English",
'i',
'I'},
4750 {
"English", 0x0131},
4752 {
"Turkish",
'i',
'I'},
4753 {
"Turkish", 0x0131},
4758 win_skip(
"skipping special case tests for %s\n", ucases[
i].
lang);
4762 ret = p_towlower(ucases[
i].ch);
4763 exp = ucases[
i].exp ? ucases[
i].exp : ucases[
i].ch;
4764 ok(
ret ==
exp,
"expected lowercase %x, got %x for locale %s\n",
exp,
ret, ucases[
i].
lang);
4769 win_skip(
"skipping special case tests for %s\n", lcases[
i].
lang);
4773 ret = p_towupper(lcases[
i].ch);
4774 exp = lcases[
i].exp ? lcases[
i].exp : lcases[
i].ch;
4775 ok(
ret ==
exp,
"expected uppercase %x, got %x for locale %s\n",
exp,
ret, lcases[
i].
lang);
4780 if (!p__towlower_l || !p__towupper_l || !p__create_locale)
4782 win_skip(
"_towlower_l/_towupper_l/_create_locale not available\n");
4789 win_skip(
"locale %s not available. skipping\n", ucases[
i].
lang);
4794 exp = ucases[
i].exp ? ucases[
i].exp : ucases[
i].ch;
4795 ok(
ret ==
exp,
"expected lowercase %x, got %x for locale %s\n",
exp,
ret, ucases[
i].
lang);
4803 win_skip(
"locale %s not available. skipping\n", lcases[
i].
lang);
4808 exp = lcases[
i].exp ? lcases[
i].exp : lcases[
i].ch;
4809 ok(
ret ==
exp,
"expected uppercase %x, got %x for locale %s\n",
exp,
ret, lcases[
i].
lang);
4818 static const char *test_locales[] =
4822 "English_Australia",
4830 "Portuguese_Brazil",
4832 "Spanish_Argentina",
4845 for (
c = 0;
c < 256; ++
c)
4874 ok(
p ==
dst,
"Unexpected return value.\n");
4881 unsigned char buf[64], *
ret;
4935 static const struct {
4941 {
"\xce\xac",
"ceac" },
4942 {
"\xce\xac\xc4\xe1",
"\xce\xac" },
4943 {
"\xce\xac""abc",
"\xce\xac" },
4944 {
"abc\xce\xac",
"abc" },
4945 {
"\xce\xac\xc4\xe1",
"\xc4\xe1" },
4946 {
"\xce\xac",
"\xc4\xe1" },
4947 {
"\xb8\xdf",
"\xb8\xdb" },
4955 win_skip(
"_strnicmp_l isn't available.\n");
4962 ok(
ret > 0,
"tests[%d]: Got %d.\n",
i,
ret);
4965 ok(
ret < 0,
"tests[%d]: Got %d.\n",
i,
ret);
4968 if (!p__create_locale)
4969 win_skip(
"_create_locale isn't available.\n");
4978 ok(
ret > 0,
"tests[%d]: Got %d.\n",
i,
ret);
4981 ok(
ret < 0,
"tests[%d]: Got %d.\n",
i,
ret);
4989 win_skip(
"Skip testing _strnicmp_l with 936 code page.\n");
4996 ok(
ret > 0,
"tests[%d]: Got %d.\n",
i,
ret);
4999 ok(
ret < 0,
"tests[%d]: Got %d.\n",
i,
ret);
5011 ret = p_toupper((
signed char)0xf0);
5012 ok(
ret == 0xd0,
"Got %#x.\n",
ret);
5015 ret = p_toupper(0xf0);
5016 ok(
ret == 0xd0,
"Got %#x.\n",
ret);
5021 ret = p_toupper((
signed char)0xa5);
5022 ok(
ret == 0xa5,
"Got %#x.\n",
ret);
5025 ret = p_toupper((
signed char)0xb9);
5026 ok(
ret == 0xa5,
"Got %#x.\n",
ret);
5032 ret = p_toupper((
signed char)0xf0);
5033 ok(
ret == (
signed char)0xf0,
"Got %#x.\n",
ret);
5036 ret = p_toupper(0xf0);
5037 ok(
ret == 0xf0,
"Got %#x.\n",
ret);
5042 ret = p_toupper((
signed char)0xf0);
5043 ok(
ret == (
signed char)0xf0,
"Got %#x.\n",
ret);
5046 ret = p_toupper(0xf0);
5047 ok(
ret == 0xf0,
"Got %#x.\n",
ret);
5057 static const char xilstring[]=
"c:/xilinx";
5063 ok(
hMsvcrt != 0,
"GetModuleHandleA failed\n");
5070 SET(p_strcpy,
"strcpy");
5071 SET(p_strcmp,
"strcmp");
5072 SET(p_strncmp,
"strncmp");
5138 "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)
BOOL WINAPI GetCPInfo(UINT codepage, LPCPINFO cpinfo)
INT WINAPI LCMapStringW(LCID lcid, DWORD flags, LPCWSTR src, INT srclen, LPWSTR dst, INT dstlen)
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
_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)
#define todo_wine_if(is_todo)
#define memcpy(s1, s2, n)
static struct test_info tests[]
#define sprintf(buf, format,...)
static struct _PeImage bin
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 const struct @1823 testcases_strtok[]
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 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[]
_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)
_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)