27#define NO_SHLWAPI_PATH
29#define NO_SHLWAPI_STREAM
33#define expect_eq(expr, val, type, fmt) do { \
35 ok(ret == val, "Unexpected value of '" #expr "': " #fmt " instead of " #val "\n", ret); \
38#define expect_eq2(expr, val1, val2, type, fmt) do { \
40 ok(ret == val1 || ret == val2, "Unexpected value of '" #expr "': " #fmt " instead of " #val1 " or " #val2 "\n", ret); \
74 while (*str1 && (*str1 == *str2)) { str1++; str2++; }
88 {
"1099", 1099, 1099, 1099 },
90 {
"+88987", 0, 88987, 88987 },
91 {
"012", 12, 12, 12 },
92 {
"-55", -55, -55, -55 },
94 {
"0x44ff", 0, 0, 0x44ff },
95 {
"0x2bdc546291f4b1", 0, 0, ((
LONGLONG)0x2bdc54 << 32) | 0x6291f4b1 },
96 {
"+0x44f4", 0, 0, 0x44f4 },
97 {
"-0x44fd", 0, 0, 0x44fd },
98 {
"+ 88987", 0, 0, 0 },
101 {
"+ 0x44f4", 0, 0, 0 },
102 {
"--0x44fd", 0, 0, 0 },
103 {
" 1999", 0, 1999, 1999 },
104 {
" +88987", 0, 88987, 88987 },
105 {
" 012", 0, 12, 12 },
106 {
" -55", 0, -55, -55 },
107 {
" 0x44ff", 0, 0, 0x44ff },
108 {
" +0x44f4", 0, 0, 0x44f4 },
109 {
" -0x44fd", 0, 0, 0x44fd },
125 { -1023,
"-1023 bytes",
"0 KB"},
126 { -24,
"-24 bytes",
"0 KB"},
127 { 309,
"309 bytes",
"1 KB"},
128 { 10191,
"9.95 KB",
"10 KB"},
129 { 100353,
"98.0 KB",
"99 KB"},
130 { 1022286,
"998 KB",
"999 KB"},
131 { 1046862,
"0.99 MB",
"1,023 KB", 1,
"1023 KB"},
132 { 1048574619,
"999 MB",
"1,023,999 KB", 1,
"1023999 KB"},
133 { 1073741775,
"0.99 GB",
"1,048,576 KB", 1,
"1048576 KB"},
134 { ((
LONGLONG)0x000000f9 << 32) | 0xfffff94e,
"999 GB",
"1,048,575,999 KB", 1,
"1048575999 KB"},
135 { ((
LONGLONG)0x000000ff << 32) | 0xfffffa9b,
"0.99 TB",
"1,073,741,823 KB", 1,
"1073741823 KB"},
136 { ((
LONGLONG)0x0003e7ff << 32) | 0xfffffa9b,
"999 TB",
"1,073,741,823,999 KB", 1,
"4294967295 KB"},
137 { ((
LONGLONG)0x0003ffff << 32) | 0xfffffbe8,
"0.99 PB",
"1,099,511,627,775 KB", 1,
"4294967295 KB"},
138 { ((
LONGLONG)0x0f9fffff << 32) | 0xfffffd35,
"999 PB",
"1,099,511,627,776,000 KB", 1,
"0 KB"},
139 { ((
LONGLONG)0x0fffffff << 32) | 0xfffffa9b,
"0.99 EB",
"1,125,899,906,842,623 KB", 1,
"4294967295 KB"},
161 { 1000000, 1,
" 10 min" },
162 { 1000000, 2,
" 16 min" },
163 { 1000000, 3,
" 16 min 40 sec" },
164 { 1000000, 4,
" 16 min 40 sec" },
165 { 1000000, 5,
" 16 min 40 sec" },
166 { 1000000, 6,
" 16 min 40 sec" },
167 { 1000000, 7,
" 16 min 40 sec" },
169 { 1999999, 1,
" 30 min" },
170 { 1999999, 2,
" 33 min" },
171 { 1999999, 3,
" 33 min 20 sec" },
172 { 1999999, 4,
" 33 min 20 sec" },
173 { 1999999, 5,
" 33 min 20 sec" },
174 { 1999999, 6,
" 33 min 20 sec" },
175 { 1999999, 7,
" 33 min 20 sec" },
177 { 3999997, 1,
" 1 hr" },
178 { 3999997, 2,
" 1 hr 6 min" },
179 { 3999997, 3,
" 1 hr 6 min 40 sec" },
180 { 3999997, 4,
" 1 hr 6 min 40 sec" },
181 { 3999997, 5,
" 1 hr 6 min 40 sec" },
182 { 3999997, 6,
" 1 hr 6 min 40 sec" },
183 { 3999997, 7,
" 1 hr 6 min 40 sec" },
185 { 149999851, 7,
" 41 hr 40 min 0 sec" },
186 { 150999850, 1,
" 40 hr" },
187 { 150999850, 2,
" 41 hr" },
188 { 150999850, 3,
" 41 hr 50 min" },
189 { 150999850, 4,
" 41 hr 56 min" },
190 { 150999850, 5,
" 41 hr 56 min 40 sec" },
191 { 150999850, 6,
" 41 hr 56 min 40 sec" },
192 { 150999850, 7,
" 41 hr 56 min 40 sec" },
194 { 493999507, 1,
" 100 hr" },
195 { 493999507, 2,
" 130 hr" },
196 { 493999507, 3,
" 137 hr" },
197 { 493999507, 4,
" 137 hr 10 min" },
198 { 493999507, 5,
" 137 hr 13 min" },
199 { 493999507, 6,
" 137 hr 13 min 20 sec" },
200 { 493999507, 7,
" 137 hr 13 min 20 sec" },
221 if (pGetThreadUILanguage)
223 if (pGetUserDefaultUILanguage)
274 string[16384] =
'\0';
285 ok(!
result,
"found char not in the string\n");
312 ok(!
result,
"found char not in the string\n");
339 ok(!
result,
"found char not in the string\n");
364 ok(!
result,
"found char not in the string\n");
370 ok(!
result,
"found char not in the string\n");
417 lpRes =
StrCpyW(szBuff, szSrc);
418 ok(!
StrCmpW(szSrc, szBuff) && lpRes == szBuff,
"Copied string %s wrong\n",
result->byte_size_64);
437 static const WCHAR string[] = {
'T',
'e',
's',
't',
'i',
'n',
'g',
' ',
'S',
't',
'r',
'i',
'n',
'g',0};
442 win_skip(
"StrChrNW not available\n");
446 p = pStrChrNW(
string,
't',10);
447 ok(*
p==
't',
"Found wrong 't'\n");
448 ok(*(
p+1)==
'i',
"next should be 'i'\n");
450 p = pStrChrNW(
string,
'S',10);
451 ok(*
p==
'S',
"Found wrong 'S'\n");
453 p = pStrChrNW(
string,
'r',10);
454 ok(
p==
NULL,
"Should not have found 'r'\n");
465 ok(return_val ==
result->str_to_int,
"converted '%s' wrong (%d)\n",
466 result->string, return_val);
481 ok(return_val ==
result->str_to_int,
"converted '%s' wrong (%d)\n",
482 result->string, return_val);
497 ok(!bRet || return_val != -1,
"No result returned from '%s'\n",
500 ok(return_val == (
int)
result->str_to_int64_ex,
"converted '%s' wrong (%d)\n",
501 result->string, return_val);
510 ok(!bRet || return_val != -1,
"No result returned from '%s'\n",
513 ok(return_val == (
int)
result->str_to_int64_hex,
"converted '%s' wrong (%d)\n",
514 result->string, return_val);
531 ok(!bRet || return_val != -1,
"No result returned from '%s'\n",
534 ok(return_val == (
int)
result->str_to_int64_ex,
"converted '%s' wrong (%d)\n",
535 result->string, return_val);
545 ok(!bRet || return_val != -1,
"No result returned from '%s'\n",
548 ok(return_val == (
int)
result->str_to_int64_hex,
"converted '%s' wrong (%d)\n",
549 result->string, return_val);
562 win_skip(
"StrToInt64ExA() is not available\n");
569 bRet = pStrToInt64ExA(
result->string,0,&return_val);
570 ok(!bRet || return_val != -1,
"No result returned from '%s'\n",
573 ok(return_val ==
result->str_to_int64_ex,
"converted '%s' wrong (%s)\n",
583 ok(!bRet || return_val != -1,
"No result returned from '%s'\n",
586 ok(return_val ==
result->str_to_int64_hex,
"converted '%s' wrong (%s)\n",
601 win_skip(
"StrToInt64ExW() is not available\n");
609 bRet = pStrToInt64ExW(szBuff, 0, &return_val);
610 ok(!bRet || return_val != -1,
"No result returned from '%s'\n",
613 ok(return_val ==
result->str_to_int64_ex,
"converted '%s' wrong (%s)\n",
624 ok(!bRet || return_val != -1,
"No result returned from '%s'\n",
627 ok(return_val ==
result->str_to_int64_hex,
"converted '%s' wrong (%s)\n",
642 ok(lpszStr !=
NULL,
"Dup failed\n");
645 ok(!
strcmp(
result->byte_size_64, lpszStr),
"Copied string wrong\n");
655 ok(lpszStr ==
NULL || *lpszStr ==
'\0',
"NULL string returned %p\n", lpszStr);
664 if (!pStrFormatByteSize64A)
666 win_skip(
"StrFormatByteSize64A() is not available\n");
672 pStrFormatByteSize64A(
result->value, szBuff, 256);
675 "Formatted %s wrong: got %s, expected %s\n",
688 if (!pStrFormatKBSizeW)
690 win_skip(
"StrFormatKBSizeW() is not available\n");
696 pStrFormatKBSizeW(
result->value, szBuffW, 256);
699 ok(!
strcmp(
result->kb_size, szBuff),
"Formatted %s wrong: got %s, expected %s\n",
710 if (!pStrFormatKBSizeA)
712 win_skip(
"StrFormatKBSizeA() is not available\n");
718 pStrFormatKBSizeA(
result->value, szBuff, 256);
724 "Formatted %s wrong: got %s, expected %s\n",
739 ok(!
strcmp(
result->time_interval, szBuff),
"Formatted %d %d wrong: %s\n",
747 static const char str1[] = {
'a',
'b',
'c',
'd',
'e',
'f'};
748 static const char str2[] = {
'a',
'B',
'c',
'd',
'e',
'f'};
749 ok(0 !=
StrCmpNA(str1, str2, 6),
"StrCmpNA is case-insensitive\n");
750 ok(0 ==
StrCmpNIA(str1, str2, 6),
"StrCmpNIA is case-sensitive\n");
752 ok(!pChrCmpIA(
'a',
'a'),
"ChrCmpIA doesn't work at all!\n");
753 ok(!pChrCmpIA(
'b',
'B'),
"ChrCmpIA is not case-insensitive\n");
754 ok(pChrCmpIA(
'a',
'z'),
"ChrCmpIA believes that a == z!\n");
757 win_skip(
"ChrCmpIA() is not available\n");
759 if (pStrIsIntlEqualA)
761 ok(pStrIsIntlEqualA(
FALSE, str1, str2, 5),
"StrIsIntlEqualA(FALSE,...) isn't case-insensitive\n");
762 ok(!pStrIsIntlEqualA(
TRUE, str1, str2, 5),
"StrIsIntlEqualA(TRUE,...) isn't case-sensitive\n");
765 win_skip(
"StrIsIntlEqualA() is not available\n");
767 if (pIntlStrEqWorkerA)
769 ok(pIntlStrEqWorkerA(
FALSE, str1, str2, 5),
"IntlStrEqWorkerA(FALSE,...) isn't case-insensitive\n");
770 ok(!pIntlStrEqWorkerA(
TRUE, str1, str2, 5),
"pIntlStrEqWorkerA(TRUE,...) isn't case-sensitive\n");
773 win_skip(
"IntlStrEqWorkerA() is not available\n");
778 static const WCHAR str1[] = {
'a',
'b',
'c',
'd',
'e',
'f'};
779 static const WCHAR str2[] = {
'a',
'B',
'c',
'd',
'e',
'f'};
780 ok(0 !=
StrCmpNW(str1, str2, 5),
"StrCmpNW is case-insensitive\n");
781 ok(0 ==
StrCmpNIW(str1, str2, 5),
"StrCmpNIW is case-sensitive\n");
783 ok(!pChrCmpIW(
'a',
'a'),
"ChrCmpIW doesn't work at all!\n");
784 ok(!pChrCmpIW(
'b',
'B'),
"ChrCmpIW is not case-insensitive\n");
785 ok(pChrCmpIW(
'a',
'z'),
"ChrCmpIW believes that a == z!\n");
788 win_skip(
"ChrCmpIW() is not available\n");
790 if (pStrIsIntlEqualW)
792 ok(pStrIsIntlEqualW(
FALSE, str1, str2, 5),
"StrIsIntlEqualW(FALSE,...) isn't case-insensitive\n");
793 ok(!pStrIsIntlEqualW(
TRUE, str1, str2, 5),
"StrIsIntlEqualW(TRUE,...) isn't case-sensitive\n");
796 win_skip(
"StrIsIntlEqualW() is not available\n");
798 if (pIntlStrEqWorkerW)
800 ok(pIntlStrEqWorkerW(
FALSE, str1, str2, 5),
"IntlStrEqWorkerW(FALSE,...) isn't case-insensitive\n");
801 ok(!pIntlStrEqWorkerW(
TRUE, str1, str2, 5),
"IntlStrEqWorkerW(TRUE,...) isn't case-sensitive\n");
804 win_skip(
"IntlStrEqWorkerW() is not available\n");
817 static const WCHAR szTestW[] = {
'T',
'e',
's',
't',
'\0' };
825 win_skip(
"StrRetToBSTR() is not available\n");
832 ret = pStrRetToBSTR(&strret,
NULL, &bstr);
834 "STRRET_WSTR: dup failed, ret=0x%08x, bstr %p\n",
ret, bstr);
839 ret = pStrRetToBSTR(&strret,
NULL, &bstr);
841 "STRRET_CSTR: dup failed, ret=0x%08x, bstr %p\n",
ret, bstr);
845 U(strret).uOffset = 1;
846 strcpy((
char*)&iidl,
" Test");
847 ret = pStrRetToBSTR(&strret, iidl, &bstr);
849 "STRRET_OFFSET: dup failed, ret=0x%08x, bstr %p\n",
ret, bstr);
863 win_skip(
"StrCpyNXA() is not available\n");
870 "StrCpyNXA: expected %p, \"hello\\0\\n\\n\", got %p, \"%d,%d,%d,%d,%d,%d,%d,%d\"\n",
876 static const WCHAR lpInit[] = {
'\n',
'\n',
'\n',
'\n',
'\n',
'\n',
'\n',
'\n' };
877 static const WCHAR lpSrc[] = {
'h',
'e',
'l',
'l',
'o',
'\0' };
878 static const WCHAR lpRes[] = {
'h',
'e',
'l',
'l',
'o',
'\0',
'\n',
'\n' };
884 win_skip(
"StrCpyNXW() is not available\n");
891 "StrCpyNXW: expected %p, \"hello\\0\\n\\n\", got %p, \"%d,%d,%d,%d,%d,%d,%d,%d\"\n",
895#define check_strrstri(type, str, pos, needle, exp) \
896 ret##type = StrRStrI##type(str, str+pos, needle); \
897 ok(ret##type == (exp), "Type " #type ", expected %p but got %p (string base %p)\n", \
898 (exp), ret##type, str);
902 static const CHAR szTest[] =
"yAxxxxAy";
903 static const CHAR szTest2[] =
"ABABABAB";
904 static const WCHAR wszTest[] = {
'y',
'A',
'x',
'x',
'x',
'x',
'A',
'y',0};
905 static const WCHAR wszTest2[] = {
'A',
'B',
'A',
'B',
'A',
'B',
'A',
'B',0};
907 static const WCHAR wszPattern1[] = {
'A',0};
908 static const WCHAR wszPattern2[] = {
'a',
'X',0};
909 static const WCHAR wszPattern3[] = {
'A',
'y',0};
910 static const WCHAR wszPattern4[] = {
'a',
'b',0};
941 win_skip(
"SHAnsiToAnsi() is not available\n");
945 if (pSHAnsiToAnsi == (
void *)pStrPBrkW)
947 win_skip(
"Ordinal 345 corresponds to StrPBrkW, skipping SHAnsiToAnsi tests\n");
954 "SHAnsiToAnsi: expected 6, \"hello\\0\\n\\n\", got %d, \"%d,%d,%d,%d,%d,%d,%d,%d\"\n",
960 static const WCHAR lpInit[] = {
'\n',
'\n',
'\n',
'\n',
'\n',
'\n',
'\n',
'\n' };
961 static const WCHAR lpSrc[] = {
'h',
'e',
'l',
'l',
'o',
'\0' };
962 static const WCHAR lpRes[] = {
'h',
'e',
'l',
'l',
'o',
'\0',
'\n',
'\n' };
966 if (!pSHUnicodeToUnicode)
968 win_skip(
"SHUnicodeToUnicode() is not available\n");
972 if (pSHUnicodeToUnicode == (
void *)pStrRChrA)
974 win_skip(
"Ordinal 346 corresponds to StrRChrA, skipping SHUnicodeToUnicode tests\n");
981 "SHUnicodeToUnicode: expected 6, \"hello\\0\\n\\n\", got %d, \"%d,%d,%d,%d,%d,%d,%d,%d\"\n",
997 str1[
i] =
'0'+(
i%10);
998 wstr1[
i] =
'0'+(
i%10);
1015 win_skip(
"StrCatBuffA() is not available\n");
1024 memset(wbuf, 0xbf,
sizeof(wbuf));
1029 memset(wbuf, 0xbf,
sizeof(wbuf));
1034 memset(wbuf, 0xbf,
sizeof(wbuf));
1039 memset(wbuf, 0xbf,
sizeof(wbuf));
1044 memset(wbuf, 0xbf,
sizeof(wbuf));
1056 win_skip(
"StrCatBuffW() is not available\n");
1060 memset(wbuf, 0xbf,
sizeof(wbuf));
1062 U(strret).pOleStr =
StrDupW(wstr1);
1063 hres = pStrRetToBufW(&strret,
NULL, wbuf, 10);
1065 "StrRetToBufW returned %08x\n",
hres);
1071 memset(wbuf, 0xbf,
sizeof(wbuf));
1074 hres = pStrRetToBufW(&strret,
NULL, wbuf, 10);
1078 memset(wbuf, 0xbf,
sizeof(wbuf));
1080 U(strret).pOleStr =
NULL;
1081 hres = pStrRetToBufW(&strret,
NULL, wbuf, 10);
1086 win_skip(
"StrRetToBufW() is not available\n");
1098 win_skip(
"StrRetToBufA() is not available\n");
1103 ret = pwnsprintfA(
buf, 10,
"%s", str1);
1104 ok(
broken(
ret == 9) ||
ret == -1 ,
"Unexpected wnsprintfA return %d, expected 9 or -1\n",
ret);
1109 win_skip(
"wnsprintfA() is not available\n");
1113 memset(wbuf, 0xbf,
sizeof(wbuf));
1114 ret = pwnsprintfW(wbuf, 10,
fmt, wstr1);
1115 ok(
broken(
ret == 9) ||
ret == -1 ,
"Unexpected wnsprintfW return %d, expected 9 or -1\n",
ret);
1120 win_skip(
"wnsprintfW() is not available\n");
1125 static const char *deadbeefA =
"DeAdBeEf";
1134 {
"DeAd", deadbeefA},
1136 {
"AdBe", deadbeefA + 2},
1138 {
"BeEf", deadbeefA + 4},
1149 ok(!
ret,
"Expected StrStrA to return NULL, got %p\n",
ret);
1152 ok(!
ret,
"Expected StrStrA to return NULL, got %p\n",
ret);
1155 ok(!
ret,
"Expected StrStrA to return NULL, got %p\n",
ret);
1159 ok(!
ret,
"Expected StrStrA to return NULL, got %p\n",
ret);
1165 "[%d] Expected StrStrA to return %p, got %p\n",
1173 static const WCHAR deadbeefW[] = {
'D',
'e',
'A',
'd',
'B',
'e',
'E',
'f',0};
1174 static const WCHAR deadW[] = {
'D',
'e',
'A',
'd',0};
1175 static const WCHAR dead_lowerW[] = {
'd',
'e',
'a',
'd',0};
1176 static const WCHAR adbeW[] = {
'A',
'd',
'B',
'e',0};
1177 static const WCHAR adbe_lowerW[] = {
'a',
'd',
'b',
'e',0};
1178 static const WCHAR beefW[] = {
'B',
'e',
'E',
'f',0};
1179 static const WCHAR beef_lowerW[] = {
'b',
'e',
'e',
'f',0};
1189 {dead_lowerW,
NULL},
1190 {adbeW, deadbeefW + 2},
1191 {adbe_lowerW,
NULL},
1192 {beefW, deadbeefW + 4},
1193 {beef_lowerW,
NULL},
1203 ok(!
ret,
"Expected StrStrW to return NULL, got %p\n",
ret);
1206 ok(!
ret,
"Expected StrStrW to return NULL, got %p\n",
ret);
1209 ok(!
ret,
"Expected StrStrW to return NULL, got %p\n",
ret);
1213 ok(!
ret,
"Expected StrStrW to return NULL, got %p\n",
ret);
1219 "[%d] Expected StrStrW to return %p, got %p\n",
1226 static const char *deadbeefA =
"DeAdBeEf";
1232 } StrStrIA_cases[] =
1235 {
"DeAd", deadbeefA},
1236 {
"dead", deadbeefA},
1237 {
"AdBe", deadbeefA + 2},
1238 {
"adbe", deadbeefA + 2},
1239 {
"BeEf", deadbeefA + 4},
1240 {
"beef", deadbeefA + 4},
1251 ok(!
ret,
"Expected StrStrIA to return NULL, got %p\n",
ret);
1254 ok(!
ret,
"Expected StrStrIA to return NULL, got %p\n",
ret);
1257 ok(!
ret,
"Expected StrStrIA to return NULL, got %p\n",
ret);
1261 ok(!
ret,
"Expected StrStrIA to return NULL, got %p\n",
ret);
1267 "[%d] Expected StrStrIA to return %p, got %p\n",
1275 static const WCHAR deadbeefW[] = {
'D',
'e',
'A',
'd',
'B',
'e',
'E',
'f',0};
1276 static const WCHAR deadW[] = {
'D',
'e',
'A',
'd',0};
1277 static const WCHAR dead_lowerW[] = {
'd',
'e',
'a',
'd',0};
1278 static const WCHAR adbeW[] = {
'A',
'd',
'B',
'e',0};
1279 static const WCHAR adbe_lowerW[] = {
'a',
'd',
'b',
'e',0};
1280 static const WCHAR beefW[] = {
'B',
'e',
'E',
'f',0};
1281 static const WCHAR beef_lowerW[] = {
'b',
'e',
'e',
'f',0};
1282 static const WCHAR cafeW[] = {
'c',
'a',
'f',
'e',0};
1288 } StrStrIW_cases[] =
1292 {dead_lowerW, deadbeefW},
1293 {adbeW, deadbeefW + 2},
1294 {adbe_lowerW, deadbeefW + 2},
1295 {beefW, deadbeefW + 4},
1296 {beef_lowerW, deadbeefW + 4},
1307 ok(!
ret,
"Expected StrStrIW to return NULL, got %p\n",
ret);
1310 ok(!
ret,
"Expected StrStrIW to return NULL, got %p\n",
ret);
1313 ok(!
ret,
"Expected StrStrIW to return NULL, got %p\n",
ret);
1317 ok(!
ret,
"Expected StrStrIW to return NULL, got %p\n",
ret);
1323 "[%d] Expected StrStrIW to return %p, got %p\n",
1331 static const WCHAR deadbeefW[] = {
'D',
'e',
'A',
'd',
'B',
'e',
'E',
'f',0};
1332 static const WCHAR deadW[] = {
'D',
'e',
'A',
'd',0};
1333 static const WCHAR dead_lowerW[] = {
'd',
'e',
'a',
'd',0};
1334 static const WCHAR adbeW[] = {
'A',
'd',
'B',
'e',0};
1335 static const WCHAR adbe_lowerW[] = {
'a',
'd',
'b',
'e',0};
1336 static const WCHAR beefW[] = {
'B',
'e',
'E',
'f',0};
1337 static const WCHAR beef_lowerW[] = {
'b',
'e',
'e',
'f',0};
1344 } StrStrNW_cases[] =
1349 {adbeW,
ARRAY_SIZE(deadbeefW), deadbeefW + 2},
1351 {beefW,
ARRAY_SIZE(deadbeefW), deadbeefW + 4},
1358 {beefW, 5, deadbeefW + 4},
1359 {beefW, 6, deadbeefW + 4},
1360 {beefW, 7, deadbeefW + 4},
1361 {beefW, 8, deadbeefW + 4},
1362 {beefW, 9, deadbeefW + 4},
1370 win_skip(
"StrStrNW() is not available\n");
1375 ok(!
ret,
"Expected StrStrNW to return NULL, got %p\n",
ret);
1378 ok(!
ret,
"Expected StrStrNW to return NULL, got %p\n",
ret);
1381 ok(!
ret,
"Expected StrStrNW to return NULL, got %p\n",
ret);
1384 ok(!
ret,
"Expected StrStrNW to return NULL, got %p\n",
ret);
1387 ok(!
ret,
"Expected StrStrNW to return NULL, got %p\n",
ret);
1391 ret = pStrStrNW(deadbeefW, StrStrNW_cases[
i].
search, StrStrNW_cases[
i].
count);
1393 "[%d] Expected StrStrNW to return %p, got %p\n",
1400 ret = pStrStrNW(deadbeefW, beefW, 100);
1401 ok(
ret == deadbeefW + 4,
"Expected StrStrNW to return deadbeefW + 4, got %p\n",
ret);
1405 ret = pStrStrNW(deadbeefW, beefW, ~0
U);
1406 ok(!
ret,
"Expected StrStrNW to return NULL, got %p\n",
ret);
1413 static const WCHAR deadbeefW[] = {
'D',
'e',
'A',
'd',
'B',
'e',
'E',
'f',0};
1414 static const WCHAR deadW[] = {
'D',
'e',
'A',
'd',0};
1415 static const WCHAR dead_lowerW[] = {
'd',
'e',
'a',
'd',0};
1416 static const WCHAR adbeW[] = {
'A',
'd',
'B',
'e',0};
1417 static const WCHAR adbe_lowerW[] = {
'a',
'd',
'b',
'e',0};
1418 static const WCHAR beefW[] = {
'B',
'e',
'E',
'f',0};
1419 static const WCHAR beef_lowerW[] = {
'b',
'e',
'e',
'f',0};
1420 static const WCHAR cafeW[] = {
'c',
'a',
'f',
'e',0};
1427 } StrStrNIW_cases[] =
1431 {dead_lowerW,
ARRAY_SIZE(deadbeefW), deadbeefW},
1432 {adbeW,
ARRAY_SIZE(deadbeefW), deadbeefW + 2},
1433 {adbe_lowerW,
ARRAY_SIZE(deadbeefW), deadbeefW + 2},
1434 {beefW,
ARRAY_SIZE(deadbeefW), deadbeefW + 4},
1435 {beef_lowerW,
ARRAY_SIZE(deadbeefW), deadbeefW + 4},
1442 {beefW, 5, deadbeefW + 4},
1443 {beefW, 6, deadbeefW + 4},
1444 {beefW, 7, deadbeefW + 4},
1445 {beefW, 8, deadbeefW + 4},
1446 {beefW, 9, deadbeefW + 4},
1447 {beef_lowerW, 0,
NULL},
1448 {beef_lowerW, 1,
NULL},
1449 {beef_lowerW, 2,
NULL},
1450 {beef_lowerW, 3,
NULL},
1451 {beef_lowerW, 4,
NULL},
1452 {beef_lowerW, 5, deadbeefW + 4},
1453 {beef_lowerW, 6, deadbeefW + 4},
1454 {beef_lowerW, 7, deadbeefW + 4},
1455 {beef_lowerW, 8, deadbeefW + 4},
1456 {beef_lowerW, 9, deadbeefW + 4},
1464 win_skip(
"StrStrNIW() is not available\n");
1469 ok(!
ret,
"Expected StrStrNIW to return NULL, got %p\n",
ret);
1472 ok(!
ret,
"Expected StrStrNIW to return NULL, got %p\n",
ret);
1475 ok(!
ret,
"Expected StrStrNIW to return NULL, got %p\n",
ret);
1478 ok(!
ret,
"Expected StrStrNIW to return NULL, got %p\n",
ret);
1481 ok(!
ret,
"Expected StrStrNIW to return NULL, got %p\n",
ret);
1485 ret = pStrStrNIW(deadbeefW, StrStrNIW_cases[
i].
search, StrStrNIW_cases[
i].
count);
1487 "[%d] Expected StrStrNIW to return %p, got %p\n",
1494 ret = pStrStrNIW(deadbeefW, beefW, 100);
1495 ok(
ret == deadbeefW + 4,
"Expected StrStrNIW to return deadbeefW + 4, got %p\n",
ret);
1499 ret = pStrStrNIW(deadbeefW, beefW, ~0
U);
1500 ok(!
ret,
"Expected StrStrNIW to return NULL, got %p\n",
ret);
1506 static const WCHAR deadbeefW[] = {
'D',
'e',
'A',
'd',
'B',
'e',
'E',
'f',0};
1507 static const WCHAR deadW[] = {
'D',
'e',
'A',
'd',0};
1508 static const WCHAR beefW[] = {
'B',
'e',
'E',
'f',0};
1515 win_skip(
"StrCatChainW is not available\n");
1520 ret = pStrCatChainW(
NULL, 0, 0, beefW);
1521 ok(
ret == 0,
"Expected StrCatChainW to return 0, got %u\n",
ret);
1525 ret = pStrCatChainW(
buf, 0, 0, beefW);
1526 ok(
ret == 0,
"Expected StrCatChainW to return 0, got %u\n",
ret);
1527 ok(
buf[0] == 0x1111,
"Expected buf[0] = 0x1111, got %x\n",
buf[0]);
1529 memcpy(
buf, deadbeefW,
sizeof(deadbeefW));
1530 ret = pStrCatChainW(
buf, 0, -1, beefW);
1531 ok(
ret == 8,
"Expected StrCatChainW to return 8, got %u\n",
ret);
1532 ok(!
memcmp(
buf, deadbeefW,
sizeof(deadbeefW)),
"Buffer contains wrong data\n");
1536 ret = pStrCatChainW(
buf, 32, 0, deadW);
1537 ok(
ret == 4,
"Expected StrCatChainW to return 4, got %u\n",
ret);
1538 ok(!
memcmp(
buf, deadW,
sizeof(deadW)),
"Buffer contains wrong data\n");
1540 ret = pStrCatChainW(
buf, 32, -1, beefW);
1541 ok(
ret == 8,
"Expected StrCatChainW to return 8, got %u\n",
ret);
1542 ok(!
memcmp(
buf, deadbeefW,
sizeof(deadbeefW)),
"Buffer contains wrong data\n");
1546 ret = pStrCatChainW(
buf, 32, 0, deadW);
1547 ok(
ret == 4,
"Expected StrCatChainW to return 4, got %u\n",
ret);
1548 ok(!
memcmp(
buf, deadW,
sizeof(deadW)),
"Buffer contains wrong data\n");
1550 ret = pStrCatChainW(
buf, 32, 4, beefW);
1551 ok(
ret == 8,
"Expected StrCatChainW to return 8, got %u\n",
ret);
1552 ok(!
memcmp(
buf, deadbeefW,
sizeof(deadbeefW)),
"Buffer contains wrong data\n");
1556 ret = pStrCatChainW(
buf, 5, 0, deadW);
1557 ok(
ret == 4,
"Expected StrCatChainW to return 4, got %u\n",
ret);
1558 ok(!
memcmp(
buf, deadW,
sizeof(deadW)),
"Buffer contains wrong data\n");
1562 ret = pStrCatChainW(
buf, 4, 0, deadW);
1568 win_skip(
"Windows2000/XP behaviour detected for StrCatChainW, skipping tests\n");
1571 ok(
ret == 3,
"Expected StrCatChainW to return 3, got %u\n",
ret);
1572 ok(!
memcmp(
buf, deadW, 3 *
sizeof(
WCHAR)),
"Buffer contains wrong data\n");
1573 ok(!
buf[3],
"String is not nullterminated\n");
1574 ok(
buf[4] == 0x1111,
"Expected buf[4] = 0x1111, got %x\n",
buf[4]);
1577 ret = pStrCatChainW(
buf, 4, 1, beefW);
1578 ok(
ret == 3,
"Expected StrCatChainW to return 3, got %u\n",
ret);
1579 ok(
buf[0] ==
'D',
"Expected buf[0] = 'D', got %x\n",
buf[0]);
1580 ok(
buf[1] ==
'B',
"Expected buf[1] = 'B', got %x\n",
buf[1]);
1581 ok(
buf[2] ==
'e',
"Expected buf[2] = 'e', got %x\n",
buf[2]);
1582 ok(!
buf[3],
"String is not nullterminated\n");
1583 ok(
buf[4] == 0x1111,
"Expected buf[4] = 0x1111, got %x\n",
buf[4]);
1587 memcpy(
buf, deadbeefW,
sizeof(deadbeefW));
1589 ret = pStrCatChainW(
buf, 9, 8, beefW);
1590 ok(
ret == 8,
"Expected StrCatChainW to return 8, got %u\n",
ret);
1591 ok(!
memcmp(
buf, deadbeefW,
sizeof(deadbeefW)),
"Buffer contains wrong data\n");
1592 ok(!
memcmp(
buf + 9, deadW,
sizeof(deadW)),
"Buffer contains wrong data\n");
1595 ret = pStrCatChainW(
buf, 9, 9, beefW);
1596 ok(
ret == 8,
"Expected StrCatChainW to return 8, got %u\n",
ret);
1597 ok(!
memcmp(
buf, deadbeefW,
sizeof(deadbeefW)),
"Buffer contains wrong data\n");
1598 ok(!
memcmp(
buf + 9, deadW,
sizeof(deadW)),
"Buffer contains wrong data\n");
1601 ret = pStrCatChainW(
buf, 9, 10, beefW);
1602 ok(
ret == 10,
"Expected StrCatChainW to return 10, got %u\n",
ret);
1603 ok(!
memcmp(
buf, deadbeefW,
sizeof(deadbeefW)),
"Buffer contains wrong data\n");
1604 ok(!
memcmp(
buf + 9, deadW,
sizeof(deadW)),
"Buffer contains wrong data\n");
1607 memcpy(
buf, deadbeefW,
sizeof(deadbeefW));
1608 ret = pStrCatChainW(
buf, 5, -1, deadW);
1609 ok(
ret == 8,
"Expected StrCatChainW to return 8, got %u\n",
ret);
1610 ok(!
memcmp(
buf, deadbeefW,
sizeof(deadbeefW)),
"Buffer contains wrong data\n");
1612 ret = pStrCatChainW(
buf, 5, 5, deadW);
1613 ok(
ret == 4,
"Expected StrCatChainW to return 4, got %u\n",
ret);
1614 ok(!
memcmp(
buf, deadW,
sizeof(deadW)),
"Buffer contains wrong data\n");
1615 ok(
buf[5] ==
'e',
"Expected buf[5] = 'e', got %x\n",
buf[5]);
1617 ret = pStrCatChainW(
buf, 5, 6, deadW);
1618 ok(
ret == 6,
"Expected StrCatChainW to return 6, got %u\n",
ret);
1619 ok(!
memcmp(
buf, deadW,
sizeof(deadW)),
"Buffer contains wrong data\n");
1620 ok(
buf[5] ==
'e',
"Expected buf[5] = 'e', got %x\n",
buf[5]);
1626 CHAR thousandDelim[8];
1627 CHAR decimalDelim[8];
1687 skip(
"An English UI and locale is required for the StrFormat*Size tests\n");
1691 skip(
"An English UI is required for the StrFromTimeInterval tests\n");
int strcmp(const char *String1, const char *String2)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
INT WINAPI StrToIntW(LPCWSTR lpString)
LPWSTR WINAPI StrChrIW(LPCWSTR lpszStr, WCHAR ch)
LPWSTR WINAPI StrChrW(LPCWSTR lpszStr, WCHAR ch)
LPWSTR WINAPI StrRChrW(LPCWSTR str, LPCWSTR end, WORD ch)
LPSTR WINAPI StrStrIA(LPCSTR lpszStr, LPCSTR lpszSearch)
INT WINAPI StrCmpNIA(LPCSTR lpszStr, LPCSTR lpszComp, INT iLen)
LPSTR WINAPI StrChrIA(LPCSTR lpszStr, WORD ch)
LPWSTR WINAPI StrStrW(LPCWSTR lpszStr, LPCWSTR lpszSearch)
LPSTR WINAPI StrRChrA(LPCSTR lpszStr, LPCSTR lpszEnd, WORD ch)
INT WINAPI StrToIntA(LPCSTR lpszStr)
LPSTR WINAPI StrChrA(LPCSTR lpszStr, WORD ch)
INT WINAPI StrCmpNIW(LPCWSTR lpszStr, LPCWSTR lpszComp, INT iLen)
LPWSTR WINAPI StrStrIW(LPCWSTR lpszStr, LPCWSTR lpszSearch)
INT WINAPI StrCmpNW(LPCWSTR lpszStr, LPCWSTR lpszComp, INT iLen)
LPSTR WINAPI StrStrA(LPCSTR lpszStr, LPCSTR lpszSearch)
INT WINAPI StrCmpNA(LPCSTR lpszStr, LPCSTR lpszComp, INT iLen)
#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 GetLocaleInfoA(LCID lcid, LCTYPE lctype, LPSTR buffer, INT len)
LANGID WINAPI GetUserDefaultLangID(void)
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
LPSTR WINAPI StrDupA(LPCSTR lpszStr)
BOOL WINAPI StrToIntExW(LPCWSTR lpszStr, DWORD dwFlags, int *lpiRet)
INT WINAPI StrFromTimeIntervalA(LPSTR lpszStr, UINT cchMax, DWORD dwMS, int iDigits)
LPWSTR WINAPI StrCpyNW(LPWSTR dst, LPCWSTR src, int count)
int WINAPI StrCmpW(LPCWSTR lpszStr, LPCWSTR lpszComp)
BOOL WINAPI StrToIntExA(LPCSTR lpszStr, DWORD dwFlags, int *lpiRet)
LPWSTR WINAPI StrCpyW(LPWSTR lpszStr, LPCWSTR lpszSrc)
LPWSTR WINAPI StrDupW(LPCWSTR lpszStr)
GLuint GLuint GLsizei count
GLenum GLuint GLenum GLsizei const GLchar * buf
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
HLOCAL NTAPI LocalFree(HLOCAL hMem)
static const WCHAR emptyW[]
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
#define memcpy(s1, s2, n)
static HINSTANCE hkernel32
#define expect_eq(expr, value, type, format)
static const ITEMIDLIST *static WCHAR * CoDupStrW(const char *src)
static void test_StrFormatByteSize64A(void)
static void test_StrChrIW(void)
static void test_StrStrIW(void)
static void test_StrChrW(void)
static void test_StrFormatKBSizeA(void)
static BOOL is_locale_english(void)
static void test_StrStrNW(void)
static void test_StrDupA(void)
static const StrFormatSizeResult StrFormatSize_results[]
#define check_strrstri(type, str, pos, needle, exp)
static void test_StrCmpA(void)
static void test_StrStrIA(void)
static void test_StrToInt64ExW(void)
static void test_StrFromTimeIntervalA(void)
static void test_SHUnicodeToUnicode(void)
static void test_StrToInt64ExA(void)
static void test_StrToIntA(void)
static const StrFromTimeIntervalResult StrFromTimeInterval_results[]
static void test_StrRChrA(void)
static void test_StrRetToBSTR(void)
static void test_StrToIntExW(void)
static BOOL is_lang_english(void)
static void test_StrChrA(void)
static void test_StrCatChainW(void)
static void test_StrRStrI(void)
static void test_StrStrW(void)
static void test_SHAnsiToAnsi(void)
static void test_StrToIntW(void)
#define expect_eq2(expr, val1, val2, type, fmt)
struct tagStrToIntResult StrToIntResult
static void test_StrChrIA(void)
static void test_StrCpyW(void)
struct tagStrFormatSizeResult StrFormatSizeResult
static void test_StrFormatKBSizeW(void)
static void test_StrToIntExA(void)
static void test_StrCmpW(void)
static void test_StrChrNW(void)
static void test_StrStrNIW(void)
static void test_StrXXX_overflows(void)
static void test_StrStrA(void)
static const StrToIntResult StrToInt_results[]
struct tagStrFromTimeIntervalResult StrFromTimeIntervalResult
static void test_StrRChrW(void)
static void test_StrCpyNXW(void)
static void test_StrCpyNXA(void)
static short search(int val, const short *table, int size)
#define LOCALE_USER_DEFAULT
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
#define E_NOT_SUFFICIENT_BUFFER