From: Jactry Zeng jzeng@codeweavers.com
Signed-off-by: Jactry Zeng jzeng@codeweavers.com --- dlls/shlwapi/tests/url.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/dlls/shlwapi/tests/url.c b/dlls/shlwapi/tests/url.c index 4a788c5ff51..02d306077b4 100644 --- a/dlls/shlwapi/tests/url.c +++ b/dlls/shlwapi/tests/url.c @@ -412,13 +412,20 @@ static struct const WCHAR *url; const WCHAR *expect; DWORD flags; + const WCHAR *win7_expect; } TEST_URL_UNESCAPEW[] = { { L"file://foo/bar", L"file://foo/bar" }, { L"file://fo%20o%5Ca/bar", L"file://fo o\a/bar" }, { L"file://%24%25foobar", L"file://$%foobar" }, { L"file:///C:/Program Files", L"file:///C:/Program Files" }, + { L"file:///C:/Program Files", L"file:///C:/Program Files", URL_UNESCAPE_AS_UTF8 }, { L"file:///C:/Program%20Files", L"file:///C:/Program Files" }, + { L"file:///C:/Program%20Files", L"file:///C:/Program Files", URL_UNESCAPE_AS_UTF8 }, + { L"file://foo/%E4%B8%AD%E6%96%87/bar", L"file://foo/\xe4\xb8\xad\xe6\x96\x87/bar" }, /* with 3 btyes utf-8 */ + { L"file://foo/%E4%B8%AD%E6%96%87/bar", L"file://foo/\x4e2d\x6587/bar", URL_UNESCAPE_AS_UTF8, L"file://foo/\xe4\xb8\xad\xe6\x96\x87/bar" }, + { L"file://foo/%F0%9F%8D%B7/bar", L"file://foo/\xf0\x9f\x8d\xb7/bar" }, /* with 4 btyes utf-8 */ + { L"file://foo/%F0%9F%8D%B7/bar", L"file://foo/\xd83c\xdf77/bar", URL_UNESCAPE_AS_UTF8, L"file://foo/\xf0\x9f\x8d\xb7/bar" }, };
static const struct { @@ -1437,9 +1444,11 @@ static void test_UrlUnescape(void) unescaped = INTERNET_MAX_URL_LENGTH; res = UrlUnescapeW(urlW, bufferW, &unescaped, TEST_URL_UNESCAPEW[i].flags); ok(res == S_OK, "[%d]: returned %#lx.\n", i, res); - ok(unescaped == lstrlenW(TEST_URL_UNESCAPEW[i].expect), + ok(unescaped == lstrlenW(TEST_URL_UNESCAPEW[i].expect) + || broken(unescaped == lstrlenW(TEST_URL_UNESCAPEW[i].win7_expect)), "[%d]: got unescaped %ld.\n", i, unescaped); - ok(!lstrcmpW(bufferW, TEST_URL_UNESCAPEW[i].expect), + ok(!lstrcmpW(bufferW, TEST_URL_UNESCAPEW[i].expect) + || broken(!lstrcmpW(bufferW, TEST_URL_UNESCAPEW[i].win7_expect)), "[%d]: got result "%s".\n", i, debugstr_w(bufferW));
/* Test with URL_UNESCAPE_INPLACE */ @@ -1447,7 +1456,8 @@ static void test_UrlUnescape(void) res = UrlUnescapeW(urlW, NULL, &unescaped, TEST_URL_UNESCAPEW[i].flags | URL_UNESCAPE_INPLACE); ok(res == S_OK, "[%d]: returned %#lx.\n", i, res); ok(unescaped == INTERNET_MAX_URL_LENGTH, "[%d]: got unescaped %ld.\n", i, unescaped); - ok(!lstrcmpW(urlW, TEST_URL_UNESCAPEW[i].expect), + ok(!lstrcmpW(urlW, TEST_URL_UNESCAPEW[i].expect) + || broken(!lstrcmpW(urlW, TEST_URL_UNESCAPEW[i].win7_expect)), "[%d]: got result "%s".\n", i, debugstr_w(urlW));
unescaped = lstrlenW(TEST_URL_UNESCAPEW[i].expect) - 1;