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
4f0a267d
Commit
4f0a267d
authored
May 09, 2010
by
Thomas Mullaly
Committed by
Alexandre Julliard
May 11, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon/tests: Added a new test file for testing the IUri interface.
parent
c92691e1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
100 additions
and
0 deletions
+100
-0
Makefile.in
dlls/urlmon/tests/Makefile.in
+1
-0
uri.c
dlls/urlmon/tests/uri.c
+99
-0
No files found.
dlls/urlmon/tests/Makefile.in
View file @
4f0a267d
...
...
@@ -11,6 +11,7 @@ C_SRCS = \
protocol.c
\
sec_mgr.c
\
stream.c
\
uri.c
\
url.c
@MAKE_TEST_RULES@
dlls/urlmon/tests/uri.c
0 → 100644
View file @
4f0a267d
/*
* UrlMon IUri tests
*
* Copyright 2010 Thomas Mullaly
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
/*
* IUri testing framework goals:
* - Test invalid flags
* - Test parsing for components when no canonicalization occurs
* - Test parsing for components when canonicalization occurs.
* - More tests...
*/
#include <wine/test.h>
#include <stdarg.h>
#include <stddef.h>
#define COBJMACROS
#include "windef.h"
#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"}
};
*/
typedef
struct
_uri_create_flag_test
{
DWORD
flags
;
HRESULT
expected
;
}
uri_create_flag_test
;
static
const
uri_create_flag_test
URI_INVALID_CREATE_FLAGS
[]
=
{
/* 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
},
{
Uri_CREATE_CRACK_UNKNOWN_SCHEMES
|
Uri_CREATE_NO_CRACK_UNKNOWN_SCHEMES
,
E_INVALIDARG
},
{
Uri_CREATE_PRE_PROCESS_HTML_URI
|
Uri_CREATE_NO_PRE_PROCESS_HTML_URI
,
E_INVALIDARG
},
{
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
]);
}
}
START_TEST
(
uri
)
{
todo_wine
{
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