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
92c48ef2
Commit
92c48ef2
authored
May 11, 2010
by
Thomas Mullaly
Committed by
Alexandre Julliard
May 12, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon/tests: Fixed IUri tests so they fail gracefully on machines with IE <7.
parent
24592a7a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
33 deletions
+25
-33
uri.c
dlls/urlmon/tests/uri.c
+25
-33
No files found.
dlls/urlmon/tests/uri.c
View file @
92c48ef2
...
...
@@ -36,30 +36,17 @@
#include "winbase.h"
#include "urlmon.h"
/** TODO: Work on this!
typedef struct _uri_component_test_str {
const char* uri;
DWORD create_flags;
HRESULT create_hres;
DWORD property;
DWORD property_flags;
HRESULT property_hres;
const char* expected;
} uri_component_test_str;
static const uri_component_test_str URI_STR_PARSE_ONLY_TESTS[] = {
{"http://www.winehq.org", Uri_CREATE_NO_CANONICALIZE, S_OK, Uri_PROPERTY_SCHEME_NAME, 0, S_OK, "http"},
{"file://c:/test/test.mp3", Uri_CREATE_NO_CANONICALIZE, S_OK, Uri_PROPERTY_SCHEME_NAME, 0, S_OK, "file"}
};
*/
static
HRESULT
(
WINAPI
*
pCreateUri
)(
LPCWSTR
,
DWORD
,
DWORD_PTR
,
IUri
**
);
static
const
WCHAR
http_urlW
[]
=
{
'h'
,
't'
,
't'
,
'p'
,
':'
,
'/'
,
'/'
,
'w'
,
'w'
,
'w'
,
'.'
,
'w'
,
'i'
,
'n'
,
'e'
,
'h'
,
'q'
,
'.'
,
'o'
,
'r'
,
'g'
,
'/'
,
0
};
typedef
struct
_uri_create_flag_test
{
DWORD
flags
;
HRESULT
expected
;
}
uri_create_flag_test
;
static
const
uri_create_flag_test
URI_INVALID_CREATE_FLAGS
[]
=
{
static
const
uri_create_flag_test
invalid_flag_tests
[]
=
{
/* Set of invalid flag combinations to test for. */
{
Uri_CREATE_DECODE_EXTRA_INFO
|
Uri_CREATE_NO_DECODE_EXTRA_INFO
,
E_INVALIDARG
},
{
Uri_CREATE_CANONICALIZE
|
Uri_CREATE_NO_CANONICALIZE
,
E_INVALIDARG
},
...
...
@@ -68,32 +55,37 @@ static const uri_create_flag_test URI_INVALID_CREATE_FLAGS[] = {
{
Uri_CREATE_IE_SETTINGS
|
Uri_CREATE_NO_IE_SETTINGS
,
E_INVALIDARG
}
};
static
void
test_create_flags
(
LPCWSTR
uriW
,
uri_create_flag_test
test
)
{
HRESULT
hr
;
IUri
*
uri
=
NULL
;
hr
=
CreateUri
(
uriW
,
test
.
flags
,
0
,
&
uri
);
ok
(
hr
==
test
.
expected
,
"Error: CreateUri returned 0x%08x, expected 0x%08x"
,
hr
,
test
.
expected
);
if
(
uri
)
{
IUri_Release
(
uri
);
}
}
/*
* Simple tests to make sure the CreateUri function handles invalid flag combinations
* correctly.
*/
static
void
test_CreateUri_InvalidFlags
(
void
)
{
static
const
WCHAR
INVALID_URL
[]
=
{
'I'
,
'N'
,
'V'
,
'A'
,
'L'
,
'I'
,
'D'
,
0
};
DWORD
i
;
for
(
i
=
0
;
i
<
sizeof
(
URI_INVALID_CREATE_FLAGS
)
/
sizeof
(
URI_INVALID_CREATE_FLAGS
[
0
]);
++
i
)
{
test_create_flags
(
INVALID_URL
,
URI_INVALID_CREATE_FLAGS
[
i
]);
for
(
i
=
0
;
i
<
sizeof
(
invalid_flag_tests
)
/
sizeof
(
invalid_flag_tests
[
0
]);
++
i
)
{
HRESULT
hr
;
IUri
*
uri
=
(
void
*
)
0xdeadbeef
;
hr
=
pCreateUri
(
http_urlW
,
invalid_flag_tests
[
i
].
flags
,
0
,
&
uri
);
todo_wine
{
ok
(
hr
==
invalid_flag_tests
[
i
].
expected
,
"Error: CreateUri returned 0x%08x, expected 0x%08x, flags=0x%08x
\n
"
,
hr
,
invalid_flag_tests
[
i
].
expected
,
invalid_flag_tests
[
i
].
flags
);
}
todo_wine
{
ok
(
uri
==
NULL
,
"Error: expected the IUri to be NULL, but it was %p instead
\n
"
,
uri
);
}
}
}
START_TEST
(
uri
)
{
todo_wine
{
trace
(
"test CreateUri invalid flags...
\n
"
);
test_CreateUri_InvalidFlags
();
HMODULE
hurlmon
;
hurlmon
=
GetModuleHandle
(
"urlmon.dll"
);
pCreateUri
=
(
void
*
)
GetProcAddress
(
hurlmon
,
"CreateUri"
);
if
(
!
pCreateUri
)
{
win_skip
(
"CreateUri is not present, skipping tests.
\n
"
);
return
;
}
trace
(
"test CreateUri invalid flags...
\n
"
);
test_CreateUri_InvalidFlags
();
}
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