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
6d328c9d
Commit
6d328c9d
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 half of the IUri_Get* string functions.
parent
8cf14ed7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
240 additions
and
1 deletion
+240
-1
uri.c
dlls/urlmon/tests/uri.c
+212
-1
uri.c
dlls/urlmon/uri.c
+28
-0
No files found.
dlls/urlmon/tests/uri.c
View file @
6d328c9d
...
@@ -460,6 +460,214 @@ static void test_IUri_GetPropertyDWORD(void) {
...
@@ -460,6 +460,214 @@ static void test_IUri_GetPropertyDWORD(void) {
}
}
}
}
/* Tests all the 'Get*' property functions which deal with strings. */
static
void
test_IUri_GetStrProperties
(
void
)
{
IUri
*
uri
=
NULL
;
HRESULT
hr
;
DWORD
i
;
/* Make sure all the 'Get*' string 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_GetAbsoluteUri
(
uri
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Error: GetAbsoluteUri returned 0x%08x, expected 0x%08x.
\n
"
,
hr
,
E_POINTER
);
hr
=
IUri_GetAuthority
(
uri
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Error: GetAuthority returned 0x%08x, expected 0x%08x.
\n
"
,
hr
,
E_POINTER
);
hr
=
IUri_GetDisplayUri
(
uri
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Error: GetDisplayUri returned 0x%08x, expected 0x%08x.
\n
"
,
hr
,
E_POINTER
);
hr
=
IUri_GetDomain
(
uri
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Error: GetDomain returned 0x%08x, expected 0x%08x.
\n
"
,
hr
,
E_POINTER
);
hr
=
IUri_GetExtension
(
uri
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Error: GetExtension returned 0x%08x, expected 0x%08x.
\n
"
,
hr
,
E_POINTER
);
hr
=
IUri_GetFragment
(
uri
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Error: GetFragment returned 0x%08x, expected 0x%08x.
\n
"
,
hr
,
E_POINTER
);
hr
=
IUri_GetPassword
(
uri
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Error: GetPassword returned 0x%08x, expected 0x%08x.
\n
"
,
hr
,
E_POINTER
);
}
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_str_property
prop
;
BSTR
received
=
NULL
;
/* GetAbsoluteUri() tests. */
prop
=
test
.
str_props
[
Uri_PROPERTY_ABSOLUTE_URI
];
hr
=
IUri_GetAbsoluteUri
(
uri
,
&
received
);
if
(
prop
.
todo
)
{
todo_wine
{
ok
(
hr
==
prop
.
expected
,
"Error: GetAbsoluteUri returned 0x%08x, expected 0x%08x on uri_tests[%d].
\n
"
,
hr
,
prop
.
expected
,
i
);
}
todo_wine
{
ok
(
!
strcmp_aw
(
prop
.
value
,
received
),
"Error: Expected %s but got %s on uri_tests[%d].
\n
"
,
prop
.
value
,
wine_dbgstr_w
(
received
),
i
);
}
}
else
{
ok
(
hr
==
prop
.
expected
,
"Error: GetAbsoluteUri returned 0x%08x, expected 0x%08x on uri_tests[%d].
\n
"
,
hr
,
prop
.
expected
,
i
);
ok
(
!
strcmp_aw
(
prop
.
value
,
received
),
"Error: Expected %s but got %s on uri_tests[%d].
\n
"
,
prop
.
value
,
wine_dbgstr_w
(
received
),
i
);
}
SysFreeString
(
received
);
received
=
NULL
;
/* GetAuthority() tests. */
prop
=
test
.
str_props
[
Uri_PROPERTY_AUTHORITY
];
hr
=
IUri_GetAuthority
(
uri
,
&
received
);
if
(
prop
.
todo
)
{
todo_wine
{
ok
(
hr
==
prop
.
expected
,
"Error: GetAuthority returned 0x%08x, expected 0x%08x on uri_tests[%d].
\n
"
,
hr
,
prop
.
expected
,
i
);
}
todo_wine
{
ok
(
!
strcmp_aw
(
prop
.
value
,
received
),
"Error: Expected %s but got %s on uri_tests[%d].
\n
"
,
prop
.
value
,
wine_dbgstr_w
(
received
),
i
);
}
}
else
{
ok
(
hr
==
prop
.
expected
,
"Error: GetAuthority returned 0x%08x, expected 0x%08x on uri_tests[%d].
\n
"
,
hr
,
prop
.
expected
,
i
);
ok
(
!
strcmp_aw
(
prop
.
value
,
received
),
"Error: Expected %s but got %s on uri_tests[%d].
\n
"
,
prop
.
value
,
wine_dbgstr_w
(
received
),
i
);
}
SysFreeString
(
received
);
received
=
NULL
;
/* GetDisplayUri() tests. */
prop
=
test
.
str_props
[
Uri_PROPERTY_DISPLAY_URI
];
hr
=
IUri_GetDisplayUri
(
uri
,
&
received
);
if
(
prop
.
todo
)
{
todo_wine
{
ok
(
hr
==
prop
.
expected
,
"Error: GetDisplayUri returned 0x%08x, expected 0x%08x on uri_tests[%d].
\n
"
,
hr
,
prop
.
expected
,
i
);
}
todo_wine
{
ok
(
!
strcmp_aw
(
prop
.
value
,
received
),
"Error: Expected %s but got %s on uri_test[%d].
\n
"
,
prop
.
value
,
wine_dbgstr_w
(
received
),
i
);
}
}
else
{
ok
(
hr
==
prop
.
expected
,
"Error: GetDisplayUri returned 0x%08x, expected 0x%08x on uri_tests[%d].
\n
"
,
hr
,
prop
.
expected
,
i
);
ok
(
!
strcmp_aw
(
prop
.
value
,
received
),
"Error: Expected %s but got %s on uri_tests[%d].
\n
"
,
prop
.
value
,
wine_dbgstr_w
(
received
),
i
);
}
SysFreeString
(
received
);
received
=
NULL
;
/* GetDomain() tests. */
prop
=
test
.
str_props
[
Uri_PROPERTY_DOMAIN
];
hr
=
IUri_GetDomain
(
uri
,
&
received
);
if
(
prop
.
todo
)
{
todo_wine
{
ok
(
hr
==
prop
.
expected
,
"Error: GetDomain returned 0x%08x, expected 0x%08x on uri_tests[%d].
\n
"
,
hr
,
prop
.
expected
,
i
);
}
todo_wine
{
ok
(
!
strcmp_aw
(
prop
.
value
,
received
),
"Error: Expected %s but got %s on uri_tests[%d].
\n
"
,
prop
.
value
,
wine_dbgstr_w
(
received
),
i
);
}
}
else
{
ok
(
hr
==
prop
.
expected
,
"Error: GetDomain returned 0x%08x, expected 0x%08x on uri_tests[%d].
\n
"
,
hr
,
prop
.
expected
,
i
);
ok
(
!
strcmp_aw
(
prop
.
value
,
received
),
"Error: Expected %s but got %s on uri_tests[%d].
\n
"
,
prop
.
value
,
wine_dbgstr_w
(
received
),
i
);
}
SysFreeString
(
received
);
received
=
NULL
;
/* GetExtension() tests. */
prop
=
test
.
str_props
[
Uri_PROPERTY_EXTENSION
];
hr
=
IUri_GetExtension
(
uri
,
&
received
);
if
(
prop
.
todo
)
{
todo_wine
{
ok
(
hr
==
prop
.
expected
,
"Error: GetExtension returned 0x%08x, expected 0x%08x on uri_tests[%d].
\n
"
,
hr
,
prop
.
expected
,
i
);
}
todo_wine
{
ok
(
!
strcmp_aw
(
prop
.
value
,
received
),
"Error: Expected %s but got %s on uri_tests[%d].
\n
"
,
prop
.
value
,
wine_dbgstr_w
(
received
),
i
);
}
}
else
{
ok
(
hr
==
prop
.
expected
,
"Error: GetExtension returned 0x%08x, expected 0x%08x on uri_tests[%d].
\n
"
,
hr
,
prop
.
expected
,
i
);
ok
(
!
strcmp_aw
(
prop
.
value
,
received
),
"Error: Expected %s but got %s on uri_tests[%d].
\n
"
,
prop
.
value
,
wine_dbgstr_w
(
received
),
i
);
}
SysFreeString
(
received
);
received
=
NULL
;
/* GetFragment() tests. */
prop
=
test
.
str_props
[
Uri_PROPERTY_FRAGMENT
];
hr
=
IUri_GetFragment
(
uri
,
&
received
);
if
(
prop
.
todo
)
{
todo_wine
{
ok
(
hr
==
prop
.
expected
,
"Error: GetFragment returned 0x%08x, expected 0x%08x on uri_tests[%d].
\n
"
,
hr
,
prop
.
expected
,
i
);
}
todo_wine
{
ok
(
!
strcmp_aw
(
prop
.
value
,
received
),
"Error: Expected %s but got %s on uri_tests[%d].
\n
"
,
prop
.
value
,
wine_dbgstr_w
(
received
),
i
);
}
}
else
{
ok
(
hr
==
prop
.
expected
,
"Error: GetFragment returned 0x%08x, expected 0x%08x on uri_tests[%d].
\n
"
,
hr
,
prop
.
expected
,
i
);
ok
(
!
strcmp_aw
(
prop
.
value
,
received
),
"Error: Expected %s but got %s on uri_tests[%d].
\n
"
,
prop
.
value
,
wine_dbgstr_w
(
received
),
i
);
}
SysFreeString
(
received
);
received
=
NULL
;
/* GetPassword() tests. */
prop
=
test
.
str_props
[
Uri_PROPERTY_PASSWORD
];
hr
=
IUri_GetPassword
(
uri
,
&
received
);
if
(
prop
.
todo
)
{
todo_wine
{
ok
(
hr
==
prop
.
expected
,
"Error: GetPassword returned 0x%08x, expected 0x%08x on uri_tests[%d].
\n
"
,
hr
,
prop
.
expected
,
i
);
}
todo_wine
{
ok
(
!
strcmp_aw
(
prop
.
value
,
received
),
"Error: Expected %s but got %s on uri_tests[%d].
\n
"
,
prop
.
value
,
wine_dbgstr_w
(
received
),
i
);
}
}
else
{
ok
(
hr
==
prop
.
expected
,
"Error: GetPassword returned 0x%08x, expected 0x%08x on uri_tests[%d].
\n
"
,
hr
,
prop
.
expected
,
i
);
ok
(
!
strcmp_aw
(
prop
.
value
,
received
),
"Error: Expected %s but got %s on uri_tests[%d].
\n
"
,
prop
.
value
,
wine_dbgstr_w
(
received
),
i
);
}
SysFreeString
(
received
);
received
=
NULL
;
}
if
(
uri
)
IUri_Release
(
uri
);
heap_free
(
uriW
);
}
}
START_TEST
(
uri
)
{
START_TEST
(
uri
)
{
HMODULE
hurlmon
;
HMODULE
hurlmon
;
...
@@ -480,6 +688,9 @@ START_TEST(uri) {
...
@@ -480,6 +688,9 @@ START_TEST(uri) {
trace
(
"test IUri_GetPropertyBSTR...
\n
"
);
trace
(
"test IUri_GetPropertyBSTR...
\n
"
);
test_IUri_GetPropertyBSTR
();
test_IUri_GetPropertyBSTR
();
trace
(
"test IUri_GetProp
re
tyDWORD...
\n
"
);
trace
(
"test IUri_GetProp
er
tyDWORD...
\n
"
);
test_IUri_GetPropertyDWORD
();
test_IUri_GetPropertyDWORD
();
trace
(
"test IUri_GetStrProperties...
\n
"
);
test_IUri_GetStrProperties
();
}
}
dlls/urlmon/uri.c
View file @
6d328c9d
...
@@ -126,6 +126,10 @@ static HRESULT WINAPI Uri_GetAbsoluteUri(IUri *iface, BSTR *pstrAbsoluteUri)
...
@@ -126,6 +126,10 @@ static HRESULT WINAPI Uri_GetAbsoluteUri(IUri *iface, BSTR *pstrAbsoluteUri)
{
{
Uri
*
This
=
URI_THIS
(
iface
);
Uri
*
This
=
URI_THIS
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
pstrAbsoluteUri
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
pstrAbsoluteUri
);
if
(
!
pstrAbsoluteUri
)
return
E_POINTER
;
return
E_NOTIMPL
;
return
E_NOTIMPL
;
}
}
...
@@ -133,6 +137,10 @@ static HRESULT WINAPI Uri_GetAuthority(IUri *iface, BSTR *pstrAuthority)
...
@@ -133,6 +137,10 @@ static HRESULT WINAPI Uri_GetAuthority(IUri *iface, BSTR *pstrAuthority)
{
{
Uri
*
This
=
URI_THIS
(
iface
);
Uri
*
This
=
URI_THIS
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
pstrAuthority
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
pstrAuthority
);
if
(
!
pstrAuthority
)
return
E_POINTER
;
return
E_NOTIMPL
;
return
E_NOTIMPL
;
}
}
...
@@ -140,6 +148,10 @@ static HRESULT WINAPI Uri_GetDisplayUri(IUri *iface, BSTR *pstrDisplayUri)
...
@@ -140,6 +148,10 @@ static HRESULT WINAPI Uri_GetDisplayUri(IUri *iface, BSTR *pstrDisplayUri)
{
{
Uri
*
This
=
URI_THIS
(
iface
);
Uri
*
This
=
URI_THIS
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
pstrDisplayUri
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
pstrDisplayUri
);
if
(
!
pstrDisplayUri
)
return
E_POINTER
;
return
E_NOTIMPL
;
return
E_NOTIMPL
;
}
}
...
@@ -147,6 +159,10 @@ static HRESULT WINAPI Uri_GetDomain(IUri *iface, BSTR *pstrDomain)
...
@@ -147,6 +159,10 @@ static HRESULT WINAPI Uri_GetDomain(IUri *iface, BSTR *pstrDomain)
{
{
Uri
*
This
=
URI_THIS
(
iface
);
Uri
*
This
=
URI_THIS
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
pstrDomain
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
pstrDomain
);
if
(
!
pstrDomain
)
return
E_POINTER
;
return
E_NOTIMPL
;
return
E_NOTIMPL
;
}
}
...
@@ -154,6 +170,10 @@ static HRESULT WINAPI Uri_GetExtension(IUri *iface, BSTR *pstrExtension)
...
@@ -154,6 +170,10 @@ static HRESULT WINAPI Uri_GetExtension(IUri *iface, BSTR *pstrExtension)
{
{
Uri
*
This
=
URI_THIS
(
iface
);
Uri
*
This
=
URI_THIS
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
pstrExtension
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
pstrExtension
);
if
(
!
pstrExtension
)
return
E_POINTER
;
return
E_NOTIMPL
;
return
E_NOTIMPL
;
}
}
...
@@ -161,6 +181,10 @@ static HRESULT WINAPI Uri_GetFragment(IUri *iface, BSTR *pstrFragment)
...
@@ -161,6 +181,10 @@ static HRESULT WINAPI Uri_GetFragment(IUri *iface, BSTR *pstrFragment)
{
{
Uri
*
This
=
URI_THIS
(
iface
);
Uri
*
This
=
URI_THIS
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
pstrFragment
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
pstrFragment
);
if
(
!
pstrFragment
)
return
E_POINTER
;
return
E_NOTIMPL
;
return
E_NOTIMPL
;
}
}
...
@@ -175,6 +199,10 @@ static HRESULT WINAPI Uri_GetPassword(IUri *iface, BSTR *pstrPassword)
...
@@ -175,6 +199,10 @@ static HRESULT WINAPI Uri_GetPassword(IUri *iface, BSTR *pstrPassword)
{
{
Uri
*
This
=
URI_THIS
(
iface
);
Uri
*
This
=
URI_THIS
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
pstrPassword
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
pstrPassword
);
if
(
!
pstrPassword
)
return
E_POINTER
;
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