Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/shlwapi/tests/url.c | 66 ++++++++++++---------------------------- 1 file changed, 19 insertions(+), 47 deletions(-)
diff --git a/dlls/shlwapi/tests/url.c b/dlls/shlwapi/tests/url.c index 703bdcd0a55..65fc2cfedd1 100644 --- a/dlls/shlwapi/tests/url.c +++ b/dlls/shlwapi/tests/url.c @@ -295,7 +295,6 @@ typedef struct _TEST_URL_ESCAPEW { DWORD flags; const WCHAR expecturl[INTERNET_MAX_URL_LENGTH]; const WCHAR win7url[INTERNET_MAX_URL_LENGTH]; /* <= Win7 */ - const WCHAR vistaurl[INTERNET_MAX_URL_LENGTH]; /* <= Vista/2k8 */ } TEST_URL_ESCAPEW;
static const TEST_URL_ESCAPEW TEST_ESCAPEW[] = { @@ -311,12 +310,10 @@ static const TEST_URL_ESCAPEW TEST_ESCAPEW[] = { {'M','a','%','D','F',0}}, /* 0x2070E */ {{0xd841,0xdf0e,0}, URL_ESCAPE_AS_UTF8, {'%','F','0','%','A','0','%','9','C','%','8','E',0}, - {'%','E','F','%','B','F','%','B','D','%','E','F','%','B','F','%','B','D',0}, - {0xd841,0xdf0e,0}}, + {'%','E','F','%','B','F','%','B','D','%','E','F','%','B','F','%','B','D',0}}, /* 0x27A3E */ {{0xd85e,0xde3e,0}, URL_ESCAPE_AS_UTF8, {'%','F','0','%','A','7','%','A','8','%','B','E',0}, - {'%','E','F','%','B','F','%','B','D','%','E','F','%','B','F','%','B','D',0}, - {0xd85e,0xde3e,0}}, + {'%','E','F','%','B','F','%','B','D','%','E','F','%','B','F','%','B','D',0}},
{{0xd85e,0}, URL_ESCAPE_AS_UTF8, {'%','E','F','%','B','F','%','B','D',0}, {0xd85e,0}}, @@ -414,12 +411,7 @@ static const struct { {"c:\foo/b a%r", "file:///c:/foo/b%20a%25r", S_OK}, {"c:\foo\foo bar", "file:///c:/foo/foo%20bar", S_OK}, {"file:///c:/foo/bar", "file:///c:/foo/bar", S_FALSE}, -#if 0 - /* The following test fails on native shlwapi as distributed with Win95/98. - * Wine matches the behaviour of later versions. - */ {"xx:c:\foo\bar", "xx:c:\foo\bar", S_FALSE} -#endif };
/* ################ */ @@ -614,8 +606,8 @@ static void test_url_part(const char* szUrl, DWORD dwPart, DWORD dwFlags, const dwSize = 1; res = UrlGetPartA(szUrl, szPart, &dwSize, dwPart, dwFlags); ok(res == E_POINTER, "UrlGetPart for "%s" gave: 0x%08x\n", szUrl, res); - ok(dwSize == strlen(szExpected)+1 || - (*szExpected == '?' && dwSize == strlen(szExpected)), + todo_wine_if (dwPart == URL_PART_QUERY) + ok(dwSize == strlen(szExpected) + 1, "UrlGetPart for "%s" gave size: %u\n", szUrl, dwSize);
dwSize = INTERNET_MAX_URL_LENGTH; @@ -638,9 +630,8 @@ static void test_url_part(const char* szUrl, DWORD dwPart, DWORD dwFlags, const FreeWideString(wszConvertedPart); FreeWideString(wszUrl);
- /* Note that v6.0 and later don't return '?' with the query */ - ok(strcmp(szPart,szExpected)==0 || - (*szExpected=='?' && !strcmp(szPart,szExpected+1)), + todo_wine_if (dwPart == URL_PART_QUERY) + ok(!strcmp(szPart,szExpected), "Expected %s, but got %s\n", szExpected, szPart); }
@@ -707,7 +698,7 @@ static void test_UrlGetPart(void) test_url_part(TEST_URL_3, URL_PART_USERNAME, 0, "foo"); test_url_part(TEST_URL_3, URL_PART_PASSWORD, 0, "bar"); test_url_part(TEST_URL_3, URL_PART_SCHEME, 0, "http"); - test_url_part(TEST_URL_3, URL_PART_QUERY, 0, "?query=x&return=y"); + test_url_part(TEST_URL_3, URL_PART_QUERY, 0, "query=x&return=y");
test_url_part(TEST_URL_4, URL_PART_HOSTNAME, 0, "google.*.com");
@@ -855,10 +846,8 @@ static void test_UrlEscapeA(void) size = 1; empty_string[0] = 127; ret = UrlEscapeA("/woningplan/woonkamer basis.swf", empty_string, &size, URL_ESCAPE_AS_UTF8); - ok(ret == E_NOTIMPL || broken(ret == E_POINTER), /* < Win7/Win2k8 */ - "got %x, expected %x\n", ret, E_NOTIMPL); - ok(size == 1 || broken(size == 34), /* < Win7/Win2k8 */ - "got %d, expected %d\n", size, 1); + ok(ret == E_NOTIMPL, "Got unexpected hr %#x.\n", ret); + ok(size == 1, "Got unexpected size %u.\n", size); ok(empty_string[0] == 127, "String has changed, empty_string[0] = %d\n", empty_string[0]);
for (i = 0; i < ARRAY_SIZE(TEST_ESCAPE); i++) { @@ -962,12 +951,10 @@ static void test_UrlEscapeW(void) size = INTERNET_MAX_URL_LENGTH; ret = UrlEscapeW(TEST_ESCAPEW[i].url, ret_url, &size, TEST_ESCAPEW[i].flags); ok(ret == S_OK, "Got unexpected hr %#x for %s.\n", ret, debugstr_w(TEST_ESCAPEW[i].url)); - ok(!lstrcmpW(ret_url, TEST_ESCAPEW[i].expecturl) || - broken(!lstrcmpW(ret_url, TEST_ESCAPEW[i].vistaurl)) || - broken(!lstrcmpW(ret_url, TEST_ESCAPEW[i].win7url)), - "Expected "%s" or "%s" or "%s", but got "%s" for "%s"\n", - wine_dbgstr_w(TEST_ESCAPEW[i].expecturl), wine_dbgstr_w(TEST_ESCAPEW[i].vistaurl), - wine_dbgstr_w(TEST_ESCAPEW[i].win7url), wine_dbgstr_w(ret_url), wine_dbgstr_w(TEST_ESCAPEW[i].url)); + ok(!wcscmp(ret_url, TEST_ESCAPEW[i].expecturl) + || broken(!wcscmp(ret_url, TEST_ESCAPEW[i].win7url)), + "Expected %s, but got %s for %s.\n", debugstr_w(TEST_ESCAPEW[i].expecturl), + debugstr_w(ret_url), debugstr_w(TEST_ESCAPEW[i].url)); } }
@@ -1484,36 +1471,27 @@ static void test_HashData(void) /* Test hashing with identically sized input/output buffers. */ res = HashData(input, 16, output, 16); ok(res == S_OK, "Expected HashData to return S_OK, got 0x%08x\n", res); - if(res == S_OK) - ok(!memcmp(output, expected, sizeof(expected)), - "Output buffer did not match expected contents\n"); + ok(!memcmp(output, expected, sizeof(expected)), "data didn't match\n");
/* Test hashing with larger output buffer. */ res = HashData(input, 16, output, 32); ok(res == S_OK, "Expected HashData to return S_OK, got 0x%08x\n", res); - if(res == S_OK) - ok(!memcmp(output, expected2, sizeof(expected2)), - "Output buffer did not match expected contents\n"); + ok(!memcmp(output, expected2, sizeof(expected2)), "data didn't match\n");
/* Test hashing with smaller input buffer. */ res = HashData(input, 8, output, 16); ok(res == S_OK, "Expected HashData to return S_OK, got 0x%08x\n", res); - if(res == S_OK) - ok(!memcmp(output, expected3, sizeof(expected3)), - "Output buffer did not match expected contents\n"); + ok(!memcmp(output, expected3, sizeof(expected3)), "data didn't match\n");
/* Test passing NULL pointers for input/output parameters. */ res = HashData(NULL, 0, NULL, 0); - ok(res == E_INVALIDARG || broken(res == S_OK), /* Windows 2000 */ - "Expected HashData to return E_INVALIDARG, got 0x%08x\n", res); + ok(res == E_INVALIDARG, "Got unexpected hr %#x.\n", res);
res = HashData(input, 0, NULL, 0); - ok(res == E_INVALIDARG || broken(res == S_OK), /* Windows 2000 */ - "Expected HashData to return E_INVALIDARG, got 0x%08x\n", res); + ok(res == E_INVALIDARG, "Got unexpected hr %#x.\n", res);
res = HashData(NULL, 0, output, 0); - ok(res == E_INVALIDARG || broken(res == S_OK), /* Windows 2000 */ - "Expected HashData to return E_INVALIDARG, got 0x%08x\n", res); + ok(res == E_INVALIDARG, "Got unexpected hr %#x.\n", res);
/* Test passing valid pointers with sizes of zero. */ for (i = 0; i < ARRAY_SIZE(input); i++) @@ -1527,16 +1505,10 @@ static void test_HashData(void)
/* The buffers should be unchanged. */ for (i = 0; i < ARRAY_SIZE(input); i++) - { ok(input[i] == 0x00, "Expected the input buffer to be unchanged\n"); - if(input[i] != 0x00) break; - }
for (i = 0; i < ARRAY_SIZE(output); i++) - { ok(output[i] == 0xFF, "Expected the output buffer to be unchanged\n"); - if(output[i] != 0xFF) break; - }
/* Input/output parameters are not validated. */ res = HashData((BYTE *)0xdeadbeef, 0, (BYTE *)0xdeadbeef, 0);
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/shlwapi/tests/url.c | 77 +++++++++++++++------------------------- 1 file changed, 29 insertions(+), 48 deletions(-)
diff --git a/dlls/shlwapi/tests/url.c b/dlls/shlwapi/tests/url.c index 65fc2cfedd1..4419a3e7ded 100644 --- a/dlls/shlwapi/tests/url.c +++ b/dlls/shlwapi/tests/url.c @@ -34,11 +34,8 @@ static const char* TEST_URL_2 = "http://localhost:8080/tests%2e.html?date=Mon%20 static const char* TEST_URL_3 = "http://foo:bar@localhost:21/internal.php?query=x&return=y"; static const char* TEST_URL_4 = "http://foo:bar@google.*.com:21/internal.php?query=x&return=y";
-static const WCHAR winehqW[] = {'h','t','t','p',':','/','/','w','w','w','.','w','i','n','e','h','q','.','o','r','g','/',0}; -static const CHAR winehqA[] = {'h','t','t','p',':','/','/','w','w','w','.','w','i','n','e','h','q','.','o','r','g','/',0}; - -/* ################ */ - +static const WCHAR winehqW[] = L"http://www.winehq.org/"; +static const char winehqA[] = "http://www.winehq.org/"; static const CHAR untouchedA[] = "untouched";
#define TEST_APPLY_MAX_LENGTH INTERNET_MAX_URL_LENGTH @@ -298,31 +295,20 @@ typedef struct _TEST_URL_ESCAPEW { } TEST_URL_ESCAPEW;
static const TEST_URL_ESCAPEW TEST_ESCAPEW[] = { - {{' ','<','>','"',0}, URL_ESCAPE_AS_UTF8, {'%','2','0','%','3','C','%','3','E','%','2','2',0}}, - {{'{','}','|','\',0}, URL_ESCAPE_AS_UTF8, {'%','7','B','%','7','D','%','7','C','%','5','C',0}}, - {{'^',']','[','`',0}, URL_ESCAPE_AS_UTF8, {'%','5','E','%','5','D','%','5','B','%','6','0',0}}, - {{'&','/','?','#',0}, URL_ESCAPE_AS_UTF8, {'%','2','6','/','?','#',0}}, - {{'M','a','s','s',0}, URL_ESCAPE_AS_UTF8, {'M','a','s','s',0}}, + {L" <>"", URL_ESCAPE_AS_UTF8, L"%20%3C%3E%22"}, + {L"{}|\", URL_ESCAPE_AS_UTF8, L"%7B%7D%7C%5C"}, + {L"^][`", URL_ESCAPE_AS_UTF8, L"%5E%5D%5B%60"}, + {L"&/?#", URL_ESCAPE_AS_UTF8, L"%26/?#"}, + {L"Mass", URL_ESCAPE_AS_UTF8, L"Mass"},
/* broken < Win8/10 */ - - {{'M','a',0xdf,0}, URL_ESCAPE_AS_UTF8, {'M','a','%','C','3','%','9','F',0}, - {'M','a','%','D','F',0}}, - /* 0x2070E */ - {{0xd841,0xdf0e,0}, URL_ESCAPE_AS_UTF8, {'%','F','0','%','A','0','%','9','C','%','8','E',0}, - {'%','E','F','%','B','F','%','B','D','%','E','F','%','B','F','%','B','D',0}}, - /* 0x27A3E */ - {{0xd85e,0xde3e,0}, URL_ESCAPE_AS_UTF8, {'%','F','0','%','A','7','%','A','8','%','B','E',0}, - {'%','E','F','%','B','F','%','B','D','%','E','F','%','B','F','%','B','D',0}}, - - {{0xd85e,0}, URL_ESCAPE_AS_UTF8, {'%','E','F','%','B','F','%','B','D',0}, - {0xd85e,0}}, - {{0xd85e,0x41}, URL_ESCAPE_AS_UTF8, {'%','E','F','%','B','F','%','B','D','A',0}, - {0xd85e,'A',0}}, - {{0xdc00,0}, URL_ESCAPE_AS_UTF8, {'%','E','F','%','B','F','%','B','D',0}, - {0xdc00,0}}, - {{0xffff,0}, URL_ESCAPE_AS_UTF8, {'%','E','F','%','B','F','%','B','F',0}, - {0xffff,0}}, + {L"Ma\xdf", URL_ESCAPE_AS_UTF8, L"Ma%C3%9F", L"Ma%DF"}, + {L"\xd841\xdf0e", URL_ESCAPE_AS_UTF8, L"%F0%A0%9C%8E", L"%EF%BF%BD%EF%BF%BD"}, /* 0x2070E */ + {L"\xd85e\xde3e", URL_ESCAPE_AS_UTF8, L"%F0%A7%A8%BE", L"%EF%BF%BD%EF%BF%BD"}, /* 0x27A3E */ + {L"\xd85e", URL_ESCAPE_AS_UTF8, L"%EF%BF%BD", L"\xd85e"}, + {L"\xd85eQ", URL_ESCAPE_AS_UTF8, L"%EF%BF%BDQ", L"\xd85eQ"}, + {L"\xdc00", URL_ESCAPE_AS_UTF8, L"%EF%BF%BD", L"\xdc00"}, + {L"\xffff", URL_ESCAPE_AS_UTF8, L"%EF%BF%BF", L"\xffff"}, };
/* ################ */ @@ -863,12 +849,8 @@ static void test_UrlEscapeA(void)
static void test_UrlEscapeW(void) { - static const WCHAR path_test[] = {'/','t','e','s','t',0}; - static const WCHAR naW[] = {'f','t','p',31,255,250,0x2122,'e','n','d','/',0}; - static const WCHAR naescapedW[] = {'f','t','p','%','1','F','%','F','F','%','F','A',0x2122,'e','n','d','/',0}; - static const WCHAR out[] = {'f','o','o','%','2','0','b','a','r',0}; - WCHAR overwrite[] = {'f','o','o',' ','b','a','r',0,0,0}; WCHAR ret_urlW[INTERNET_MAX_URL_LENGTH]; + WCHAR overwrite[10] = L"foo bar"; WCHAR empty_string[] = {0}; DWORD size; HRESULT ret; @@ -877,35 +859,35 @@ static void test_UrlEscapeW(void)
/* Check error paths */
- ret = UrlEscapeW(path_test, NULL, NULL, URL_ESCAPE_SPACES_ONLY); + ret = UrlEscapeW(L"/test", NULL, NULL, URL_ESCAPE_SPACES_ONLY); ok(ret == E_INVALIDARG, "got %x, expected %x\n", ret, E_INVALIDARG);
size = 0; - ret = UrlEscapeW(path_test, NULL, &size, URL_ESCAPE_SPACES_ONLY); + ret = UrlEscapeW(L"/test", NULL, &size, URL_ESCAPE_SPACES_ONLY); ok(ret == E_INVALIDARG, "got %x, expected %x\n", ret, E_INVALIDARG); ok(size == 0, "got %d, expected %d\n", size, 0);
- ret = UrlEscapeW(path_test, empty_string, NULL, URL_ESCAPE_SPACES_ONLY); + ret = UrlEscapeW(L"/test", empty_string, NULL, URL_ESCAPE_SPACES_ONLY); ok(ret == E_INVALIDARG, "got %x, expected %x\n", ret, E_INVALIDARG);
size = 0; - ret = UrlEscapeW(path_test, empty_string, &size, URL_ESCAPE_SPACES_ONLY); + ret = UrlEscapeW(L"/test", empty_string, &size, URL_ESCAPE_SPACES_ONLY); ok(ret == E_INVALIDARG, "got %x, expected %x\n", ret, E_INVALIDARG); ok(size == 0, "got %d, expected %d\n", size, 0);
- ret = UrlEscapeW(path_test, NULL, NULL, URL_ESCAPE_SPACES_ONLY); + ret = UrlEscapeW(L"/test", NULL, NULL, URL_ESCAPE_SPACES_ONLY); ok(ret == E_INVALIDARG, "got %x, expected %x\n", ret, E_INVALIDARG);
size = 1; - ret = UrlEscapeW(path_test, NULL, &size, URL_ESCAPE_SPACES_ONLY); + ret = UrlEscapeW(L"/test", NULL, &size, URL_ESCAPE_SPACES_ONLY); ok(ret == E_INVALIDARG, "got %x, expected %x\n", ret, E_INVALIDARG); ok(size == 1, "got %d, expected %d\n", size, 1);
- ret = UrlEscapeW(path_test, empty_string, NULL, URL_ESCAPE_SPACES_ONLY); + ret = UrlEscapeW(L"/test", empty_string, NULL, URL_ESCAPE_SPACES_ONLY); ok(ret == E_INVALIDARG, "got %x, expected %x\n", ret, E_INVALIDARG);
size = 1; - ret = UrlEscapeW(path_test, empty_string, &size, URL_ESCAPE_SPACES_ONLY); + ret = UrlEscapeW(L"/test", empty_string, &size, URL_ESCAPE_SPACES_ONLY); ok(ret == E_POINTER, "got %x, expected %x\n", ret, E_POINTER); ok(size == 6, "got %d, expected %d\n", size, 6);
@@ -915,7 +897,7 @@ static void test_UrlEscapeW(void) ret = UrlEscapeW(overwrite, overwrite, &size, URL_ESCAPE_SPACES_ONLY); ok(ret == S_OK, "got %x, expected S_OK\n", ret); ok(size == 9, "got %d, expected 9\n", size); - ok(!lstrcmpW(overwrite, out), "got %s, expected %s\n", wine_dbgstr_w(overwrite), wine_dbgstr_w(out)); + ok(!wcscmp(overwrite, L"foo%20bar"), "Got unexpected string %s.\n", debugstr_w(overwrite));
size = 1; wc = 127; @@ -926,9 +908,9 @@ static void test_UrlEscapeW(void)
/* non-ASCII range */ size = ARRAY_SIZE(ret_urlW); - ret = UrlEscapeW(naW, ret_urlW, &size, 0); + ret = UrlEscapeW(L"ftp\x1f\xff\xfa\x2122q/", ret_urlW, &size, 0); ok(ret == S_OK, "got %x, expected S_OK\n", ret); - ok(!lstrcmpW(naescapedW, ret_urlW), "got %s, expected %s\n", wine_dbgstr_w(ret_urlW), wine_dbgstr_w(naescapedW)); + ok(!wcscmp(ret_urlW, L"ftp%1F%FF%FA\x2122q/"), "Got unexpected string %s.\n", debugstr_w(ret_urlW));
for (i = 0; i < ARRAY_SIZE(TEST_ESCAPE); i++) {
@@ -1128,7 +1110,7 @@ static void test_UrlCanonicalizeW(void) BOOL choped; int pos;
- MultiByteToWideChar(CP_ACP, 0, "http://www.winehq.org/X", -1, szUrl, ARRAY_SIZE(szUrl)); + wcscpy(szUrl, L"http://www.winehq.org/X"); pos = lstrlenW(szUrl) - 1; szUrl[pos] = i; urllen = INTERNET_MAX_URL_LENGTH; @@ -1310,9 +1292,8 @@ static void test_UrlUnescape(void) static char inplace[] = "file:///C:/Program%20Files"; static char another_inplace[] = "file:///C:/Program%20Files"; static const char expected[] = "file:///C:/Program Files"; - static WCHAR inplaceW[] = {'f','i','l','e',':','/','/','/','C',':','/','P','r','o','g','r','a','m',' ','F','i','l','e','s',0}; - static WCHAR another_inplaceW[] ={'f','i','l','e',':','/','/','/', - 'C',':','/','P','r','o','g','r','a','m','%','2','0','F','i','l','e','s',0}; + static WCHAR inplaceW[] = L"file:///C:/Program Files"; + static WCHAR another_inplaceW[] = L"file:///C:/Program%20Files"; HRESULT res;
for (i = 0; i < ARRAY_SIZE(TEST_URL_UNESCAPE); i++) {
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/shlwapi/tests/url.c | 116 ++++++++++++++++++++------------------- 1 file changed, 60 insertions(+), 56 deletions(-)
diff --git a/dlls/shlwapi/tests/url.c b/dlls/shlwapi/tests/url.c index 4419a3e7ded..b2a1bd609c4 100644 --- a/dlls/shlwapi/tests/url.c +++ b/dlls/shlwapi/tests/url.c @@ -38,43 +38,40 @@ static const WCHAR winehqW[] = L"http://www.winehq.org/"; static const char winehqA[] = "http://www.winehq.org/"; static const CHAR untouchedA[] = "untouched";
-#define TEST_APPLY_MAX_LENGTH INTERNET_MAX_URL_LENGTH - typedef struct _TEST_URL_APPLY { const char * url; DWORD flags; HRESULT res; - DWORD newlen; const char * newurl; } TEST_URL_APPLY;
static const TEST_URL_APPLY TEST_APPLY[] = { - {"www.winehq.org", URL_APPLY_GUESSSCHEME | URL_APPLY_DEFAULT, S_OK, 21, "http://www.winehq.org%22%7D, - {"www.winehq.org", URL_APPLY_GUESSSCHEME, S_OK, 21, "http://www.winehq.org%22%7D, - {"www.winehq.org", URL_APPLY_DEFAULT, S_OK, 21, "http://www.winehq.org%22%7D, - {"ftp.winehq.org", URL_APPLY_GUESSSCHEME | URL_APPLY_DEFAULT, S_OK, 20, "ftp://ftp.winehq.org"}, - {"ftp.winehq.org", URL_APPLY_GUESSSCHEME, S_OK, 20, "ftp://ftp.winehq.org"}, - {"ftp.winehq.org", URL_APPLY_DEFAULT, S_OK, 21, "http://ftp.winehq.org%22%7D, - {"winehq.org", URL_APPLY_GUESSSCHEME | URL_APPLY_DEFAULT, S_OK, 17, "http://winehq.org%22%7D, - {"winehq.org", URL_APPLY_GUESSSCHEME, S_FALSE, TEST_APPLY_MAX_LENGTH, untouchedA}, - {"winehq.org", URL_APPLY_DEFAULT, S_OK, 17, "http://winehq.org%22%7D, - {"http://www.winehq.org", URL_APPLY_GUESSSCHEME , S_FALSE, TEST_APPLY_MAX_LENGTH, untouchedA}, - {"http://www.winehq.org", URL_APPLY_GUESSSCHEME | URL_APPLY_FORCEAPPLY, S_FALSE, TEST_APPLY_MAX_LENGTH, untouchedA}, - {"http://www.winehq.org", URL_APPLY_GUESSSCHEME | URL_APPLY_FORCEAPPLY | URL_APPLY_DEFAULT, S_OK, 28, "http://http://www.winehq.org%22%7D, - {"http://www.winehq.org", URL_APPLY_GUESSSCHEME | URL_APPLY_DEFAULT, S_FALSE, TEST_APPLY_MAX_LENGTH, untouchedA}, - {"", URL_APPLY_GUESSSCHEME | URL_APPLY_DEFAULT, S_OK, 7, "http://%22%7D, - {"", URL_APPLY_GUESSSCHEME, S_FALSE, TEST_APPLY_MAX_LENGTH, untouchedA}, - {"", URL_APPLY_DEFAULT, S_OK, 7, "http://%22%7D, - {"u:\windows", URL_APPLY_GUESSFILE | URL_APPLY_DEFAULT, S_OK, 18, "file:///u:/windows"}, - {"u:\windows", URL_APPLY_GUESSFILE, S_OK, 18, "file:///u:/windows"}, - {"u:\windows", URL_APPLY_DEFAULT, S_OK, 17, "http://u:%5C%5Cwindows%22%7D, - {"file:///c:/windows", URL_APPLY_GUESSFILE , S_FALSE, TEST_APPLY_MAX_LENGTH, untouchedA}, - {"aa:\windows", URL_APPLY_GUESSFILE , S_FALSE, TEST_APPLY_MAX_LENGTH, untouchedA}, - {"\\server\share", URL_APPLY_DEFAULT, S_OK, 21, "http://%5C%5C%5C%5Cserver%5C%5Cshare%22%7D, - {"\\server\share", URL_APPLY_GUESSFILE, S_OK, 19, "file://server/share"}, - {"\\server\share", URL_APPLY_GUESSSCHEME, S_FALSE, TEST_APPLY_MAX_LENGTH, untouchedA}, - {"file://server/share", URL_APPLY_GUESSFILE, S_FALSE, TEST_APPLY_MAX_LENGTH, untouchedA}, - {"file://server/share", URL_APPLY_GUESSSCHEME, S_FALSE, TEST_APPLY_MAX_LENGTH, untouchedA}, + {"www.winehq.org", URL_APPLY_GUESSSCHEME | URL_APPLY_DEFAULT, S_OK, "http://www.winehq.org%22%7D, + {"www.winehq.org", URL_APPLY_GUESSSCHEME, S_OK, "http://www.winehq.org%22%7D, + {"www.winehq.org", URL_APPLY_DEFAULT, S_OK, "http://www.winehq.org%22%7D, + {"ftp.winehq.org", URL_APPLY_GUESSSCHEME | URL_APPLY_DEFAULT, S_OK, "ftp://ftp.winehq.org"}, + {"ftp.winehq.org", URL_APPLY_GUESSSCHEME, S_OK, "ftp://ftp.winehq.org"}, + {"ftp.winehq.org", URL_APPLY_DEFAULT, S_OK, "http://ftp.winehq.org%22%7D, + {"winehq.org", URL_APPLY_GUESSSCHEME | URL_APPLY_DEFAULT, S_OK, "http://winehq.org%22%7D, + {"winehq.org", URL_APPLY_GUESSSCHEME, S_FALSE}, + {"winehq.org", URL_APPLY_DEFAULT, S_OK, "http://winehq.org%22%7D, + {"http://www.winehq.org", URL_APPLY_GUESSSCHEME, S_FALSE}, + {"http://www.winehq.org", URL_APPLY_GUESSSCHEME | URL_APPLY_FORCEAPPLY, S_FALSE}, + {"http://www.winehq.org", URL_APPLY_GUESSSCHEME | URL_APPLY_FORCEAPPLY | URL_APPLY_DEFAULT, S_OK, "http://http://www.winehq.org%22%7D, + {"http://www.winehq.org", URL_APPLY_GUESSSCHEME | URL_APPLY_DEFAULT, S_FALSE}, + {"", URL_APPLY_GUESSSCHEME | URL_APPLY_DEFAULT, S_OK, "http://%22%7D, + {"", URL_APPLY_GUESSSCHEME, S_FALSE}, + {"", URL_APPLY_DEFAULT, S_OK, "http://%22%7D, + {"u:\windows", URL_APPLY_GUESSFILE | URL_APPLY_DEFAULT, S_OK, "file:///u:/windows"}, + {"u:\windows", URL_APPLY_GUESSFILE, S_OK, "file:///u:/windows"}, + {"u:\windows", URL_APPLY_DEFAULT, S_OK, "http://u:%5C%5Cwindows%22%7D, + {"file:///c:/windows", URL_APPLY_GUESSFILE, S_FALSE}, + {"aa:\windows", URL_APPLY_GUESSFILE, S_FALSE}, + {"\\server\share", URL_APPLY_DEFAULT, S_OK, "http://%5C%5C%5C%5Cserver%5C%5Cshare%22%7D, + {"\\server\share", URL_APPLY_GUESSFILE, S_OK, "file://server/share"}, + {"\\server\share", URL_APPLY_GUESSSCHEME, S_FALSE}, + {"file://server/share", URL_APPLY_GUESSFILE, S_FALSE}, + {"file://server/share", URL_APPLY_GUESSSCHEME, S_FALSE}, };
/* ################ */ @@ -482,43 +479,50 @@ static void FreeWideString(LPWSTR wszString)
static void test_UrlApplyScheme(void) { - CHAR newurl[TEST_APPLY_MAX_LENGTH]; - WCHAR urlW[TEST_APPLY_MAX_LENGTH]; - WCHAR newurlW[TEST_APPLY_MAX_LENGTH]; + WCHAR urlW[INTERNET_MAX_URL_LENGTH], newurlW[INTERNET_MAX_URL_LENGTH], expectW[INTERNET_MAX_URL_LENGTH]; + char newurl[INTERNET_MAX_URL_LENGTH]; HRESULT res; DWORD len; DWORD i;
for (i = 0; i < ARRAY_SIZE(TEST_APPLY); i++) { - len = TEST_APPLY_MAX_LENGTH; - lstrcpyA(newurl, untouchedA); + len = ARRAY_SIZE(newurl); + strcpy(newurl, "untouched"); res = UrlApplySchemeA(TEST_APPLY[i].url, newurl, &len, TEST_APPLY[i].flags); ok( res == TEST_APPLY[i].res, "#%dA: got HRESULT 0x%x (expected 0x%x)\n", i, res, TEST_APPLY[i].res); - - ok( len == TEST_APPLY[i].newlen, - "#%dA: got len %d (expected %d)\n", i, len, TEST_APPLY[i].newlen); - - ok( !lstrcmpA(newurl, TEST_APPLY[i].newurl), - "#%dA: got '%s' (expected '%s')\n", i, newurl, TEST_APPLY[i].newurl); + if (res == S_OK) + { + ok(len == strlen(newurl), "Test %u: Expected length %u, got %u.\n", i, strlen(newurl), len); + ok(!strcmp(newurl, TEST_APPLY[i].newurl), "Test %u: Expected %s, got %s.\n", + i, debugstr_a(TEST_APPLY[i].newurl), debugstr_a(newurl)); + } + else + { + ok(len == ARRAY_SIZE(newurl), "Test %u: Got length %u.\n", i, len); + ok(!strcmp(newurl, "untouched"), "Test %u: Got %s.\n", i, debugstr_a(newurl)); + }
/* returned length is in character */ - len = TEST_APPLY_MAX_LENGTH; - lstrcpyA(newurl, untouchedA); - MultiByteToWideChar(CP_ACP, 0, newurl, -1, newurlW, len); - MultiByteToWideChar(CP_ACP, 0, TEST_APPLY[i].url, -1, urlW, len); + MultiByteToWideChar(CP_ACP, 0, TEST_APPLY[i].url, -1, urlW, ARRAY_SIZE(urlW)); + MultiByteToWideChar(CP_ACP, 0, TEST_APPLY[i].newurl, -1, expectW, ARRAY_SIZE(expectW));
+ len = ARRAY_SIZE(newurlW); + wcscpy(newurlW, L"untouched"); res = UrlApplySchemeW(urlW, newurlW, &len, TEST_APPLY[i].flags); - WideCharToMultiByte(CP_ACP, 0, newurlW, -1, newurl, TEST_APPLY_MAX_LENGTH, NULL, NULL); ok( res == TEST_APPLY[i].res, "#%dW: got HRESULT 0x%x (expected 0x%x)\n", i, res, TEST_APPLY[i].res); - - ok( len == TEST_APPLY[i].newlen, - "#%dW: got len %d (expected %d)\n", i, len, TEST_APPLY[i].newlen); - - ok( !lstrcmpA(newurl, TEST_APPLY[i].newurl), - "#%dW: got '%s' (expected '%s')\n", i, newurl, TEST_APPLY[i].newurl); - + if (res == S_OK) + { + ok(len == wcslen(newurlW), "Test %u: Expected length %u, got %u.\n", i, wcslen(newurlW), len); + ok(!wcscmp(newurlW, expectW), "Test %u: Expected %s, got %s.\n", + i, debugstr_w(expectW), debugstr_w(newurlW)); + } + else + { + ok(len == ARRAY_SIZE(newurlW), "Test %u: Got length %u.\n", i, len); + ok(!wcscmp(newurlW, L"untouched"), "Test %u: Got %s.\n", i, debugstr_w(newurlW)); + } }
/* buffer too small */ @@ -533,16 +537,16 @@ static void test_UrlApplyScheme(void)
/* NULL as parameter. The length and the buffer are not modified */ lstrcpyA(newurl, untouchedA); - len = TEST_APPLY_MAX_LENGTH; + len = ARRAY_SIZE(newurl); res = UrlApplySchemeA(NULL, newurl, &len, TEST_APPLY[0].flags); ok(res == E_INVALIDARG, "got HRESULT 0x%x (expected E_INVALIDARG)\n", res); - ok(len == TEST_APPLY_MAX_LENGTH, "got len %d\n", len); + ok(len == ARRAY_SIZE(newurl), "got len %d\n", len); ok(!lstrcmpA(newurl, untouchedA), "got '%s' (expected '%s')\n", newurl, untouchedA);
- len = TEST_APPLY_MAX_LENGTH; + len = ARRAY_SIZE(newurl); res = UrlApplySchemeA(TEST_APPLY[0].url, NULL, &len, TEST_APPLY[0].flags); ok(res == E_INVALIDARG, "got HRESULT 0x%x (expected E_INVALIDARG)\n", res); - ok(len == TEST_APPLY_MAX_LENGTH, "got len %d\n", len); + ok(len == ARRAY_SIZE(newurl), "got len %d\n", len);
lstrcpyA(newurl, untouchedA); res = UrlApplySchemeA(TEST_APPLY[0].url, newurl, NULL, TEST_APPLY[0].flags);
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/shlwapi/tests/url.c | 285 +++++++++++++++++---------------------- 1 file changed, 120 insertions(+), 165 deletions(-)
diff --git a/dlls/shlwapi/tests/url.c b/dlls/shlwapi/tests/url.c index b2a1bd609c4..29926ae736b 100644 --- a/dlls/shlwapi/tests/url.c +++ b/dlls/shlwapi/tests/url.c @@ -32,7 +32,6 @@ static const char* TEST_URL_1 = "http://www.winehq.org/tests?date=10/10/1923"; static const char* TEST_URL_2 = "http://localhost:8080/tests%2e.html?date=Mon%2010/10/1923"; static const char* TEST_URL_3 = "http://foo:bar@localhost:21/internal.php?query=x&return=y"; -static const char* TEST_URL_4 = "http://foo:bar@google.*.com:21/internal.php?query=x&return=y";
static const WCHAR winehqW[] = L"http://www.winehq.org/"; static const char winehqA[] = "http://www.winehq.org/"; @@ -582,185 +581,141 @@ static void test_UrlHash(void) hash_url(TEST_URL_3); }
-/* ########################### */ - -static void test_url_part(const char* szUrl, DWORD dwPart, DWORD dwFlags, const char* szExpected) -{ - CHAR szPart[INTERNET_MAX_URL_LENGTH]; - WCHAR wszPart[INTERNET_MAX_URL_LENGTH]; - LPWSTR wszUrl = GetWideString(szUrl); - LPWSTR wszConvertedPart; - HRESULT res; - DWORD dwSize; - - dwSize = 1; - res = UrlGetPartA(szUrl, szPart, &dwSize, dwPart, dwFlags); - ok(res == E_POINTER, "UrlGetPart for "%s" gave: 0x%08x\n", szUrl, res); - todo_wine_if (dwPart == URL_PART_QUERY) - ok(dwSize == strlen(szExpected) + 1, - "UrlGetPart for "%s" gave size: %u\n", szUrl, dwSize); - - dwSize = INTERNET_MAX_URL_LENGTH; - res = UrlGetPartA(szUrl, szPart, &dwSize, dwPart, dwFlags); - ok(res == S_OK, - "UrlGetPartA for "%s" part 0x%08x returned 0x%x and "%s"\n", - szUrl, dwPart, res, szPart); - - dwSize = INTERNET_MAX_URL_LENGTH; - res = UrlGetPartW(wszUrl, wszPart, &dwSize, dwPart, dwFlags); - ok(res == S_OK, - "UrlGetPartW for "%s" part 0x%08x returned 0x%x\n", - szUrl, dwPart, res); - - wszConvertedPart = GetWideString(szPart); - - ok(lstrcmpW(wszPart,wszConvertedPart)==0, - "Strings didn't match between ansi and unicode UrlGetPart!\n"); - - FreeWideString(wszConvertedPart); - FreeWideString(wszUrl); - - todo_wine_if (dwPart == URL_PART_QUERY) - ok(!strcmp(szPart,szExpected), - "Expected %s, but got %s\n", szExpected, szPart); -} - -/* ########################### */ - static void test_UrlGetPart(void) { - const char* file_url = "file://h o s t/c:/windows/file"; - const char* http_url = "http://user:pass 123@www.wine hq.org"; - const char* res_url = "res://some.dll/find.dlg"; - const char* about_url = "about:blank"; - const char* excid_url = "x-excid://36C00000/guid:{048B4E89-2E92-496F-A837-33BA02FF6D32}/Message.htm"; - const char* foo_url = "foo://bar-url/test"; - const char* short_url = "ascheme:"; + WCHAR bufferW[200]; + char buffer[200]; + unsigned int i; + HRESULT hr; + DWORD size;
- CHAR szPart[INTERNET_MAX_URL_LENGTH]; - WCHAR bufW[5]; - DWORD dwSize; - HRESULT res; + static const struct + { + const char *url; + DWORD part; + DWORD flags; + HRESULT hr; + const char *expect; + } + tests[] = + { + {"hi", URL_PART_SCHEME, 0, S_FALSE, ""}, + {"hi", URL_PART_QUERY, 0, S_FALSE, ""}, + {"http://foo:bar@localhost:21/internal.php?query=x&return=y", URL_PART_SCHEME, 0, S_OK, "http"}, + {"http://foo:bar@localhost:21/internal.php?query=x&return=y", URL_PART_USERNAME, 0, S_OK, "foo"}, + {"http://foo:bar@localhost:21/internal.php?query=x&return=y", URL_PART_PASSWORD, 0, S_OK, "bar"}, + {"http://foo:bar@localhost:21/internal.php?query=x&return=y", URL_PART_HOSTNAME, 0, S_OK, "localhost"}, + {"http://foo:bar@localhost:21/internal.php?query=x&return=y", URL_PART_PORT, 0, S_OK, "21"}, + {"http://foo:bar@localhost:21/internal.php?query=x&return=y", URL_PART_QUERY, 0, S_OK, "query=x&return=y"}, + {"http://foo:bar@google.*.com:21/internal.php?query=x&return=y", URL_PART_HOSTNAME, 0, S_OK, "google.*.com"}, + {"file://h o s t/c:/windows/file", URL_PART_HOSTNAME, 0, S_OK, "h o s t"}, + {"http://user:pass 123@www.wine hq.org", URL_PART_HOSTNAME, 0, S_OK, "www.wine hq.org"}, + {"http://user:pass 123@www.wine hq.org", URL_PART_PASSWORD, 0, S_OK, "pass 123"}, + {"about:blank", URL_PART_SCHEME, 0, S_OK, "about"}, + {"about:blank", URL_PART_HOSTNAME, 0, E_FAIL}, + {"x-excid://36C00000/guid:{048B4E89-2E92-496F-A837-33BA02FF6D32}/Message.htm", URL_PART_SCHEME, 0, S_OK, "x-excid"}, + {"x-excid://36C00000/guid:{048B4E89-2E92-496F-A837-33BA02FF6D32}/Message.htm", URL_PART_HOSTNAME, 0, E_FAIL}, + {"x-excid://36C00000/guid:{048B4E89-2E92-496F-A837-33BA02FF6D32}/Message.htm", URL_PART_QUERY, 0, S_FALSE, ""}, + {"foo://bar-url/test", URL_PART_SCHEME, 0, S_OK, "foo"}, + {"foo://bar-url/test", URL_PART_HOSTNAME, 0, E_FAIL}, + {"foo://bar-url/test", URL_PART_QUERY, 0, S_FALSE, ""}, + {"ascheme:", URL_PART_SCHEME, 0, S_OK, "ascheme"}, + {"res://some.dll/find.dlg", URL_PART_SCHEME, 0, S_OK, "res"}, + {"res://some.dll/find.dlg", URL_PART_QUERY, 0, S_FALSE, ""}, + {"http://www.winehq.org", URL_PART_HOSTNAME, URL_PARTFLAG_KEEPSCHEME, S_OK, "http:www.winehq.org"}, + {"file://c:\index.htm", URL_PART_HOSTNAME, 0, S_FALSE, ""}, + {"file:some text", URL_PART_HOSTNAME, 0, S_FALSE, ""}, + {"index.htm", URL_PART_HOSTNAME, 0, E_FAIL}, + };
- res = UrlGetPartA(NULL, NULL, NULL, URL_PART_SCHEME, 0); - ok(res == E_INVALIDARG, "null params gave: 0x%08x\n", res); + hr = UrlGetPartA(NULL, NULL, NULL, URL_PART_SCHEME, 0); + ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr);
- res = UrlGetPartA(NULL, szPart, &dwSize, URL_PART_SCHEME, 0); - ok(res == E_INVALIDARG, "null URL gave: 0x%08x\n", res); + hr = UrlGetPartA(NULL, buffer, &size, URL_PART_SCHEME, 0); + ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr);
- res = UrlGetPartA(res_url, NULL, &dwSize, URL_PART_SCHEME, 0); - ok(res == E_INVALIDARG, "null szPart gave: 0x%08x\n", res); + hr = UrlGetPartA("res://some.dll/find.dlg", NULL, &size, URL_PART_SCHEME, 0); + ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr);
- res = UrlGetPartA(res_url, szPart, NULL, URL_PART_SCHEME, 0); - ok(res == E_INVALIDARG, "null URL gave: 0x%08x\n", res); + hr = UrlGetPartA("res://some.dll/find.dlg", buffer, NULL, URL_PART_SCHEME, 0); + ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr);
- dwSize = 0; - szPart[0]='x'; szPart[1]=0; - res = UrlGetPartA("hi", szPart, &dwSize, URL_PART_SCHEME, 0); - ok(res == E_INVALIDARG, "UrlGetPartA(*pcchOut = 0) returned %08X\n", res); - ok(szPart[0] == 'x' && szPart[1] == 0, "UrlGetPartA(*pcchOut = 0) modified szPart: "%s"\n", szPart); - ok(dwSize == 0, "dwSize = %d\n", dwSize); + size = 0; + strcpy(buffer, "x"); + hr = UrlGetPartA("hi", buffer, &size, URL_PART_SCHEME, 0); + ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr); + ok(!strcmp(buffer, "x"), "Got result %s.\n", debugstr_a(buffer)); + ok(!size, "Got size %u.\n", size);
- dwSize = sizeof szPart; - szPart[0]='x'; szPart[1]=0; - res = UrlGetPartA("hi", szPart, &dwSize, URL_PART_SCHEME, 0); - ok (res==S_FALSE, "UrlGetPartA("hi") returned %08X\n", res); - ok(szPart[0]==0, "UrlGetPartA("hi") return "%s" instead of ""\n", szPart); - ok(dwSize == 0, "dwSize = %d\n", dwSize); + for (i = 0; i < ARRAY_SIZE(tests); ++i) + { + WCHAR urlW[200], expectW[200]; + const char *expect = tests[i].expect; + const char *url = tests[i].url; + DWORD flags = tests[i].flags; + DWORD part = tests[i].part;
- /* UrlGetPartW returns S_OK instead of S_FALSE */ - dwSize = sizeof szPart; - bufW[0]='x'; bufW[1]=0; - res = UrlGetPartW(L"hi", bufW, &dwSize, URL_PART_SCHEME, 0); - todo_wine ok(res==S_OK, "UrlGetPartW("hi") returned %08X\n", res); - ok(bufW[0] == 0, "UrlGetPartW("hi") return "%c"\n", bufW[0]); - ok(dwSize == 0, "dwSize = %d\n", dwSize); + winetest_push_context("URL %s, part %#x, flags %#x", debugstr_a(url), part, flags);
- dwSize = sizeof szPart; - szPart[0]='x'; szPart[1]=0; - res = UrlGetPartA("hi", szPart, &dwSize, URL_PART_QUERY, 0); - ok (res==S_FALSE, "UrlGetPartA("hi") returned %08X\n", res); - ok(szPart[0]==0, "UrlGetPartA("hi") return "%s" instead of ""\n", szPart); - ok(dwSize == 0, "dwSize = %d\n", dwSize); + size = 1; + strcpy(buffer, "x"); + hr = UrlGetPartA(url, buffer, &size, part, flags); + if (tests[i].hr == S_OK) + ok(hr == E_POINTER, "Got hr %#x.\n", hr); + else + ok(hr == tests[i].hr, "Got hr %#x.\n", hr);
- test_url_part(TEST_URL_3, URL_PART_HOSTNAME, 0, "localhost"); - test_url_part(TEST_URL_3, URL_PART_PORT, 0, "21"); - test_url_part(TEST_URL_3, URL_PART_USERNAME, 0, "foo"); - test_url_part(TEST_URL_3, URL_PART_PASSWORD, 0, "bar"); - test_url_part(TEST_URL_3, URL_PART_SCHEME, 0, "http"); - test_url_part(TEST_URL_3, URL_PART_QUERY, 0, "query=x&return=y"); + if (hr == S_FALSE) + { + ok(!size, "Got size %u.\n", size); + ok(!buffer[0], "Got result %s.\n", debugstr_a(buffer)); + } + else + { + if (hr == E_POINTER) + todo_wine_if (part == URL_PART_QUERY && expect[0]) + ok(size == strlen(expect) + 1, "Got size %u.\n", size); + else + ok(size == 1, "Got size %u.\n", size); + ok(!strcmp(buffer, "x"), "Got result %s.\n", debugstr_a(buffer)); + }
- test_url_part(TEST_URL_4, URL_PART_HOSTNAME, 0, "google.*.com"); + size = sizeof(buffer); + strcpy(buffer, "x"); + hr = UrlGetPartA(url, buffer, &size, part, flags); + ok(hr == tests[i].hr, "Got hr %#x.\n", hr); + if (SUCCEEDED(hr)) + { + ok(size == strlen(buffer), "Got size %u.\n", size); + todo_wine_if (part == URL_PART_QUERY && expect[0]) + ok(!strcmp(buffer, expect), "Got result %s.\n", debugstr_a(buffer)); + } + else + { + ok(size == sizeof(buffer), "Got size %u.\n", size); + ok(!strcmp(buffer, "x"), "Got result %s.\n", debugstr_a(buffer)); + }
- test_url_part(file_url, URL_PART_HOSTNAME, 0, "h o s t"); + MultiByteToWideChar(CP_ACP, 0, url, -1, urlW, ARRAY_SIZE(urlW)); + size = ARRAY_SIZE(bufferW); + wcscpy(bufferW, L"x"); + hr = UrlGetPartW(urlW, bufferW, &size, part, flags); + todo_wine_if (tests[i].hr == S_FALSE) + ok(hr == (tests[i].hr == S_FALSE ? S_OK : tests[i].hr), "Got hr %#x.\n", hr); + if (SUCCEEDED(hr)) + { + ok(size == wcslen(bufferW), "Got size %u.\n", size); + MultiByteToWideChar(CP_ACP, 0, buffer, -1, expectW, ARRAY_SIZE(expectW)); + ok(!wcscmp(bufferW, expectW), "Got result %s.\n", debugstr_w(bufferW)); + } + else + { + todo_wine ok(size == ARRAY_SIZE(bufferW), "Got size %u.\n", size); + todo_wine ok(!wcscmp(bufferW, L"x"), "Got result %s.\n", debugstr_w(bufferW)); + }
- test_url_part(http_url, URL_PART_HOSTNAME, 0, "www.wine hq.org"); - test_url_part(http_url, URL_PART_PASSWORD, 0, "pass 123"); - - test_url_part(about_url, URL_PART_SCHEME, 0, "about"); - - test_url_part(excid_url, URL_PART_SCHEME, 0, "x-excid"); - test_url_part(foo_url, URL_PART_SCHEME, 0, "foo"); - test_url_part(short_url, URL_PART_SCHEME, 0, "ascheme"); - - dwSize = sizeof(szPart); - res = UrlGetPartA(about_url, szPart, &dwSize, URL_PART_HOSTNAME, 0); - ok(res==E_FAIL, "returned %08x\n", res); - - test_url_part(res_url, URL_PART_SCHEME, 0, "res"); - test_url_part("http://www.winehq.org", URL_PART_HOSTNAME, URL_PARTFLAG_KEEPSCHEME, "http:www.winehq.org"); - - dwSize = sizeof szPart; - szPart[0]='x'; szPart[1]=0; - res = UrlGetPartA(res_url, szPart, &dwSize, URL_PART_QUERY, 0); - ok(res==S_FALSE, "UrlGetPartA returned %08X\n", res); - ok(szPart[0]==0, "UrlGetPartA gave "%s" instead of ""\n", szPart); - ok(dwSize == 0, "dwSize = %d\n", dwSize); - - dwSize = sizeof(szPart); - res = UrlGetPartA("file://c:\index.htm", szPart, &dwSize, URL_PART_HOSTNAME, 0); - ok(res==S_FALSE, "returned %08x\n", res); - ok(dwSize == 0, "dwSize = %d\n", dwSize); - - dwSize = sizeof(szPart); - szPart[0] = 'x'; szPart[1] = '\0'; - res = UrlGetPartA("file:some text", szPart, &dwSize, URL_PART_HOSTNAME, 0); - ok(res==S_FALSE, "returned %08x\n", res); - ok(szPart[0] == '\0', "szPart[0] = %c\n", szPart[0]); - ok(dwSize == 0, "dwSize = %d\n", dwSize); - - dwSize = sizeof(szPart); - szPart[0] = 'x'; szPart[1] = '\0'; - res = UrlGetPartA("index.htm", szPart, &dwSize, URL_PART_HOSTNAME, 0); - ok(res==E_FAIL, "returned %08x\n", res); - - dwSize = sizeof(szPart); - szPart[0] = 'x'; szPart[1] = '\0'; - res = UrlGetPartA(excid_url, szPart, &dwSize, URL_PART_HOSTNAME, 0); - ok(res==E_FAIL, "returned %08x\n", res); - ok(szPart[0] == 'x', "szPart[0] = %c\n", szPart[0]); - ok(dwSize == sizeof(szPart), "dwSize = %d\n", dwSize); - - dwSize = sizeof(szPart); - szPart[0] = 'x'; szPart[1] = '\0'; - res = UrlGetPartA(excid_url, szPart, &dwSize, URL_PART_QUERY, 0); - ok(res==S_FALSE, "returned %08x\n", res); - ok(szPart[0] == 0, "szPart[0] = %c\n", szPart[0]); - ok(dwSize == 0, "dwSize = %d\n", dwSize); - - dwSize = sizeof(szPart); - szPart[0] = 'x'; szPart[1] = '\0'; - res = UrlGetPartA(foo_url, szPart, &dwSize, URL_PART_HOSTNAME, 0); - ok(res==E_FAIL, "returned %08x\n", res); - ok(szPart[0] == 'x', "szPart[0] = %c\n", szPart[0]); - ok(dwSize == sizeof(szPart), "dwSize = %d\n", dwSize); - - dwSize = sizeof(szPart); - szPart[0] = 'x'; szPart[1] = '\0'; - res = UrlGetPartA(foo_url, szPart, &dwSize, URL_PART_QUERY, 0); - ok(res==S_FALSE, "returned %08x\n", res); - ok(szPart[0] == 0, "szPart[0] = %c\n", szPart[0]); - ok(dwSize == 0, "dwSize = %d\n", dwSize); + winetest_pop_context(); + } }
/* ########################### */
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/shlwapi/tests/url.c | 203 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 189 insertions(+), 14 deletions(-)
diff --git a/dlls/shlwapi/tests/url.c b/dlls/shlwapi/tests/url.c index 29926ae736b..212ee039a0b 100644 --- a/dlls/shlwapi/tests/url.c +++ b/dlls/shlwapi/tests/url.c @@ -596,19 +596,99 @@ static void test_UrlGetPart(void) DWORD flags; HRESULT hr; const char *expect; + BOOL todo_hr, todo_result; } tests[] = { {"hi", URL_PART_SCHEME, 0, S_FALSE, ""}, + {"hi", URL_PART_USERNAME, 0, E_FAIL, .todo_hr = TRUE}, + {"hi", URL_PART_PASSWORD, 0, E_FAIL, .todo_hr = TRUE}, + {"hi", URL_PART_HOSTNAME, 0, E_FAIL}, + {"hi", URL_PART_PORT, 0, E_FAIL, .todo_hr = TRUE}, {"hi", URL_PART_QUERY, 0, S_FALSE, ""}, + {"http://foo:bar@localhost:21/internal.php?query=x&return=y", URL_PART_SCHEME, 0, S_OK, "http"}, {"http://foo:bar@localhost:21/internal.php?query=x&return=y", URL_PART_USERNAME, 0, S_OK, "foo"}, {"http://foo:bar@localhost:21/internal.php?query=x&return=y", URL_PART_PASSWORD, 0, S_OK, "bar"}, {"http://foo:bar@localhost:21/internal.php?query=x&return=y", URL_PART_HOSTNAME, 0, S_OK, "localhost"}, {"http://foo:bar@localhost:21/internal.php?query=x&return=y", URL_PART_PORT, 0, S_OK, "21"}, - {"http://foo:bar@localhost:21/internal.php?query=x&return=y", URL_PART_QUERY, 0, S_OK, "query=x&return=y"}, + {"http://foo:bar@localhost:21/internal.php?query=x&return=y", URL_PART_QUERY, 0, S_OK, "query=x&return=y", .todo_result = TRUE}, + {"http://foo:bar@localhost:21/internal.php#anchor", URL_PART_QUERY, 0, S_FALSE, ""}, + {"http://foo:bar@localhost:21/internal.php?query=x&return=y", URL_PART_SCHEME, URL_PARTFLAG_KEEPSCHEME, S_OK, "http", .todo_result = TRUE}, + {"http://foo:bar@localhost:21/internal.php?query=x&return=y", URL_PART_USERNAME, URL_PARTFLAG_KEEPSCHEME, S_OK, "http:foo"}, + {"http://foo:bar@localhost:21/internal.php?query=x&return=y", URL_PART_PASSWORD, URL_PARTFLAG_KEEPSCHEME, S_OK, "http:bar"}, + {"http://foo:bar@localhost:21/internal.php?query=x&return=y", URL_PART_HOSTNAME, URL_PARTFLAG_KEEPSCHEME, S_OK, "http:localhost"}, + {"http://foo:bar@localhost:21/internal.php?query=x&return=y", URL_PART_PORT, URL_PARTFLAG_KEEPSCHEME, S_OK, "http:21"}, + {"http://foo:bar@localhost:21/internal.php?query=x&return=y", URL_PART_QUERY, URL_PARTFLAG_KEEPSCHEME, S_OK, "query=x&return=y", .todo_result = TRUE}, + + {"http://localhost/", URL_PART_USERNAME, 0, E_INVALIDARG, .todo_hr = TRUE}, + {"http://localhost/", URL_PART_PASSWORD, 0, E_INVALIDARG, .todo_hr = TRUE}, + {"http://localhost/", URL_PART_HOSTNAME, 0, S_OK, "localhost"}, + {"http://localhost/", URL_PART_PORT, 0, E_INVALIDARG, .todo_hr = TRUE}, + {"http://localhost/", URL_PART_QUERY, 0, S_FALSE, ""}, + + {"http://localhost:port/", URL_PART_USERNAME, 0, E_INVALIDARG, .todo_hr = TRUE}, + {"http://localhost:port/", URL_PART_PASSWORD, 0, E_INVALIDARG, .todo_hr = TRUE}, + {"http://localhost:port/", URL_PART_HOSTNAME, 0, S_OK, "localhost"}, + {"http://localhost:port/", URL_PART_PORT, 0, S_OK, "port", .todo_hr = TRUE}, + {"http://:", URL_PART_HOSTNAME, 0, S_FALSE, ""}, + {"http://:", URL_PART_PORT, 0, S_FALSE, ""}, + + {"http://user@localhost", URL_PART_USERNAME, 0, S_OK, "user"}, + {"http://user@localhost", URL_PART_PASSWORD, 0, E_INVALIDARG, .todo_hr = TRUE}, + {"http://user@localhost", URL_PART_HOSTNAME, 0, S_OK, "localhost"}, + {"http://user@localhost", URL_PART_PORT, 0, E_INVALIDARG, .todo_hr = TRUE}, + {"http://@", URL_PART_USERNAME, 0, S_FALSE, ""}, + {"http://@", URL_PART_PASSWORD, 0, E_INVALIDARG, .todo_hr = TRUE}, + {"http://@", URL_PART_HOSTNAME, 0, S_FALSE, ""}, + + {"http://user:pass@localhost", URL_PART_USERNAME, 0, S_OK, "user"}, + {"http://user:pass@localhost", URL_PART_PASSWORD, 0, S_OK, "pass"}, + {"http://user:pass@localhost", URL_PART_HOSTNAME, 0, S_OK, "localhost"}, + {"http://user:pass@localhost", URL_PART_PORT, 0, E_INVALIDARG, .todo_hr = TRUE}, + {"http://:@", URL_PART_USERNAME, 0, S_FALSE, ""}, + {"http://:@", URL_PART_PASSWORD, 0, S_FALSE, ""}, + {"http://:@", URL_PART_HOSTNAME, 0, S_FALSE, ""}, + + {"http://host:port:q", URL_PART_HOSTNAME, 0, S_OK, "host"}, + {"http://host:port:q", URL_PART_PORT, 0, S_OK, "port:q", .todo_hr = TRUE}, + {"http://user:pass:q@host", URL_PART_USERNAME, 0, S_OK, "user", .todo_hr = TRUE}, + {"http://user:pass:q@host", URL_PART_PASSWORD, 0, S_OK, "pass:q", .todo_hr = TRUE}, + {"http://user@host@q", URL_PART_USERNAME, 0, S_OK, "user"}, + {"http://user@host@q", URL_PART_HOSTNAME, 0, S_OK, "host@q", .todo_result = TRUE}, + + {"http:localhost/index.html", URL_PART_HOSTNAME, 0, E_FAIL, .todo_hr = TRUE}, + {"http:/localhost/index.html", URL_PART_HOSTNAME, 0, E_FAIL, .todo_hr = TRUE}, + + {"http://localhost%5C%5Cindex.html", URL_PART_HOSTNAME, 0, S_OK, "localhost", .todo_hr = TRUE}, + {"http:/\localhost/index.html", URL_PART_HOSTNAME, 0, S_OK, "localhost", .todo_hr = TRUE}, + {"http:\/localhost/index.html", URL_PART_HOSTNAME, 0, S_OK, "localhost", .todo_hr = TRUE}, + + {"ftp://localhost\index.html", URL_PART_HOSTNAME, 0, S_OK, "localhost", .todo_hr = TRUE}, + {"ftp:/\localhost/index.html", URL_PART_HOSTNAME, 0, S_OK, "localhost", .todo_hr = TRUE}, + {"ftp:\/localhost/index.html", URL_PART_HOSTNAME, 0, S_OK, "localhost", .todo_hr = TRUE}, + + {"http://host?a:b@c:d", URL_PART_HOSTNAME, 0, S_OK, "host", .todo_result = TRUE}, + {"http://host?a:b@c:d", URL_PART_QUERY, 0, S_OK, "a:b@c:d", .todo_hr = TRUE}, + {"http://host#a:b@c:d", URL_PART_HOSTNAME, 0, S_OK, "host", .todo_hr = TRUE}, + {"http://host#a:b@c:d", URL_PART_QUERY, 0, S_FALSE, ""}, + + /* All characters, other than those with special meaning, are allowed. */ {"http://foo:bar@google.*.com:21/internal.php?query=x&return=y", URL_PART_HOSTNAME, 0, S_OK, "google.*.com"}, + {"http:// !"$%&'()*+,-.;<=>[]^_`{|~}\x01\x7f\xff:pass@host", URL_PART_USERNAME, 0, S_OK, " !"$%&'()*+,-.;<=>[]^_`{|~}\x01\x7f\xff", .todo_hr = TRUE}, + {"http://user: !"$%&'()*+,-.;<=>[]^_`{|~}\x01\x7f\xff@host", URL_PART_PASSWORD, 0, S_OK, " !"$%&'()*+,-.;<=>[]^_`{|~}\x01\x7f\xff", .todo_hr = TRUE}, + {"http:// !"$%&'()*+,-.;<=>[]^_`{|~}\x01\x7f\xff", URL_PART_HOSTNAME, 0, S_OK, " !"$%&'()*+,-.;<=>[]^_`{|~}\x01\x7f\xff", .todo_hr = TRUE}, + {"http://host: !"$%&'()*+,-.;<=>[]^_`{|~}\x01\x7f\xff", URL_PART_PORT, 0, S_OK, " !"$%&'()*+,-.;<=>[]^_`{|~}\x01\x7f\xff", .todo_hr = TRUE}, + + {"http:///index.html", URL_PART_HOSTNAME, 0, S_FALSE, ""}, + {"http:///index.html", URL_PART_HOSTNAME, URL_PARTFLAG_KEEPSCHEME, S_OK, "http:", .todo_hr = TRUE}, {"file://h o s t/c:/windows/file", URL_PART_HOSTNAME, 0, S_OK, "h o s t"}, + {"file://h o s t/c:/windows/file", URL_PART_HOSTNAME, URL_PARTFLAG_KEEPSCHEME, S_OK, "h o s t", .todo_result = TRUE}, + {"file://foo:bar@localhost:21/file?query=x", URL_PART_USERNAME, 0, E_FAIL, .todo_hr = TRUE}, + {"file://foo:bar@localhost:21/file?query=x", URL_PART_PASSWORD, 0, E_FAIL, .todo_hr = TRUE}, + {"file://foo:bar@localhost:21/file?query=x", URL_PART_HOSTNAME, 0, S_OK, "foo:bar@localhost:21", .todo_result = TRUE}, + {"file://foo:bar@localhost:21/file?query=x", URL_PART_PORT, 0, E_FAIL, .todo_hr = TRUE}, + {"file://foo:bar@localhost:21/file?query=x", URL_PART_QUERY, 0, S_OK, "query=x", .todo_result = TRUE}, {"http://user:pass 123@www.wine hq.org", URL_PART_HOSTNAME, 0, S_OK, "www.wine hq.org"}, {"http://user:pass 123@www.wine hq.org", URL_PART_PASSWORD, 0, S_OK, "pass 123"}, {"about:blank", URL_PART_SCHEME, 0, S_OK, "about"}, @@ -623,11 +703,53 @@ static void test_UrlGetPart(void) {"res://some.dll/find.dlg", URL_PART_SCHEME, 0, S_OK, "res"}, {"res://some.dll/find.dlg", URL_PART_QUERY, 0, S_FALSE, ""}, {"http://www.winehq.org", URL_PART_HOSTNAME, URL_PARTFLAG_KEEPSCHEME, S_OK, "http:www.winehq.org"}, + {"file:///index.html", URL_PART_HOSTNAME, 0, S_FALSE, ""}, + {"file:///index.html", URL_PART_HOSTNAME, URL_PARTFLAG_KEEPSCHEME, S_FALSE, ""}, {"file://c:\index.htm", URL_PART_HOSTNAME, 0, S_FALSE, ""}, + {"file://c:\index.htm", URL_PART_HOSTNAME, URL_PARTFLAG_KEEPSCHEME, S_FALSE, ""}, {"file:some text", URL_PART_HOSTNAME, 0, S_FALSE, ""}, {"index.htm", URL_PART_HOSTNAME, 0, E_FAIL}, + {"sChEmE-.+:", URL_PART_SCHEME, 0, S_OK, "scheme-.+", .todo_hr = TRUE}, + {"scheme_:", URL_PART_SCHEME, 0, S_FALSE, ""}, + {"scheme :", URL_PART_SCHEME, 0, S_FALSE, ""}, + {"sch eme:", URL_PART_SCHEME, 0, S_FALSE, ""}, + {":", URL_PART_SCHEME, 0, S_FALSE, ""}, + {"a:", URL_PART_SCHEME, 0, S_FALSE, "", .todo_hr = TRUE}, + {"0:", URL_PART_SCHEME, 0, S_FALSE, "", .todo_hr = TRUE}, + {"ab:", URL_PART_SCHEME, 0, S_OK, "ab"}, + + {"about://hostname/", URL_PART_HOSTNAME, 0, E_FAIL}, + {"file://hostname/", URL_PART_HOSTNAME, 0, S_OK, "hostname"}, + {"ftp://hostname/", URL_PART_HOSTNAME, 0, S_OK, "hostname"}, + {"gopher://hostname/", URL_PART_HOSTNAME, 0, S_OK, "hostname"}, + {"http://hostname/", URL_PART_HOSTNAME, 0, S_OK, "hostname"}, + {"https://hostname/", URL_PART_HOSTNAME, 0, S_OK, "hostname"}, + {"javascript://hostname/", URL_PART_HOSTNAME, 0, E_FAIL}, + {"local://hostname/", URL_PART_HOSTNAME, 0, E_FAIL}, + {"mailto://hostname/", URL_PART_HOSTNAME, 0, E_FAIL}, + {"mk://hostname/", URL_PART_HOSTNAME, 0, E_FAIL}, + {"news://hostname/", URL_PART_HOSTNAME, 0, S_OK, "hostname", .todo_hr = TRUE}, + {"nntp://hostname/", URL_PART_HOSTNAME, 0, S_OK, "hostname", .todo_hr = TRUE}, + {"res://hostname/", URL_PART_HOSTNAME, 0, E_FAIL}, + {"shell://hostname/", URL_PART_HOSTNAME, 0, E_FAIL}, + {"snews://hostname/", URL_PART_HOSTNAME, 0, S_OK, "hostname", .todo_hr = TRUE}, + {"telnet://hostname/", URL_PART_HOSTNAME, 0, S_OK, "hostname"}, + {"vbscript://hostname/", URL_PART_HOSTNAME, 0, E_FAIL}, + {"wais://hostname/", URL_PART_HOSTNAME, 0, E_FAIL}, + + {"file://hostname/", URL_PART_HOSTNAME, URL_PARTFLAG_KEEPSCHEME, S_OK, "hostname", .todo_result = TRUE}, + {"ftp://hostname/", URL_PART_HOSTNAME, URL_PARTFLAG_KEEPSCHEME, S_OK, "ftp:hostname"}, + {"gopher://hostname/", URL_PART_HOSTNAME, URL_PARTFLAG_KEEPSCHEME, S_OK, "gopher:hostname"}, + {"http://hostname/", URL_PART_HOSTNAME, URL_PARTFLAG_KEEPSCHEME, S_OK, "http:hostname"}, + {"https://hostname/", URL_PART_HOSTNAME, URL_PARTFLAG_KEEPSCHEME, S_OK, "https:hostname"}, + {"news://hostname/", URL_PART_HOSTNAME, URL_PARTFLAG_KEEPSCHEME, S_OK, "news:hostname", .todo_hr = TRUE}, + {"nntp://hostname/", URL_PART_HOSTNAME, URL_PARTFLAG_KEEPSCHEME, S_OK, "nntp:hostname", .todo_hr = TRUE}, + {"snews://hostname/", URL_PART_HOSTNAME, URL_PARTFLAG_KEEPSCHEME, S_OK, "snews:hostname", .todo_hr = TRUE}, + {"telnet://hostname/", URL_PART_HOSTNAME, URL_PARTFLAG_KEEPSCHEME, S_OK, "telnet:hostname"}, };
+ winetest_mute_threshold = 5; + hr = UrlGetPartA(NULL, NULL, NULL, URL_PART_SCHEME, 0); ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr);
@@ -660,10 +782,13 @@ static void test_UrlGetPart(void) size = 1; strcpy(buffer, "x"); hr = UrlGetPartA(url, buffer, &size, part, flags); - if (tests[i].hr == S_OK) - ok(hr == E_POINTER, "Got hr %#x.\n", hr); - else - ok(hr == tests[i].hr, "Got hr %#x.\n", hr); + todo_wine_if (tests[i].todo_hr || !strcmp(url, "http://host?a:b@c:d")) + { + if (tests[i].hr == S_OK) + ok(hr == E_POINTER, "Got hr %#x.\n", hr); + else + ok(hr == tests[i].hr, "Got hr %#x.\n", hr); + }
if (hr == S_FALSE) { @@ -673,22 +798,35 @@ static void test_UrlGetPart(void) else { if (hr == E_POINTER) - todo_wine_if (part == URL_PART_QUERY && expect[0]) - ok(size == strlen(expect) + 1, "Got size %u.\n", size); + { + if (expect) + { + todo_wine_if (tests[i].todo_hr || tests[i].todo_result) + ok(size == strlen(expect) + 1, "Got size %u.\n", size); + } + } else - ok(size == 1, "Got size %u.\n", size); - ok(!strcmp(buffer, "x"), "Got result %s.\n", debugstr_a(buffer)); + { + todo_wine_if (hr == S_OK) + ok(size == 1, "Got size %u.\n", size); + } + todo_wine_if (hr == S_OK) + ok(!strcmp(buffer, "x"), "Got result %s.\n", debugstr_a(buffer)); }
size = sizeof(buffer); strcpy(buffer, "x"); hr = UrlGetPartA(url, buffer, &size, part, flags); - ok(hr == tests[i].hr, "Got hr %#x.\n", hr); + todo_wine_if (tests[i].todo_hr) + ok(hr == tests[i].hr, "Got hr %#x.\n", hr); if (SUCCEEDED(hr)) { ok(size == strlen(buffer), "Got size %u.\n", size); - todo_wine_if (part == URL_PART_QUERY && expect[0]) - ok(!strcmp(buffer, expect), "Got result %s.\n", debugstr_a(buffer)); + if (expect) + { + todo_wine_if (tests[i].todo_hr || tests[i].todo_result) + ok(!strcmp(buffer, expect), "Got result %s.\n", debugstr_a(buffer)); + } } else { @@ -697,16 +835,51 @@ static void test_UrlGetPart(void) }
MultiByteToWideChar(CP_ACP, 0, url, -1, urlW, ARRAY_SIZE(urlW)); + + size = 1; + wcscpy(bufferW, L"x"); + hr = UrlGetPartW(urlW, bufferW, &size, part, flags); + todo_wine_if ((tests[i].todo_hr || tests[i].hr == S_FALSE) && !(strchr(url, '"') && part == URL_PART_USERNAME)) + { + if (tests[i].hr == S_OK) + ok(hr == E_POINTER, "Got hr %#x.\n", hr); + else + ok(hr == (tests[i].hr == S_FALSE ? S_OK : tests[i].hr), "Got hr %#x.\n", hr); + } + + if (hr == S_OK) + { + ok(!size, "Got size %u.\n", size); + ok(!buffer[0], "Got result %s.\n", debugstr_a(buffer)); + } + else + { + if (hr == E_POINTER) + { + if (expect) + { + todo_wine_if (tests[i].todo_hr || tests[i].todo_result) + ok(size == strlen(expect) + 1, "Got size %u.\n", size); + } + } + else + { + todo_wine ok(size == 1, "Got size %u.\n", size); + } + todo_wine ok(!wcscmp(bufferW, L"x"), "Got result %s.\n", debugstr_w(bufferW)); + } + size = ARRAY_SIZE(bufferW); wcscpy(bufferW, L"x"); hr = UrlGetPartW(urlW, bufferW, &size, part, flags); - todo_wine_if (tests[i].hr == S_FALSE) + todo_wine_if ((tests[i].hr == S_FALSE || tests[i].todo_hr) && strcmp(url, "a:") && strcmp(url, "0:")) ok(hr == (tests[i].hr == S_FALSE ? S_OK : tests[i].hr), "Got hr %#x.\n", hr); if (SUCCEEDED(hr)) { ok(size == wcslen(bufferW), "Got size %u.\n", size); MultiByteToWideChar(CP_ACP, 0, buffer, -1, expectW, ARRAY_SIZE(expectW)); - ok(!wcscmp(bufferW, expectW), "Got result %s.\n", debugstr_w(bufferW)); + todo_wine_if (strstr(url, "news") || strstr(url, "nntp")) + ok(!wcscmp(bufferW, expectW), "Got result %s.\n", debugstr_w(bufferW)); } else { @@ -716,6 +889,8 @@ static void test_UrlGetPart(void)
winetest_pop_context(); } + + winetest_mute_threshold = 42; }
/* ########################### */