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
b5950a4a
Commit
b5950a4a
authored
Aug 19, 2010
by
Thomas Mullaly
Committed by
Alexandre Julliard
Aug 23, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon/tests: Added tests for IUriBuilder_GetHost.
parent
3775219a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
135 additions
and
0 deletions
+135
-0
uri.c
dlls/urlmon/tests/uri.c
+122
-0
uri.c
dlls/urlmon/uri.c
+13
-0
No files found.
dlls/urlmon/tests/uri.c
View file @
b5950a4a
...
@@ -5336,6 +5336,20 @@ static void test_IUriBuilder_GetInvalidArgs(void) {
...
@@ -5336,6 +5336,20 @@ static void test_IUriBuilder_GetInvalidArgs(void) {
ok
(
hr
==
E_POINTER
,
"Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x.
\n
"
,
ok
(
hr
==
E_POINTER
,
"Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x.
\n
"
,
hr
,
E_POINTER
);
hr
,
E_POINTER
);
ok
(
!
len
,
"Error: Expected len to be 0, but was %d instead.
\n
"
,
len
);
ok
(
!
len
,
"Error: Expected len to be 0, but was %d instead.
\n
"
,
len
);
hr
=
IUriBuilder_GetHost
(
builder
,
NULL
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x.
\n
"
,
hr
,
E_POINTER
);
received
=
(
void
*
)
0xdeadbeef
;
hr
=
IUriBuilder_GetHost
(
builder
,
NULL
,
&
received
);
ok
(
hr
==
E_POINTER
,
"Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x.
\n
"
,
hr
,
E_POINTER
);
ok
(
!
received
,
"Error: Expected received to be NULL, but was %p instead.
\n
"
,
received
);
len
=
-
1
;
hr
=
IUriBuilder_GetHost
(
builder
,
&
len
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x.
\n
"
,
hr
,
E_POINTER
);
ok
(
!
len
,
"Error: Expected len to be 0, but was %d instead.
\n
"
,
len
);
}
}
if
(
builder
)
IUriBuilder_Release
(
builder
);
if
(
builder
)
IUriBuilder_Release
(
builder
);
}
}
...
@@ -5447,6 +5461,113 @@ static void test_IUriBuilder_GetFragment(IUriBuilder *builder, const uri_builder
...
@@ -5447,6 +5461,113 @@ static void test_IUriBuilder_GetFragment(IUriBuilder *builder, const uri_builder
}
}
}
}
static
void
test_IUriBuilder_GetHost
(
IUriBuilder
*
builder
,
const
uri_builder_test
*
test
,
DWORD
test_index
)
{
HRESULT
hr
;
DWORD
i
;
LPCWSTR
received
=
NULL
;
DWORD
len
=
-
1
;
const
uri_builder_property
*
prop
=
NULL
;
/* Check if the property was set earlier. */
for
(
i
=
0
;
i
<
sizeof
(
test
->
properties
)
/
sizeof
(
test
->
properties
[
0
]);
++
i
)
{
if
(
test
->
properties
[
i
].
change
&&
test
->
properties
[
i
].
property
==
Uri_PROPERTY_HOST
)
prop
=
&
(
test
->
properties
[
i
]);
}
if
(
prop
)
{
/* Use expected_value unless it's NULL, then use value. */
LPCSTR
expected
=
prop
->
expected_value
?
prop
->
expected_value
:
prop
->
value
;
hr
=
IUriBuilder_GetHost
(
builder
,
&
len
,
&
received
);
if
(
prop
->
todo
)
{
todo_wine
{
ok
(
hr
==
(
expected
?
S_OK
:
S_FALSE
),
"Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].
\n
"
,
hr
,
(
expected
?
S_OK
:
S_FALSE
),
test_index
);
}
if
(
SUCCEEDED
(
hr
))
{
todo_wine
{
ok
(
!
strcmp_aw
(
expected
,
received
),
"Error: Expected %s but got %s on uri_builder_tests[%d].
\n
"
,
expected
,
wine_dbgstr_w
(
received
),
test_index
);
}
todo_wine
{
ok
(
lstrlen
(
expected
)
==
len
,
"Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].
\n
"
,
lstrlen
(
expected
),
len
,
test_index
);
}
}
}
else
{
ok
(
hr
==
(
expected
?
S_OK
:
S_FALSE
),
"Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].
\n
"
,
hr
,
(
expected
?
S_OK
:
S_FALSE
),
test_index
);
ok
(
!
strcmp_aw
(
expected
,
received
),
"Error: Expected %s but got %s on uri_builder_tests[%d].
\n
"
,
expected
,
wine_dbgstr_w
(
received
),
test_index
);
ok
(
lstrlen
(
expected
)
==
len
,
"Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].
\n
"
,
lstrlen
(
expected
),
len
,
test_index
);
}
}
else
{
/* The property wasn't set earlier, so it should return whatever
* the base IUri contains (if anything).
*/
IUri
*
uri
=
NULL
;
hr
=
IUriBuilder_GetIUri
(
builder
,
&
uri
);
todo_wine
{
ok
(
hr
==
S_OK
,
"Error: IUriBuilder_GetIUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].
\n
"
,
hr
,
S_OK
,
test_index
);
}
if
(
SUCCEEDED
(
hr
))
{
BOOL
has_prop
=
FALSE
;
BSTR
expected
=
NULL
;
hr
=
IUri_GetHost
(
uri
,
&
expected
);
ok
(
SUCCEEDED
(
hr
),
"Error: Expected IUri_GetHost to succeed, but got 0x%08x instead on uri_builder_tests[%d].
\n
"
,
hr
,
test_index
);
has_prop
=
hr
==
S_OK
;
hr
=
IUriBuilder_GetHost
(
builder
,
&
len
,
&
received
);
if
(
has_prop
)
{
todo_wine
{
ok
(
hr
==
S_OK
,
"Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].
\n
"
,
hr
,
S_OK
,
test_index
);
}
if
(
SUCCEEDED
(
hr
))
{
todo_wine
{
ok
(
!
lstrcmpW
(
expected
,
received
),
"Error: Expected %s but got %s instead on uri_builder_tests[%d].
\n
"
,
wine_dbgstr_w
(
expected
),
wine_dbgstr_w
(
received
),
test_index
);
}
todo_wine
{
ok
(
lstrlenW
(
expected
)
==
len
,
"Error: Expected the length to be %d, but was %d instead on uri_builder_tests[%d].
\n
"
,
lstrlenW
(
expected
),
len
,
test_index
);
}
}
}
else
{
todo_wine
{
ok
(
hr
==
S_FALSE
,
"Error: IUriBuilder_GetHost returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].
\n
"
,
hr
,
S_FALSE
,
test_index
);
}
if
(
SUCCEEDED
(
hr
))
{
todo_wine
{
ok
(
!
received
,
"Error: Expected received to be NULL on uri_builder_tests[%d].
\n
"
,
test_index
);
}
todo_wine
{
ok
(
!
len
,
"Error: Expected the length to be 0, but was %d instead on uri_builder_tests[%d].
\n
"
,
len
,
test_index
);
}
}
}
SysFreeString
(
expected
);
}
if
(
uri
)
IUri_Release
(
uri
);
}
}
/* Tests IUriBuilder functions. */
/* Tests IUriBuilder functions. */
static
void
test_IUriBuilder
(
void
)
{
static
void
test_IUriBuilder
(
void
)
{
HRESULT
hr
;
HRESULT
hr
;
...
@@ -5502,6 +5623,7 @@ static void test_IUriBuilder(void) {
...
@@ -5502,6 +5623,7 @@ static void test_IUriBuilder(void) {
/* Test the "Get*" functions. */
/* Test the "Get*" functions. */
test_IUriBuilder_GetFragment
(
builder
,
&
test
,
i
);
test_IUriBuilder_GetFragment
(
builder
,
&
test
,
i
);
test_IUriBuilder_GetHost
(
builder
,
&
test
,
i
);
test_IUriBuilder_CreateUri
(
builder
,
&
test
,
i
);
test_IUriBuilder_CreateUri
(
builder
,
&
test
,
i
);
test_IUriBuilder_CreateUriSimple
(
builder
,
&
test
,
i
);
test_IUriBuilder_CreateUriSimple
(
builder
,
&
test
,
i
);
...
...
dlls/urlmon/uri.c
View file @
b5950a4a
...
@@ -4215,6 +4215,19 @@ static HRESULT WINAPI UriBuilder_GetFragment(IUriBuilder *iface, DWORD *pcchFrag
...
@@ -4215,6 +4215,19 @@ static HRESULT WINAPI UriBuilder_GetFragment(IUriBuilder *iface, DWORD *pcchFrag
static
HRESULT
WINAPI
UriBuilder_GetHost
(
IUriBuilder
*
iface
,
DWORD
*
pcchHost
,
LPCWSTR
*
ppwzHost
)
static
HRESULT
WINAPI
UriBuilder_GetHost
(
IUriBuilder
*
iface
,
DWORD
*
pcchHost
,
LPCWSTR
*
ppwzHost
)
{
{
UriBuilder
*
This
=
URIBUILDER_THIS
(
iface
);
UriBuilder
*
This
=
URIBUILDER_THIS
(
iface
);
TRACE
(
"(%p)->(%p %p)
\n
"
,
This
,
pcchHost
,
ppwzHost
);
if
(
!
pcchHost
)
{
if
(
ppwzHost
)
*
ppwzHost
=
NULL
;
return
E_POINTER
;
}
if
(
!
ppwzHost
)
{
*
pcchHost
=
0
;
return
E_POINTER
;
}
FIXME
(
"(%p)->(%p %p)
\n
"
,
This
,
pcchHost
,
ppwzHost
);
FIXME
(
"(%p)->(%p %p)
\n
"
,
This
,
pcchHost
,
ppwzHost
);
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