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
f16fa49f
Commit
f16fa49f
authored
May 28, 2010
by
Thomas Mullaly
Committed by
Alexandre Julliard
May 31, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon/tests: Added tests for IUri_GetPropertyLength.
parent
2e5b76db
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
86 additions
and
1 deletion
+86
-1
uri.c
dlls/urlmon/tests/uri.c
+77
-0
uri.c
dlls/urlmon/uri.c
+9
-1
No files found.
dlls/urlmon/tests/uri.c
View file @
f16fa49f
...
...
@@ -1062,6 +1062,80 @@ static void test_IUri_GetDwordProperties(void) {
}
}
static
void
test_IUri_GetPropertyLength
(
void
)
{
IUri
*
uri
=
NULL
;
HRESULT
hr
;
DWORD
i
;
/* Make sure it handles 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
))
{
DWORD
received
=
0xdeadbeef
;
hr
=
IUri_GetPropertyLength
(
uri
,
Uri_PROPERTY_STRING_START
,
NULL
,
0
);
ok
(
hr
==
E_INVALIDARG
,
"Error: GetPropertyLength returned 0x%08x, expected 0x%08x.
\n
"
,
hr
,
E_INVALIDARG
);
hr
=
IUri_GetPropertyLength
(
uri
,
Uri_PROPERTY_DWORD_START
,
&
received
,
0
);
ok
(
hr
==
E_INVALIDARG
,
"Error: GetPropertyLength return 0x%08x, expected 0x%08x.
\n
"
,
hr
,
E_INVALIDARG
);
ok
(
received
==
0xdeadbeef
,
"Error: Expected 0xdeadbeef but got 0x%08x.
\n
"
,
received
);
}
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_test[%d].
\n
"
,
hr
,
test
.
create_expected
,
i
);
}
if
(
SUCCEEDED
(
hr
))
{
DWORD
j
;
for
(
j
=
Uri_PROPERTY_STRING_START
;
j
<=
Uri_PROPERTY_STRING_LAST
;
++
j
)
{
DWORD
expectedLen
,
receivedLen
;
uri_str_property
prop
=
test
.
str_props
[
j
];
expectedLen
=
lstrlen
(
prop
.
value
);
/* This won't be neccessary once GetPropertyLength is implemented. */
receivedLen
=
-
1
;
hr
=
IUri_GetPropertyLength
(
uri
,
j
,
&
receivedLen
,
0
);
if
(
prop
.
todo
)
{
todo_wine
{
ok
(
hr
==
prop
.
expected
,
"Error: GetPropertyLength returned 0x%08x, expected 0x%08x on uri_tests[%d].str_props[%d].
\n
"
,
hr
,
prop
.
expected
,
i
,
j
);
}
todo_wine
{
ok
(
receivedLen
==
expectedLen
,
"Error: Expected a length of %d but got %d on uri_tests[%d].str_props[%d].
\n
"
,
expectedLen
,
receivedLen
,
i
,
j
);
}
}
else
{
ok
(
hr
==
prop
.
expected
,
"Error: GetPropertyLength returned 0x%08x, expected 0x%08x on uri_tests[%d].str_props[%d].
\n
"
,
hr
,
prop
.
expected
,
i
,
j
);
ok
(
receivedLen
==
expectedLen
,
"Error: Expected a length of %d but %d on uri_tests[%d].str_props[%d].
\n
"
,
expectedLen
,
receivedLen
,
i
,
j
);
}
}
}
if
(
uri
)
IUri_Release
(
uri
);
heap_free
(
uriW
);
}
}
START_TEST
(
uri
)
{
HMODULE
hurlmon
;
...
...
@@ -1090,4 +1164,7 @@ START_TEST(uri) {
trace
(
"test IUri_GetDwordProperties...
\n
"
);
test_IUri_GetDwordProperties
();
trace
(
"test IUri_GetPropertyLength...
\n
"
);
test_IUri_GetPropertyLength
();
}
dlls/urlmon/uri.c
View file @
f16fa49f
...
...
@@ -91,6 +91,14 @@ static HRESULT WINAPI Uri_GetPropertyLength(IUri *iface, Uri_PROPERTY uriProp, D
{
Uri
*
This
=
URI_THIS
(
iface
);
FIXME
(
"(%p)->(%d %p %x)
\n
"
,
This
,
uriProp
,
pcchProperty
,
dwFlags
);
if
(
!
pcchProperty
)
return
E_INVALIDARG
;
/* Can only return a length for a property if it's a string. */
if
(
uriProp
>
Uri_PROPERTY_STRING_LAST
)
return
E_INVALIDARG
;
return
E_NOTIMPL
;
}
...
...
@@ -118,7 +126,7 @@ static HRESULT WINAPI Uri_GetPropertyDWORD(IUri *iface, Uri_PROPERTY uriProp, DW
static
HRESULT
WINAPI
Uri_HasProperty
(
IUri
*
iface
,
Uri_PROPERTY
uriProp
,
BOOL
*
pfHasProperty
)
{
Uri
*
This
=
URI_THIS
(
iface
);
FIXME
(
"(%p)->(
)
\n
"
,
This
);
FIXME
(
"(%p)->(
%d %p)
\n
"
,
This
,
uriProp
,
pfHasProperty
);
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