Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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
wine
wine-winehq
Commits
3655187f
Commit
3655187f
authored
May 23, 2005
by
Uwe Bonnes
Committed by
Alexandre Julliard
May 23, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test cases for URL_UNESCAPE and small fix.
parent
a5612755
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
3 deletions
+10
-3
path.c
dlls/shlwapi/tests/path.c
+8
-1
url.c
dlls/shlwapi/url.c
+2
-2
No files found.
dlls/shlwapi/tests/path.c
View file @
3655187f
...
...
@@ -61,6 +61,9 @@ const TEST_URL_CANONICALIZE TEST_CANONICALIZE[] = {
{
"http://www.winehq.org/tests/..#example"
,
0
,
S_OK
,
"http://www.winehq.org/#example"
},
{
"http://www.winehq.org/tests/../#example"
,
0
,
S_OK
,
"http://www.winehq.org/#example"
},
{
"http://www.winehq.org/tests/../#example"
,
URL_DONT_SIMPLIFY
,
S_OK
,
"http://www.winehq.org/tests/../#example"
},
{
"http://www.winehq.org/tests/foo bar"
,
URL_ESCAPE_SPACES_ONLY
|
URL_DONT_ESCAPE_EXTRA_INFO
,
S_OK
,
"http://www.winehq.org/tests/foo%20bar"
},
{
"http://www.winehq.org/tests/foo%20bar"
,
URL_UNESCAPE
,
S_OK
,
"http://www.winehq.org/tests/foo bar"
},
{
"file:///c:/tests/foo%20bar"
,
URL_UNESCAPE
,
S_OK
,
"file:///c:/tests/foo bar"
},
};
typedef
struct
_TEST_URL_ESCAPE
{
...
...
@@ -185,6 +188,7 @@ struct {
{
"c:
\\
foo
\\
bar"
,
"file:///c:/foo/bar"
,
S_OK
},
{
"c:foo
\\
bar"
,
"file:///c:foo/bar"
,
S_OK
},
{
"c:
\\
foo/b a%r"
,
"file:///c:/foo/b%20a%25r"
,
S_OK
},
{
"c:
\\
foo
\\
foo bar"
,
"file:///c:/foo/foo%20bar"
,
S_OK
},
#if 0
/* The following test fails on native shlwapi as distributed with Win95/98.
* Wine matches the behaviour of later versions.
...
...
@@ -219,6 +223,7 @@ struct {
{
"file:c|/foo/bar"
,
"c:
\\
foo
\\
bar"
,
S_OK
},
{
"file:cx|/foo/bar"
,
"cx|
\\
foo
\\
bar"
,
S_OK
},
{
"file:////c:/foo/bar"
,
"c:
\\
foo
\\
bar"
,
S_OK
},
/* {"file:////c:/foo/foo%20bar", "c:\\foo\\foo%20bar", S_OK},*/
{
"c:
\\
foo
\\
bar"
,
NULL
,
E_INVALIDARG
},
{
"foo/bar"
,
NULL
,
E_INVALIDARG
},
...
...
@@ -387,10 +392,12 @@ static void test_url_canonicalize(const char *szUrl, DWORD dwFlags, HRESULT dwEx
DWORD
dwSize
;
dwSize
=
INTERNET_MAX_URL_LENGTH
;
ok
(
UrlCanonicalizeA
(
szUrl
,
NULL
,
&
dwSize
,
dwFlags
)
!=
dwExpectReturn
,
"Unexpected return for NULL buffer
\n
"
);
ok
(
UrlCanonicalizeA
(
szUrl
,
szReturnUrl
,
&
dwSize
,
dwFlags
)
==
dwExpectReturn
,
"UrlCanonicalizeA didn't return 0x%08lx
\n
"
,
dwExpectReturn
);
ok
(
strcmp
(
szReturnUrl
,
szExpectUrl
)
==
0
,
"
Expected %s, but got %s
\n
"
,
szExpectUrl
,
szReturnUrl
);
ok
(
strcmp
(
szReturnUrl
,
szExpectUrl
)
==
0
,
"
UrlCanonicalizeA dwFlags 0x%08lx Expected %s, but got %s
\n
"
,
dwFlags
,
szExpectUrl
,
szReturnUrl
);
dwSize
=
INTERNET_MAX_URL_LENGTH
;
ok
(
UrlCanonicalizeW
(
wszUrl
,
NULL
,
&
dwSize
,
dwFlags
)
!=
dwExpectReturn
,
"Unexpected return for NULL buffer
\n
"
);
ok
(
UrlCanonicalizeW
(
wszUrl
,
wszReturnUrl
,
&
dwSize
,
dwFlags
)
==
dwExpectReturn
,
"UrlCanonicalizeW didn't return 0x%08lx
\n
"
,
dwExpectReturn
);
wszConvertedUrl
=
GetWideString
(
szReturnUrl
);
ok
(
strcmpW
(
wszReturnUrl
,
wszConvertedUrl
)
==
0
,
"Strings didn't match between ascii and unicode UrlCanonicalize!
\n
"
);
...
...
dlls/shlwapi/url.c
View file @
3655187f
...
...
@@ -459,7 +459,7 @@ HRESULT WINAPI UrlCanonicalizeW(LPCWSTR pszUrl, LPWSTR pszCanonicalized,
lpszUrlCpy
[
--
nLen
]
=
0
;
if
(
dwFlags
&
URL_UNESCAPE
)
UrlUnescapeW
(
lpszUrlCpy
,
NULL
,
NULL
,
URL_UNESCAPE_INPLACE
);
UrlUnescapeW
(
lpszUrlCpy
,
NULL
,
&
nLen
,
URL_UNESCAPE_INPLACE
);
if
((
EscapeFlags
=
dwFlags
&
(
URL_ESCAPE_UNSAFE
|
URL_ESCAPE_SPACES_ONLY
|
...
...
@@ -1160,7 +1160,7 @@ HRESULT WINAPI UrlUnescapeW(
TRACE
(
"(%s, %p, %p, 0x%08lx)
\n
"
,
debugstr_w
(
pszUrl
),
pszUnescaped
,
pcchUnescaped
,
dwFlags
);
if
(
!
pszUrl
||
!
pszUnescaped
||
!
pcchUnescaped
)
if
(
!
pszUrl
||
(
!
pszUnescaped
&&
!
(
dwFlags
&
URL_UNESCAPE_INPLACE
))
||
!
pcchUnescaped
)
return
E_INVALIDARG
;
if
(
dwFlags
&
URL_UNESCAPE_INPLACE
)
...
...
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