You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-09-12 18:50:20 -07:00
Rebase against d9f3ea328785d4146a095ce2efbdbb7c1f69f1cf.
This commit is contained in:
@@ -1,83 +1,66 @@
|
||||
From ba33fe7790adb2bbd335470b00a419bf051d9ae0 Mon Sep 17 00:00:00 2001
|
||||
From 25d11abe74d0f13f34cbc27ce33a1246fcafc0b2 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 +++++++++++++++++++++++++++++++---------
|
||||
1 file changed, 36 insertions(+), 10 deletions(-)
|
||||
dlls/shlwapi/tests/url.c | 30 +++++++++++++++++++++++++-----
|
||||
1 file changed, 25 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/dlls/shlwapi/tests/url.c b/dlls/shlwapi/tests/url.c
|
||||
index 4f1f15b6e2c..04281a7a77d 100644
|
||||
index eea254442c6..8e17969d0c5 100644
|
||||
--- a/dlls/shlwapi/tests/url.c
|
||||
+++ b/dlls/shlwapi/tests/url.c
|
||||
@@ -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},
|
||||
+ {"/:test\\", 0, S_OK, "/:test\\", TRUE},
|
||||
{"/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"},
|
||||
@@ -362,6 +370,7 @@ typedef struct _TEST_URL_COMBINE {
|
||||
@@ -190,6 +190,14 @@ static const TEST_URL_CANONICALIZE TEST_CANONICALIZE[] = {
|
||||
{"./A", URL_DONT_SIMPLIFY, "./A", FALSE},
|
||||
{"A/./B", 0, "A/B", TRUE},
|
||||
{"A/../B", 0, "B", TRUE},
|
||||
+ {"A/../B/./../C", 0, "C", TRUE},
|
||||
+ {"A/../B/./../C", URL_DONT_SIMPLIFY, "A/../B/./../C", FALSE},
|
||||
+ {".\\A", 0, ".\\A", FALSE},
|
||||
+ {"A\\.\\B", 0, "A\\.\\B", FALSE},
|
||||
+ {".", 0, "/", TRUE},
|
||||
+ {"./A", 0, "A", TRUE},
|
||||
+ {"A/./B", 0, "A/B", TRUE},
|
||||
+ {"/:test\\", 0, "/:test\\", TRUE},
|
||||
{"/uri-res/N2R?urn:sha1:B3K", URL_DONT_ESCAPE_EXTRA_INFO | URL_WININET_COMPATIBILITY /*0x82000000*/, "/uri-res/N2R?urn:sha1:B3K", FALSE} /*LimeWire online installer calls this*/,
|
||||
{"http:www.winehq.org/dir/../index.html", 0, "http:www.winehq.org/index.html"},
|
||||
{"http://localhost/test.html", URL_FILE_USE_PATHURL, "http://localhost/test.html"},
|
||||
@@ -339,6 +347,7 @@ typedef struct _TEST_URL_COMBINE {
|
||||
const char *url2;
|
||||
DWORD flags;
|
||||
HRESULT expectret;
|
||||
const char *expecturl;
|
||||
+ BOOL todo;
|
||||
} TEST_URL_COMBINE;
|
||||
|
||||
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"},
|
||||
+ {"http://www.winehq.org/tests17", ".", 0, S_OK, "http://www.winehq.org/", TRUE},
|
||||
+ {"http://www.winehq.org/tests18/test", ".", 0, S_OK, "http://www.winehq.org/tests18/", TRUE},
|
||||
+ {"http://www.winehq.org/tests19/test", "./", 0, S_OK, "http://www.winehq.org/tests19/", FALSE},
|
||||
+ {"http://www.winehq.org/tests20/test", "/", 0, S_OK, "http://www.winehq.org/", FALSE},
|
||||
+ {"http://www.winehq.org/tests/test", "./test21", 0, S_OK, "http://www.winehq.org/tests/test21", FALSE},
|
||||
+ {"http://www.winehq.org/tests/test", "./test22/../test", 0, S_OK, "http://www.winehq.org/tests/test", FALSE},
|
||||
+ {"http://www.winehq.org/tests/", "http://www.winehq.org:80/tests23", 0, S_OK, "http://www.winehq.org/tests23", TRUE},
|
||||
+ {"http://www.winehq.org/tests/", "tests24/./test/../test", 0, S_OK, "http://www.winehq.org/tests/tests24/test", FALSE},
|
||||
+ {"http://www.winehq.org/tests/./tests25", "./", 0, S_OK, "http://www.winehq.org/tests/", FALSE},
|
||||
{"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"},
|
||||
@@ -1233,7 +1251,7 @@ static void test_UrlCanonicalizeW(void)
|
||||
@@ -1157,7 +1166,7 @@ static void test_UrlCanonicalizeW(void)
|
||||
|
||||
/* ########################### */
|
||||
|
||||
-static void test_url_combine(const char *szUrl1, const char *szUrl2, DWORD dwFlags, HRESULT dwExpectReturn, const char *szExpectUrl)
|
||||
+static void test_url_combine(const char *szUrl1, const char *szUrl2, DWORD dwFlags, HRESULT dwExpectReturn, const char *szExpectUrl, BOOL todo)
|
||||
-static void check_url_combine(const char *szUrl1, const char *szUrl2, DWORD dwFlags, const char *szExpectUrl)
|
||||
+static void check_url_combine(const char *szUrl1, const char *szUrl2, DWORD dwFlags, const char *szExpectUrl, BOOL todo)
|
||||
{
|
||||
HRESULT hr;
|
||||
CHAR szReturnUrl[INTERNET_MAX_URL_LENGTH];
|
||||
@@ -1258,34 +1276,42 @@ static void test_url_combine(const char *szUrl1, const char *szUrl2, DWORD dwFla
|
||||
@@ -1177,17 +1186,28 @@ static void check_url_combine(const char *szUrl1, const char *szUrl2, DWORD dwFl
|
||||
dwSize = 0;
|
||||
hr = pUrlCombineA(szUrl1, szUrl2, NULL, &dwSize, dwFlags);
|
||||
hr = UrlCombineA(szUrl1, szUrl2, NULL, &dwSize, dwFlags);
|
||||
ok(hr == E_POINTER, "Checking length of string, return was 0x%08x, expected 0x%08x\n", hr, E_POINTER);
|
||||
- ok(dwSize == dwExpectLen+1, "Got length %d, expected %d\n", dwSize, dwExpectLen+1);
|
||||
+ ok(todo || dwSize == dwExpectLen+1, "Got length %d, expected %d\n", dwSize, dwExpectLen+1);
|
||||
|
||||
dwSize--;
|
||||
hr = pUrlCombineA(szUrl1, szUrl2, szReturnUrl, &dwSize, dwFlags);
|
||||
hr = UrlCombineA(szUrl1, szUrl2, szReturnUrl, &dwSize, dwFlags);
|
||||
ok(hr == E_POINTER, "UrlCombineA returned 0x%08x, expected 0x%08x\n", hr, E_POINTER);
|
||||
- ok(dwSize == dwExpectLen+1, "Got length %d, expected %d\n", dwSize, dwExpectLen+1);
|
||||
+ ok(todo || dwSize == dwExpectLen+1, "Got length %d, expected %d\n", dwSize, dwExpectLen+1);
|
||||
|
||||
hr = pUrlCombineA(szUrl1, szUrl2, szReturnUrl, &dwSize, dwFlags);
|
||||
ok(hr == dwExpectReturn, "UrlCombineA returned 0x%08x, expected 0x%08x\n", hr, dwExpectReturn);
|
||||
- ok(dwSize == dwExpectLen, "Got length %d, expected %d\n", dwSize, dwExpectLen);
|
||||
- if(SUCCEEDED(hr)) {
|
||||
- ok(strcmp(szReturnUrl,szExpectUrl)==0, "Expected %s, but got %s\n", szExpectUrl, szReturnUrl);
|
||||
hr = UrlCombineA(szUrl1, szUrl2, szReturnUrl, &dwSize, dwFlags);
|
||||
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
|
||||
ok(dwSize == dwExpectLen, "Got length %d, expected %d\n", dwSize, dwExpectLen);
|
||||
- ok(!strcmp(szReturnUrl, szExpectUrl), "Expected %s, got %s.\n", szExpectUrl, szReturnUrl);
|
||||
+
|
||||
+ if (todo)
|
||||
+ {
|
||||
@@ -89,37 +72,19 @@ index 4f1f15b6e2c..04281a7a77d 100644
|
||||
+ ok(dwSize == dwExpectLen, "Got length %d, expected %d\n", dwSize, dwExpectLen);
|
||||
+ if (SUCCEEDED(hr))
|
||||
+ ok(strcmp(szReturnUrl, szExpectUrl)==0, "Expected %s, but got %s\n", szExpectUrl, szReturnUrl);
|
||||
}
|
||||
+ }
|
||||
|
||||
if (pUrlCombineW) {
|
||||
dwSize = 0;
|
||||
hr = pUrlCombineW(wszUrl1, wszUrl2, NULL, &dwSize, dwFlags);
|
||||
ok(hr == E_POINTER, "Checking length of string, return was 0x%08x, expected 0x%08x\n", hr, E_POINTER);
|
||||
- ok(dwSize == dwExpectLen+1, "Got length %d, expected %d\n", dwSize, dwExpectLen+1);
|
||||
+ ok(todo || dwSize == dwExpectLen+1, "Got length %d, expected %d\n", dwSize, dwExpectLen+1);
|
||||
|
||||
dwSize--;
|
||||
hr = pUrlCombineW(wszUrl1, wszUrl2, wszReturnUrl, &dwSize, dwFlags);
|
||||
ok(hr == E_POINTER, "UrlCombineW returned 0x%08x, expected 0x%08x\n", hr, E_POINTER);
|
||||
- ok(dwSize == dwExpectLen+1, "Got length %d, expected %d\n", dwSize, dwExpectLen+1);
|
||||
+ ok(todo || dwSize == dwExpectLen+1, "Got length %d, expected %d\n", dwSize, dwExpectLen+1);
|
||||
|
||||
hr = pUrlCombineW(wszUrl1, wszUrl2, wszReturnUrl, &dwSize, dwFlags);
|
||||
ok(hr == dwExpectReturn, "UrlCombineW returned 0x%08x, expected 0x%08x\n", hr, dwExpectReturn);
|
||||
- ok(dwSize == dwExpectLen, "Got length %d, expected %d\n", dwSize, dwExpectLen);
|
||||
+ ok(todo || dwSize == dwExpectLen, "Got length %d, expected %d\n", dwSize, dwExpectLen);
|
||||
if(SUCCEEDED(hr)) {
|
||||
wszConvertedUrl = GetWideString(szReturnUrl);
|
||||
ok(lstrcmpW(wszReturnUrl, wszConvertedUrl)==0, "Strings didn't match between ansi and unicode UrlCombine!\n");
|
||||
@@ -1305,7 +1331,7 @@ static void test_UrlCombine(void)
|
||||
dwSize = 0;
|
||||
hr = UrlCombineW(wszUrl1, wszUrl2, NULL, &dwSize, dwFlags);
|
||||
@@ -1218,7 +1238,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,
|
||||
- TEST_COMBINE[i].expectret, TEST_COMBINE[i].expecturl);
|
||||
+ TEST_COMBINE[i].expectret, TEST_COMBINE[i].expecturl, TEST_COMBINE[i].todo);
|
||||
- check_url_combine(TEST_COMBINE[i].url1, TEST_COMBINE[i].url2, TEST_COMBINE[i].flags, TEST_COMBINE[i].expecturl);
|
||||
+ check_url_combine(TEST_COMBINE[i].url1, TEST_COMBINE[i].url2, TEST_COMBINE[i].flags, TEST_COMBINE[i].expecturl, TEST_COMBINE[i].todo);
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
2.33.0
|
||||
2.34.1
|
||||
|
||||
|
@@ -1,33 +1,18 @@
|
||||
From 2f01abc1d6018646cdaa94e087b1a0444c31a0c7 Mon Sep 17 00:00:00 2001
|
||||
From 38ec9774394d778a1f2fdbafb3e80eaf111a5edb Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Fri, 17 Jan 2014 01:27:53 +0100
|
||||
Subject: shlwapi: UrlCombineW workaround for relative paths
|
||||
Subject: [PATCH] shlwapi: UrlCombineW workaround for relative paths
|
||||
|
||||
---
|
||||
dlls/shlwapi/tests/url.c | 4 ++--
|
||||
dlls/shlwapi/url.c | 5 ++++-
|
||||
2 files changed, 6 insertions(+), 3 deletions(-)
|
||||
dlls/kernelbase/path.c | 5 ++++-
|
||||
dlls/shlwapi/tests/url.c | 2 ++
|
||||
2 files changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/shlwapi/tests/url.c b/dlls/shlwapi/tests/url.c
|
||||
index ecbdfab..8a99f7e 100644
|
||||
--- a/dlls/shlwapi/tests/url.c
|
||||
+++ b/dlls/shlwapi/tests/url.c
|
||||
@@ -338,8 +338,8 @@ 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"},
|
||||
- {"http://www.winehq.org/tests17", ".", 0, S_OK, "http://www.winehq.org/", TRUE},
|
||||
- {"http://www.winehq.org/tests18/test", ".", 0, S_OK, "http://www.winehq.org/tests18/", TRUE},
|
||||
+ {"http://www.winehq.org/tests17", ".", 0, S_OK, "http://www.winehq.org/"},
|
||||
+ {"http://www.winehq.org/tests18/test", ".", 0, S_OK, "http://www.winehq.org/tests18/"},
|
||||
{"http://www.winehq.org/tests19/test", "./", 0, S_OK, "http://www.winehq.org/tests19/", FALSE},
|
||||
{"http://www.winehq.org/tests20/test", "/", 0, S_OK, "http://www.winehq.org/", FALSE},
|
||||
{"http://www.winehq.org/tests/test", "./test21", 0, S_OK, "http://www.winehq.org/tests/test21", FALSE},
|
||||
diff --git a/dlls/kernelbase/path.c b/dlls/kernelbase/path.c
|
||||
index 82708be5444..8d2739b40e8 100644
|
||||
index 07457dcfc1b..665d0bb7355 100644
|
||||
--- a/dlls/kernelbase/path.c
|
||||
+++ b/dlls/kernelbase/path.c
|
||||
@@ -4990,7 +4990,10 @@ HRESULT WINAPI UrlCombineW(const WCHAR *baseW, const WCHAR *relativeW, WCHAR *co
|
||||
@@ -4926,7 +4926,10 @@ HRESULT WINAPI UrlCombineW(const WCHAR *baseW, const WCHAR *relativeW, WCHAR *co
|
||||
work = preliminary + base.cchProtocol + 1 + base.cchSuffix - 1;
|
||||
if (*work++ != '/')
|
||||
*(work++) = '/';
|
||||
@@ -39,6 +24,19 @@ index 82708be5444..8d2739b40e8 100644
|
||||
break;
|
||||
|
||||
default:
|
||||
diff --git a/dlls/shlwapi/tests/url.c b/dlls/shlwapi/tests/url.c
|
||||
index 8e17969d0c5..d696061377c 100644
|
||||
--- a/dlls/shlwapi/tests/url.c
|
||||
+++ b/dlls/shlwapi/tests/url.c
|
||||
@@ -369,6 +369,8 @@ static const TEST_URL_COMBINE TEST_COMBINE[] = {
|
||||
{"http://www.winehq.org/test14#aaa/bbb#ccc", "#", 0, "http://www.winehq.org/test14#"},
|
||||
{"http://www.winehq.org/tests/?query=x/y/z", "tests15", 0, "http://www.winehq.org/tests/tests15"},
|
||||
{"http://www.winehq.org/tests/?query=x/y/z#example", "tests16", 0, "http://www.winehq.org/tests/tests16"},
|
||||
+ {"http://www.winehq.org/tests17", ".", 0, "http://www.winehq.org/"},
|
||||
+ {"http://www.winehq.org/tests18/test", ".", 0, "http://www.winehq.org/tests18/"},
|
||||
{"file:///C:\\dir\\file.txt", "test.txt", 0, "file:///C:/dir/test.txt"},
|
||||
{"file:///C:\\dir\\file.txt#hash\\hash", "test.txt", 0, "file:///C:/dir/file.txt#hash/test.txt"},
|
||||
{"file:///C:\\dir\\file.html#hash\\hash", "test.html", 0, "file:///C:/dir/test.html"},
|
||||
--
|
||||
1.7.9.5
|
||||
2.34.1
|
||||
|
||||
|
Reference in New Issue
Block a user