Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
67d642b5
Commit
67d642b5
authored
May 27, 2010
by
Thomas Mullaly
Committed by
Alexandre Julliard
May 28, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon/tests: Added tests for the IUri_Get* dword property functions.
parent
4fed489f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
151 additions
and
1 deletion
+151
-1
uri.c
dlls/urlmon/tests/uri.c
+130
-0
uri.c
dlls/urlmon/uri.c
+21
-1
No files found.
dlls/urlmon/tests/uri.c
View file @
67d642b5
...
@@ -835,6 +835,133 @@ static void test_IUri_GetStrProperties(void) {
...
@@ -835,6 +835,133 @@ static void test_IUri_GetStrProperties(void) {
}
}
}
}
static
void
test_IUri_GetDwordProperties
(
void
)
{
IUri
*
uri
=
NULL
;
HRESULT
hr
;
DWORD
i
;
/* Make sure all the 'Get*' dword property functions handle invalid args correctly. */
hr
=
pCreateUri
(
http_urlW
,
0
,
0
,
&
uri
);
ok
(
hr
==
S_OK
,
"Error: CreateUri returned 0x%08x, expected 0x%08x.
\n
"
,
hr
,
S_OK
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IUri_GetHostType
(
uri
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"Error: GetHostType returned 0x%08x, expected 0x%08x.
\n
"
,
hr
,
E_INVALIDARG
);
hr
=
IUri_GetPort
(
uri
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"Error: GetPort returned 0x%08x, expected 0x%08x.
\n
"
,
hr
,
E_INVALIDARG
);
hr
=
IUri_GetScheme
(
uri
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"Error: GetScheme returned 0x%08x, expected 0x%08x.
\n
"
,
hr
,
E_INVALIDARG
);
hr
=
IUri_GetZone
(
uri
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"Error: GetZone returned 0x%08x, expected 0x%08x.
\n
"
,
hr
,
E_INVALIDARG
);
}
if
(
uri
)
IUri_Release
(
uri
);
for
(
i
=
0
;
i
<
sizeof
(
uri_tests
)
/
sizeof
(
uri_tests
[
0
]);
++
i
)
{
uri_properties
test
=
uri_tests
[
i
];
LPWSTR
uriW
;
uri
=
NULL
;
uriW
=
a2w
(
test
.
uri
);
hr
=
pCreateUri
(
uriW
,
test
.
create_flags
,
0
,
&
uri
);
if
(
test
.
create_todo
)
{
todo_wine
{
ok
(
hr
==
test
.
create_expected
,
"Error: CreateUri returned 0x%08x, expected 0x%08x on uri_tests[%d].
\n
"
,
hr
,
test
.
create_expected
,
i
);
}
}
else
{
ok
(
hr
==
test
.
create_expected
,
"Error: CreateUri returned 0x%08x, expected 0x%08x on uri_tests[%d].
\n
"
,
hr
,
test
.
create_expected
,
i
);
}
if
(
SUCCEEDED
(
hr
))
{
uri_dword_property
prop
;
DWORD
received
;
/* Assign an insane value so tests don't accidentally pass when
* they shouldn't!
*/
received
=
-
9999999
;
/* GetHostType() tests. */
prop
=
test
.
dword_props
[
Uri_PROPERTY_HOST_TYPE
-
Uri_PROPERTY_DWORD_START
];
hr
=
IUri_GetHostType
(
uri
,
&
received
);
if
(
prop
.
todo
)
{
todo_wine
{
ok
(
hr
==
prop
.
expected
,
"Error: GetHostType returned 0x%08x, expected 0x%08x on uri_tests[%d].
\n
"
,
hr
,
prop
.
expected
,
i
);
}
todo_wine
{
ok
(
received
==
prop
.
value
,
"Error: Expected %d but got %d on uri_tests[%d].
\n
"
,
prop
.
value
,
received
,
i
);
}
}
else
{
ok
(
hr
==
prop
.
expected
,
"Error: GetHostType returned 0x%08x, expected 0x%08x on uri_tests[%d].
\n
"
,
hr
,
prop
.
expected
,
i
);
ok
(
received
==
prop
.
value
,
"Error: Expected %d but got %d on uri_tests[%d].
\n
"
,
prop
.
value
,
received
,
i
);
}
received
=
-
9999999
;
/* GetPort() tests. */
prop
=
test
.
dword_props
[
Uri_PROPERTY_PORT
-
Uri_PROPERTY_DWORD_START
];
hr
=
IUri_GetPort
(
uri
,
&
received
);
if
(
prop
.
todo
)
{
todo_wine
{
ok
(
hr
==
prop
.
expected
,
"Error: GetPort returned 0x%08x, expected 0x%08x on uri_tests[%d].
\n
"
,
hr
,
prop
.
expected
,
i
);
}
todo_wine
{
ok
(
received
==
prop
.
value
,
"Error: Expected %d but got %d on uri_tests[%d].
\n
"
,
prop
.
value
,
received
,
i
);
}
}
else
{
ok
(
hr
==
prop
.
expected
,
"Error: GetPort returned 0x%08x, expected 0x%08x on uri_tests[%d].
\n
"
,
hr
,
prop
.
expected
,
i
);
ok
(
received
==
prop
.
value
,
"Error: Expected %d but got %d on uri_tests[%d].
\n
"
,
prop
.
value
,
received
,
i
);
}
received
=
-
9999999
;
/* GetScheme() tests. */
prop
=
test
.
dword_props
[
Uri_PROPERTY_SCHEME
-
Uri_PROPERTY_DWORD_START
];
hr
=
IUri_GetScheme
(
uri
,
&
received
);
if
(
prop
.
todo
)
{
todo_wine
{
ok
(
hr
==
prop
.
expected
,
"Error: GetScheme returned 0x%08x, expected 0x%08x on uri_tests[%d].
\n
"
,
hr
,
prop
.
expected
,
i
);
}
todo_wine
{
ok
(
received
==
prop
.
value
,
"Error: Expected %d but got %d on uri_tests[%d].
\n
"
,
prop
.
value
,
received
,
i
);
}
}
else
{
ok
(
hr
==
prop
.
expected
,
"Error: GetScheme returned 0x%08x, expected 0x%08x on uri_tests[%d].
\n
"
,
hr
,
prop
.
expected
,
i
);
ok
(
received
==
prop
.
value
,
"Error: Expected %d but got %d on uri_tests[%d].
\n
"
,
prop
.
value
,
received
,
i
);
}
received
=
-
9999999
;
/* GetZone() tests. */
prop
=
test
.
dword_props
[
Uri_PROPERTY_ZONE
-
Uri_PROPERTY_DWORD_START
];
hr
=
IUri_GetZone
(
uri
,
&
received
);
if
(
prop
.
todo
)
{
todo_wine
{
ok
(
hr
==
prop
.
expected
,
"Error: GetZone returned 0x%08x, expected 0x%08x on uri_tests[%d].
\n
"
,
hr
,
prop
.
expected
,
i
);
}
todo_wine
{
ok
(
received
==
prop
.
value
,
"Error: Expected %d but got %d on uri_tests[%d].
\n
"
,
prop
.
value
,
received
,
i
);
}
}
else
{
ok
(
hr
==
prop
.
expected
,
"Error: GetZone returned 0x%08x, expected 0x%08x on uri_tests[%d].
\n
"
,
hr
,
prop
.
expected
,
i
);
ok
(
received
==
prop
.
value
,
"Error: Expected %d but got %d on uri_tests[%d].
\n
"
,
prop
.
value
,
received
,
i
);
}
}
if
(
uri
)
IUri_Release
(
uri
);
heap_free
(
uriW
);
}
}
START_TEST
(
uri
)
{
START_TEST
(
uri
)
{
HMODULE
hurlmon
;
HMODULE
hurlmon
;
...
@@ -860,4 +987,7 @@ START_TEST(uri) {
...
@@ -860,4 +987,7 @@ START_TEST(uri) {
trace
(
"test IUri_GetStrProperties...
\n
"
);
trace
(
"test IUri_GetStrProperties...
\n
"
);
test_IUri_GetStrProperties
();
test_IUri_GetStrProperties
();
trace
(
"test IUri_GetDwordProperties...
\n
"
);
test_IUri_GetDwordProperties
();
}
}
dlls/urlmon/uri.c
View file @
67d642b5
...
@@ -104,7 +104,7 @@ static HRESULT WINAPI Uri_GetPropertyDWORD(IUri *iface, Uri_PROPERTY uriProp, DW
...
@@ -104,7 +104,7 @@ static HRESULT WINAPI Uri_GetPropertyDWORD(IUri *iface, Uri_PROPERTY uriProp, DW
/* Microsoft's implementation for the ZONE property of a URI seems to be lacking...
/* Microsoft's implementation for the ZONE property of a URI seems to be lacking...
* From what I can tell, instead of checking which URLZONE the URI belongs to it
* From what I can tell, instead of checking which URLZONE the URI belongs to it
* simply assigns URLZONE_INVALID and returns E_NOTIMPL. This also applies the GetZone
* simply assigns URLZONE_INVALID and returns E_NOTIMPL. This also applies t
o t
he GetZone
* function.
* function.
*/
*/
if
(
uriProp
==
Uri_PROPERTY_ZONE
)
{
if
(
uriProp
==
Uri_PROPERTY_ZONE
)
{
...
@@ -287,6 +287,10 @@ static HRESULT WINAPI Uri_GetHostType(IUri *iface, DWORD *pdwHostType)
...
@@ -287,6 +287,10 @@ static HRESULT WINAPI Uri_GetHostType(IUri *iface, DWORD *pdwHostType)
{
{
Uri
*
This
=
URI_THIS
(
iface
);
Uri
*
This
=
URI_THIS
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
pdwHostType
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
pdwHostType
);
if
(
!
pdwHostType
)
return
E_INVALIDARG
;
return
E_NOTIMPL
;
return
E_NOTIMPL
;
}
}
...
@@ -294,6 +298,10 @@ static HRESULT WINAPI Uri_GetPort(IUri *iface, DWORD *pdwPort)
...
@@ -294,6 +298,10 @@ static HRESULT WINAPI Uri_GetPort(IUri *iface, DWORD *pdwPort)
{
{
Uri
*
This
=
URI_THIS
(
iface
);
Uri
*
This
=
URI_THIS
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
pdwPort
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
pdwPort
);
if
(
!
pdwPort
)
return
E_INVALIDARG
;
return
E_NOTIMPL
;
return
E_NOTIMPL
;
}
}
...
@@ -301,6 +309,10 @@ static HRESULT WINAPI Uri_GetScheme(IUri *iface, DWORD *pdwScheme)
...
@@ -301,6 +309,10 @@ static HRESULT WINAPI Uri_GetScheme(IUri *iface, DWORD *pdwScheme)
{
{
Uri
*
This
=
URI_THIS
(
iface
);
Uri
*
This
=
URI_THIS
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
pdwScheme
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
pdwScheme
);
if
(
!
pdwScheme
)
return
E_INVALIDARG
;
return
E_NOTIMPL
;
return
E_NOTIMPL
;
}
}
...
@@ -308,6 +320,14 @@ static HRESULT WINAPI Uri_GetZone(IUri *iface, DWORD *pdwZone)
...
@@ -308,6 +320,14 @@ static HRESULT WINAPI Uri_GetZone(IUri *iface, DWORD *pdwZone)
{
{
Uri
*
This
=
URI_THIS
(
iface
);
Uri
*
This
=
URI_THIS
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
pdwZone
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
pdwZone
);
if
(
!
pdwZone
)
return
E_INVALIDARG
;
/* Microsoft doesn't seem to have this implemented yet... See
* the comment in Uri_GetPropertyDWORD for more about this.
*/
*
pdwZone
=
URLZONE_INVALID
;
return
E_NOTIMPL
;
return
E_NOTIMPL
;
}
}
...
...
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