Added shlwapi-UrlCanonicalize patchset

This commit is contained in:
Alistair Leslie-Hughes
2019-07-01 08:17:41 +10:00
parent fbb8eac819
commit 292e3c87d9
4 changed files with 104 additions and 15 deletions

View File

@@ -1,26 +1,25 @@
From d753083297595b1ed4d3533587ddc21dee47fd88 Mon Sep 17 00:00:00 2001
From 95dcb9cf88979d5894c300a71a080470dcefde87 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Fri, 17 Jan 2014 01:19:41 +0100
Subject: [PATCH] shlwapi/tests: Add additional tests for UrlCombine and
UrlCanonicalize
---
dlls/shlwapi/tests/url.c | 46 ++++++++++++++++++++++++++++++++++++----------
dlls/shlwapi/tests/url.c | 46 +++++++++++++++++++++++++++++++---------
1 file changed, 36 insertions(+), 10 deletions(-)
diff --git a/dlls/shlwapi/tests/url.c b/dlls/shlwapi/tests/url.c
index d30737f..37df286 100644
index 96635c98361..90e0d2e1b10 100644
--- a/dlls/shlwapi/tests/url.c
+++ b/dlls/shlwapi/tests/url.c
@@ -204,7 +204,15 @@ static const TEST_URL_CANONICALIZE TEST_CANONICALIZE[] = {
{"///A/../B", URL_WININET_COMPATIBILITY, S_OK, "///B", FALSE},
{"A", 0, S_OK, "A", FALSE},
{"../A", 0, S_OK, "../A", FALSE},
+ {".\\A", 0, S_OK, ".\\A", FALSE},
+ {"A\\.\\B", 0, S_OK, "A\\.\\B", FALSE},
@@ -209,6 +209,14 @@ static const TEST_URL_CANONICALIZE TEST_CANONICALIZE[] = {
{"./A", URL_DONT_SIMPLIFY, S_OK, "./A", FALSE},
{"A/./B", 0, S_OK, "A/B", TRUE},
{"A/../B", 0, S_OK, "B", TRUE},
+ {"A/../B/./../C", 0, S_OK, "C", TRUE},
+ {"A/../B/./../C", URL_DONT_SIMPLIFY, S_OK, "A/../B/./../C", FALSE},
+ {".\\A", 0, S_OK, ".\\A", FALSE},
+ {"A\\.\\B", 0, S_OK, "A\\.\\B", FALSE},
+ {".", 0, S_OK, "/", TRUE},
+ {"./A", 0, S_OK, "A", TRUE},
+ {"A/./B", 0, S_OK, "A/B", TRUE},
@@ -28,7 +27,7 @@ index d30737f..37df286 100644
{"/uri-res/N2R?urn:sha1:B3K", URL_DONT_ESCAPE_EXTRA_INFO | URL_WININET_COMPATIBILITY /*0x82000000*/, S_OK, "/uri-res/N2R?urn:sha1:B3K", FALSE} /*LimeWire online installer calls this*/,
{"http:www.winehq.org/dir/../index.html", 0, S_OK, "http:www.winehq.org/index.html"},
{"http://localhost/test.html", URL_FILE_USE_PATHURL, S_OK, "http://localhost/test.html"},
@@ -358,6 +366,7 @@ typedef struct _TEST_URL_COMBINE {
@@ -362,6 +370,7 @@ typedef struct _TEST_URL_COMBINE {
DWORD flags;
HRESULT expectret;
const char *expecturl;
@@ -36,7 +35,7 @@ index d30737f..37df286 100644
} TEST_URL_COMBINE;
static const TEST_URL_COMBINE TEST_COMBINE[] = {
@@ -379,6 +388,15 @@ static const TEST_URL_COMBINE TEST_COMBINE[] = {
@@ -383,6 +392,15 @@ static const TEST_URL_COMBINE TEST_COMBINE[] = {
{"http://www.winehq.org/test14#aaa/bbb#ccc", "#", 0, S_OK, "http://www.winehq.org/test14#"},
{"http://www.winehq.org/tests/?query=x/y/z", "tests15", 0, S_OK, "http://www.winehq.org/tests/tests15"},
{"http://www.winehq.org/tests/?query=x/y/z#example", "tests16", 0, S_OK, "http://www.winehq.org/tests/tests16"},
@@ -52,7 +51,7 @@ index d30737f..37df286 100644
{"file:///C:\\dir\\file.txt", "test.txt", 0, S_OK, "file:///C:/dir/test.txt"},
{"file:///C:\\dir\\file.txt#hash\\hash", "test.txt", 0, S_OK, "file:///C:/dir/file.txt#hash/test.txt"},
{"file:///C:\\dir\\file.html#hash\\hash", "test.html", 0, S_OK, "file:///C:/dir/test.html"},
@@ -1197,7 +1215,7 @@ static void test_UrlCanonicalizeW(void)
@@ -1201,7 +1219,7 @@ static void test_UrlCanonicalizeW(void)
/* ########################### */
@@ -61,7 +60,7 @@ index d30737f..37df286 100644
{
HRESULT hr;
CHAR szReturnUrl[INTERNET_MAX_URL_LENGTH];
@@ -1222,34 +1240,42 @@ static void test_url_combine(const char *szUrl1, const char *szUrl2, DWORD dwFla
@@ -1226,34 +1244,42 @@ static void test_url_combine(const char *szUrl1, const char *szUrl2, DWORD dwFla
dwSize = 0;
hr = pUrlCombineA(szUrl1, szUrl2, NULL, &dwSize, dwFlags);
ok(hr == E_POINTER, "Checking length of string, return was 0x%08x, expected 0x%08x\n", hr, E_POINTER);
@@ -112,7 +111,7 @@ index d30737f..37df286 100644
if(SUCCEEDED(hr)) {
wszConvertedUrl = GetWideString(szReturnUrl);
ok(lstrcmpW(wszReturnUrl, wszConvertedUrl)==0, "Strings didn't match between ascii and unicode UrlCombine!\n");
@@ -1269,7 +1295,7 @@ static void test_UrlCombine(void)
@@ -1273,7 +1299,7 @@ static void test_UrlCombine(void)
unsigned int i;
for (i = 0; i < ARRAY_SIZE(TEST_COMBINE); i++) {
test_url_combine(TEST_COMBINE[i].url1, TEST_COMBINE[i].url2, TEST_COMBINE[i].flags,
@@ -122,5 +121,5 @@ index d30737f..37df286 100644
}
--
1.9.1
2.17.1