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
2776e2b9
Commit
2776e2b9
authored
Aug 18, 2010
by
Thomas Mullaly
Committed by
Alexandre Julliard
Aug 19, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon/tests: Added tests for IUriBuilder_CreateUriSimple.
parent
4eff8ce5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
80 additions
and
0 deletions
+80
-0
uri.c
dlls/urlmon/tests/uri.c
+64
-0
uri.c
dlls/urlmon/uri.c
+16
-0
No files found.
dlls/urlmon/tests/uri.c
View file @
2776e2b9
...
@@ -5135,6 +5135,38 @@ static void test_IUriBuilder_CreateUri(IUriBuilder *builder, const uri_builder_t
...
@@ -5135,6 +5135,38 @@ static void test_IUriBuilder_CreateUri(IUriBuilder *builder, const uri_builder_t
if
(
uri
)
IUri_Release
(
uri
);
if
(
uri
)
IUri_Release
(
uri
);
}
}
static
void
test_IUriBuilder_CreateUriSimple
(
IUriBuilder
*
builder
,
const
uri_builder_test
*
test
,
DWORD
test_index
)
{
HRESULT
hr
;
IUri
*
uri
=
NULL
;
hr
=
IUriBuilder_CreateUriSimple
(
builder
,
test
->
uri_simple_encode_flags
,
0
,
&
uri
);
if
(
test
->
uri_todo
)
{
todo_wine
{
ok
(
hr
==
test
->
uri_simple_hres
,
"Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].
\n
"
,
hr
,
test
->
uri_simple_hres
,
test_index
);
}
}
else
{
ok
(
hr
==
test
->
uri_simple_hres
,
"Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].
\n
"
,
hr
,
test
->
uri_simple_hres
,
test_index
);
}
if
(
SUCCEEDED
(
hr
))
{
BSTR
received
=
NULL
;
hr
=
IUri_GetAbsoluteUri
(
uri
,
&
received
);
ok
(
hr
==
S_OK
,
"Error: IUri_GetAbsoluteUri returned 0x%08x, expected 0x%08x on uri_builder_tests[%d].
\n
"
,
hr
,
S_OK
,
test_index
);
ok
(
!
strcmp_aw
(
test
->
uri_simple_expected
,
received
),
"Error: Expected the URI to be %s but was %s instead on uri_builder_tests[%d].
\n
"
,
test
->
uri_simple_expected
,
wine_dbgstr_w
(
received
),
test_index
);
SysFreeString
(
received
);
}
if
(
uri
)
IUri_Release
(
uri
);
}
static
void
test_IUriBuilder_CreateInvalidArgs
(
void
)
{
static
void
test_IUriBuilder_CreateInvalidArgs
(
void
)
{
IUriBuilder
*
builder
;
IUriBuilder
*
builder
;
HRESULT
hr
;
HRESULT
hr
;
...
@@ -5157,6 +5189,22 @@ static void test_IUriBuilder_CreateInvalidArgs(void) {
...
@@ -5157,6 +5189,22 @@ static void test_IUriBuilder_CreateInvalidArgs(void) {
ok
(
hr
==
E_NOTIMPL
,
"Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.
\n
"
,
hr
,
E_NOTIMPL
);
ok
(
hr
==
E_NOTIMPL
,
"Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.
\n
"
,
hr
,
E_NOTIMPL
);
ok
(
uri
==
NULL
,
"Error: expected uri to be NULL, but was %p instead.
\n
"
,
uri
);
ok
(
uri
==
NULL
,
"Error: expected uri to be NULL, but was %p instead.
\n
"
,
uri
);
uri
=
(
void
*
)
0xdeadbeef
;
hr
=
IUriBuilder_CreateUriSimple
(
builder
,
0
,
0
,
&
uri
);
ok
(
hr
==
INET_E_INVALID_URL
,
"Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x.
\n
"
,
hr
,
INET_E_INVALID_URL
);
ok
(
!
uri
,
"Error: Expected uri to be NULL, but was %p instead.
\n
"
,
uri
);
hr
=
IUriBuilder_CreateUriSimple
(
builder
,
0
,
0
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x.
\n
"
,
hr
,
E_POINTER
);
uri
=
(
void
*
)
0xdeadbeef
;
hr
=
IUriBuilder_CreateUriSimple
(
builder
,
Uri_HAS_USER_NAME
,
0
,
&
uri
);
ok
(
hr
==
E_NOTIMPL
,
"Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x.
\n
"
,
hr
,
E_NOTIMPL
);
ok
(
!
uri
,
"Error: Expected uri to NULL, but was %p instead.
\n
"
,
uri
);
hr
=
pCreateUri
(
http_urlW
,
0
,
0
,
&
test
);
hr
=
pCreateUri
(
http_urlW
,
0
,
0
,
&
test
);
ok
(
hr
==
S_OK
,
"Error: CreateUri returned 0x%08x, expected 0x%08x.
\n
"
,
hr
,
S_OK
);
ok
(
hr
==
S_OK
,
"Error: CreateUri returned 0x%08x, expected 0x%08x.
\n
"
,
hr
,
S_OK
);
if
(
SUCCEEDED
(
hr
))
{
if
(
SUCCEEDED
(
hr
))
{
...
@@ -5172,6 +5220,15 @@ static void test_IUriBuilder_CreateInvalidArgs(void) {
...
@@ -5172,6 +5220,15 @@ static void test_IUriBuilder_CreateInvalidArgs(void) {
todo_wine
{
ok
(
uri
!=
NULL
,
"Error: The uri was NULL.
\n
"
);
}
todo_wine
{
ok
(
uri
!=
NULL
,
"Error: The uri was NULL.
\n
"
);
}
if
(
uri
)
IUri_Release
(
uri
);
if
(
uri
)
IUri_Release
(
uri
);
uri
=
NULL
;
hr
=
IUriBuilder_CreateUriSimple
(
builder
,
Uri_HAS_USER_NAME
,
0
,
&
uri
);
todo_wine
{
ok
(
hr
==
S_OK
,
"Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x.
\n
"
,
hr
,
S_OK
);
}
todo_wine
{
ok
(
uri
!=
NULL
,
"Error: uri was NULL.
\n
"
);
}
if
(
uri
)
IUri_Release
(
uri
);
hr
=
IUriBuilder_SetFragment
(
builder
,
NULL
);
hr
=
IUriBuilder_SetFragment
(
builder
,
NULL
);
todo_wine
{
ok
(
hr
==
S_OK
,
"Error: IUriBuilder_SetFragment returned 0x%08x, expected 0x%08x.
\n
"
,
hr
,
S_OK
);
}
todo_wine
{
ok
(
hr
==
S_OK
,
"Error: IUriBuilder_SetFragment returned 0x%08x, expected 0x%08x.
\n
"
,
hr
,
S_OK
);
}
...
@@ -5180,6 +5237,12 @@ static void test_IUriBuilder_CreateInvalidArgs(void) {
...
@@ -5180,6 +5237,12 @@ static void test_IUriBuilder_CreateInvalidArgs(void) {
hr
=
IUriBuilder_CreateUri
(
builder
,
0
,
Uri_HAS_USER_NAME
,
0
,
&
uri
);
hr
=
IUriBuilder_CreateUri
(
builder
,
0
,
Uri_HAS_USER_NAME
,
0
,
&
uri
);
ok
(
hr
==
E_NOTIMPL
,
"Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.
\n
"
,
hr
,
S_OK
);
ok
(
hr
==
E_NOTIMPL
,
"Error: IUriBuilder_CreateUri returned 0x%08x, expected 0x%08x.
\n
"
,
hr
,
S_OK
);
ok
(
!
uri
,
"Error: Expected uri to be NULL but was %p instead.
\n
"
,
uri
);
ok
(
!
uri
,
"Error: Expected uri to be NULL but was %p instead.
\n
"
,
uri
);
uri
=
(
void
*
)
0xdeadbeef
;
hr
=
IUriBuilder_CreateUriSimple
(
builder
,
Uri_HAS_USER_NAME
,
0
,
&
uri
);
ok
(
hr
==
E_NOTIMPL
,
"Error: IUriBuilder_CreateUriSimple returned 0x%08x, expected 0x%08x.
\n
"
,
hr
,
S_OK
);
ok
(
!
uri
,
"Error: Expected uri to be NULL, but was %p instead.
\n
"
,
uri
);
}
}
if
(
test
)
IUri_Release
(
test
);
if
(
test
)
IUri_Release
(
test
);
}
}
...
@@ -5240,6 +5303,7 @@ static void test_IUriBuilder(void) {
...
@@ -5240,6 +5303,7 @@ static void test_IUriBuilder(void) {
}
}
test_IUriBuilder_CreateUri
(
builder
,
&
test
,
i
);
test_IUriBuilder_CreateUri
(
builder
,
&
test
,
i
);
test_IUriBuilder_CreateUriSimple
(
builder
,
&
test
,
i
);
}
}
if
(
builder
)
IUriBuilder_Release
(
builder
);
if
(
builder
)
IUriBuilder_Release
(
builder
);
}
}
...
...
dlls/urlmon/uri.c
View file @
2776e2b9
...
@@ -4096,6 +4096,22 @@ static HRESULT WINAPI UriBuilder_CreateUriSimple(IUriBuilder *iface,
...
@@ -4096,6 +4096,22 @@ static HRESULT WINAPI UriBuilder_CreateUriSimple(IUriBuilder *iface,
IUri
**
ppIUri
)
IUri
**
ppIUri
)
{
{
UriBuilder
*
This
=
URIBUILDER_THIS
(
iface
);
UriBuilder
*
This
=
URIBUILDER_THIS
(
iface
);
TRACE
(
"(%p)->(%d %d %p)
\n
"
,
This
,
dwAllowEncodingPropertyMask
,
(
DWORD
)
dwReserved
,
ppIUri
);
if
(
!
ppIUri
)
return
E_POINTER
;
/* Acts the same way as CreateUri. */
if
(
dwAllowEncodingPropertyMask
&&
!
This
->
uri
)
{
*
ppIUri
=
NULL
;
return
E_NOTIMPL
;
}
if
(
!
This
->
uri
)
{
*
ppIUri
=
NULL
;
return
INET_E_INVALID_URL
;
}
FIXME
(
"(%p)->(%d %d %p)
\n
"
,
This
,
dwAllowEncodingPropertyMask
,
(
DWORD
)
dwReserved
,
ppIUri
);
FIXME
(
"(%p)->(%d %d %p)
\n
"
,
This
,
dwAllowEncodingPropertyMask
,
(
DWORD
)
dwReserved
,
ppIUri
);
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