Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Aleksandr Isakov
wine-fonts
Commits
81cf4abb
Commit
81cf4abb
authored
Jan 17, 2014
by
Sebastian Lackner
Committed by
Vitaly Lipatov
Jul 30, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shlwapi/tests: Add additional tests for UrlCombine and UrlCanonicalize
parent
8fdcd6d9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
5 deletions
+25
-5
url.c
dlls/shlwapi/tests/url.c
+25
-5
No files found.
dlls/shlwapi/tests/url.c
View file @
81cf4abb
...
...
@@ -183,6 +183,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"
},
...
...
@@ -318,6 +326,7 @@ typedef struct _TEST_URL_COMBINE {
const
char
*
url2
;
DWORD
flags
;
const
char
*
expecturl
;
BOOL
todo
;
}
TEST_URL_COMBINE
;
static
const
TEST_URL_COMBINE
TEST_COMBINE
[]
=
{
...
...
@@ -1233,7 +1242,7 @@ static void test_UrlCanonicalizeW(void)
/* ########################### */
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
];
...
...
@@ -1253,17 +1262,28 @@ static void check_url_combine(const char *szUrl1, const char *szUrl2, DWORD dwFl
dwSize
=
0
;
hr
=
UrlCombineA
(
szUrl1
,
szUrl2
,
NULL
,
&
dwSize
,
dwFlags
);
ok
(
hr
==
E_POINTER
,
"Checking length of string, return was 0x%08lx, expected 0x%08lx
\n
"
,
hr
,
E_POINTER
);
ok
(
dwSize
==
dwExpectLen
+
1
,
"Got length %ld, expected %ld
\n
"
,
dwSize
,
dwExpectLen
+
1
);
ok
(
todo
||
dwSize
==
dwExpectLen
+
1
,
"Got length %ld, expected %ld
\n
"
,
dwSize
,
dwExpectLen
+
1
);
dwSize
--
;
hr
=
UrlCombineA
(
szUrl1
,
szUrl2
,
szReturnUrl
,
&
dwSize
,
dwFlags
);
ok
(
hr
==
E_POINTER
,
"UrlCombineA returned 0x%08lx, expected 0x%08lx
\n
"
,
hr
,
E_POINTER
);
ok
(
dwSize
==
dwExpectLen
+
1
,
"Got length %ld, expected %ld
\n
"
,
dwSize
,
dwExpectLen
+
1
);
ok
(
todo
||
dwSize
==
dwExpectLen
+
1
,
"Got length %ld, expected %ld
\n
"
,
dwSize
,
dwExpectLen
+
1
);
hr
=
UrlCombineA
(
szUrl1
,
szUrl2
,
szReturnUrl
,
&
dwSize
,
dwFlags
);
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
ok
(
dwSize
==
dwExpectLen
,
"Got length %ld, expected %ld
\n
"
,
dwSize
,
dwExpectLen
);
ok
(
!
strcmp
(
szReturnUrl
,
szExpectUrl
),
"Expected %s, got %s.
\n
"
,
szExpectUrl
,
szReturnUrl
);
if
(
todo
)
{
todo_wine
ok
(
dwSize
==
dwExpectLen
&&
(
FAILED
(
hr
)
||
strcmp
(
szReturnUrl
,
szExpectUrl
)
==
0
),
"Expected %s (len=%ld), but got %s (len=%ld)
\n
"
,
szExpectUrl
,
dwExpectLen
,
SUCCEEDED
(
hr
)
?
szReturnUrl
:
"(null)"
,
dwSize
);
}
else
{
ok
(
dwSize
==
dwExpectLen
,
"Got length %ld, expected %ld
\n
"
,
dwSize
,
dwExpectLen
);
if
(
SUCCEEDED
(
hr
))
ok
(
strcmp
(
szReturnUrl
,
szExpectUrl
)
==
0
,
"Expected %s, but got %s
\n
"
,
szExpectUrl
,
szReturnUrl
);
}
dwSize
=
0
;
hr
=
UrlCombineW
(
wszUrl1
,
wszUrl2
,
NULL
,
&
dwSize
,
dwFlags
);
...
...
@@ -1294,7 +1314,7 @@ static void test_UrlCombine(void)
{
unsigned
int
i
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
TEST_COMBINE
);
i
++
)
{
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
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment