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
d36d4aa7
Commit
d36d4aa7
authored
Aug 20, 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_GetPort.
parent
f25b83fa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
109 additions
and
1 deletion
+109
-1
uri.c
dlls/urlmon/tests/uri.c
+96
-1
uri.c
dlls/urlmon/uri.c
+13
-0
No files found.
dlls/urlmon/tests/uri.c
View file @
d36d4aa7
...
...
@@ -5323,7 +5323,8 @@ static void test_IUriBuilder_GetInvalidArgs(void) {
ok
(
hr
==
S_OK
,
"Error: CreateIUriBuilder returned 0x%08x, expected 0x%08x.
\n
"
,
hr
,
S_OK
);
if
(
SUCCEEDED
(
hr
))
{
LPCWSTR
received
=
(
void
*
)
0xdeadbeef
;
DWORD
len
=
-
1
;
DWORD
len
=
-
1
,
port
=
-
1
;
BOOL
set
=
-
1
;
hr
=
IUriBuilder_GetFragment
(
builder
,
NULL
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Error: IUriBuilder_GetFragment returned 0x%08x, expected 0x%08x.
\n
"
,
...
...
@@ -5378,6 +5379,18 @@ static void test_IUriBuilder_GetInvalidArgs(void) {
ok
(
hr
==
E_POINTER
,
"Error: IUriBuilder_GetPath returned 0x%08x, expected 0x%08x.
\n
"
,
hr
,
E_POINTER
);
ok
(
!
len
,
"Error: Expected len to be 0, but was %d instead.
\n
"
,
len
);
hr
=
IUriBuilder_GetPort
(
builder
,
NULL
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x.
\n
"
,
hr
,
E_POINTER
);
hr
=
IUriBuilder_GetPort
(
builder
,
NULL
,
&
port
);
ok
(
hr
==
E_POINTER
,
"Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x.
\n
"
,
hr
,
E_POINTER
);
ok
(
!
port
,
"Error: Expected port to be 0, but was %d instead.
\n
"
,
port
);
hr
=
IUriBuilder_GetPort
(
builder
,
&
set
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x.
\n
"
,
hr
,
E_POINTER
);
ok
(
!
set
,
"Error: Expected set to be FALSE, but was %d instead.
\n
"
,
set
);
}
if
(
builder
)
IUriBuilder_Release
(
builder
);
}
...
...
@@ -5810,6 +5823,87 @@ static void test_IUriBuilder_GetPath(IUriBuilder *builder, const uri_builder_tes
}
}
static
void
test_IUriBuilder_GetPort
(
IUriBuilder
*
builder
,
const
uri_builder_test
*
test
,
DWORD
test_index
)
{
HRESULT
hr
;
BOOL
has_port
=
FALSE
;
DWORD
received
=
-
1
;
if
(
test
->
port_prop
.
change
)
{
DWORD
expected
=
test
->
port_prop
.
value
;
hr
=
IUriBuilder_GetPort
(
builder
,
&
has_port
,
&
received
);
if
(
test
->
port_prop
.
todo
)
{
todo_wine
{
ok
(
hr
==
S_OK
,
"Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].
\n
"
,
hr
,
S_OK
,
test_index
);
}
if
(
SUCCEEDED
(
hr
))
{
todo_wine
{
ok
(
has_port
==
test
->
port_prop
.
set
,
"Error: Expected has_port to be %d but was %d instead on uri_builder_tests[%d].
\n
"
,
test
->
port_prop
.
set
,
has_port
,
test_index
);
}
todo_wine
{
ok
(
received
==
expected
,
"Error: Expected received to be %d, but was %d instead on uri_builder_tests[%d].
\n
"
,
expected
,
received
,
test_index
);
}
}
}
else
{
ok
(
hr
==
S_OK
,
"Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].
\n
"
,
hr
,
S_OK
,
test_index
);
ok
(
has_port
==
test
->
port_prop
.
set
,
"Error: Expected has_port to be %d, but was %d instead on uri_builder_tests[%d].
\n
"
,
test
->
port_prop
.
set
,
has_port
,
test_index
);
ok
(
received
==
test
->
port_prop
.
value
,
"Error: Expected port to be %d, but was %d instead on uri_builder_tests[%d].
\n
"
,
test
->
port_prop
.
value
,
received
,
test_index
);
}
}
else
{
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
))
{
DWORD
expected
;
BOOL
got_port
=
FALSE
;
hr
=
IUri_GetPort
(
uri
,
&
expected
);
ok
(
SUCCEEDED
(
hr
),
"Error: Expected IUri_Port to succeed, but got 0x%08x instead on uri_builder_tests[%d].
\n
"
,
hr
,
test_index
);
got_port
=
hr
==
S_OK
;
hr
=
IUriBuilder_GetPort
(
builder
,
&
has_port
,
&
received
);
todo_wine
{
ok
(
hr
==
S_OK
,
"Error: IUriBuilder_GetPort returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].
\n
"
,
hr
,
S_OK
,
test_index
);
}
if
(
SUCCEEDED
(
hr
))
{
todo_wine
{
ok
(
!
has_port
,
"Error: Expected has_port to be FALSE but was TRUE instead on uri_builder_tests[%d].
\n
"
,
test_index
);
}
todo_wine
{
ok
(
received
==
expected
,
"Error: Expected received to be %d, but was %d instead on uri_builder_tests[%d].
\n
"
,
expected
,
received
,
test_index
);
}
}
}
if
(
uri
)
IUri_Release
(
uri
);
}
}
/* Tests IUriBuilder functions. */
static
void
test_IUriBuilder
(
void
)
{
HRESULT
hr
;
...
...
@@ -5868,6 +5962,7 @@ static void test_IUriBuilder(void) {
test_IUriBuilder_GetHost
(
builder
,
&
test
,
i
);
test_IUriBuilder_GetPassword
(
builder
,
&
test
,
i
);
test_IUriBuilder_GetPath
(
builder
,
&
test
,
i
);
test_IUriBuilder_GetPort
(
builder
,
&
test
,
i
);
test_IUriBuilder_CreateUri
(
builder
,
&
test
,
i
);
test_IUriBuilder_CreateUriSimple
(
builder
,
&
test
,
i
);
...
...
dlls/urlmon/uri.c
View file @
d36d4aa7
...
...
@@ -4275,6 +4275,19 @@ static HRESULT WINAPI UriBuilder_GetPath(IUriBuilder *iface, DWORD *pcchPath, LP
static
HRESULT
WINAPI
UriBuilder_GetPort
(
IUriBuilder
*
iface
,
BOOL
*
pfHasPort
,
DWORD
*
pdwPort
)
{
UriBuilder
*
This
=
URIBUILDER_THIS
(
iface
);
TRACE
(
"(%p)->(%p %p)
\n
"
,
This
,
pfHasPort
,
pdwPort
);
if
(
!
pfHasPort
)
{
if
(
pdwPort
)
*
pdwPort
=
0
;
return
E_POINTER
;
}
if
(
!
pdwPort
)
{
*
pfHasPort
=
FALSE
;
return
E_POINTER
;
}
FIXME
(
"(%p)->(%p %p)
\n
"
,
This
,
pfHasPort
,
pdwPort
);
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