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
18f932cd
Commit
18f932cd
authored
Jan 13, 2012
by
Piotr Caban
Committed by
Alexandre Julliard
Jan 13, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon/tests: Test uninitialized IUri object.
parent
e5925d2a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
101 additions
and
0 deletions
+101
-0
uri.c
dlls/urlmon/tests/uri.c
+101
-0
No files found.
dlls/urlmon/tests/uri.c
View file @
18f932cd
...
@@ -32,6 +32,9 @@
...
@@ -32,6 +32,9 @@
#include "shlwapi.h"
#include "shlwapi.h"
#include "wininet.h"
#include "wininet.h"
#include "strsafe.h"
#include "strsafe.h"
#include "initguid.h"
DEFINE_GUID
(
CLSID_CUri
,
0xDF2FCE13
,
0x25EC
,
0x45BB
,
0x9D
,
0x4C
,
0xCE
,
0xCD
,
0x47
,
0xC2
,
0x43
,
0x0C
);
#define URI_STR_PROPERTY_COUNT Uri_PROPERTY_STRING_LAST+1
#define URI_STR_PROPERTY_COUNT Uri_PROPERTY_STRING_LAST+1
#define URI_DWORD_PROPERTY_COUNT (Uri_PROPERTY_DWORD_LAST - Uri_PROPERTY_DWORD_START)+1
#define URI_DWORD_PROPERTY_COUNT (Uri_PROPERTY_DWORD_LAST - Uri_PROPERTY_DWORD_START)+1
...
@@ -10799,6 +10802,98 @@ static void test_IPersistStream(void)
...
@@ -10799,6 +10802,98 @@ static void test_IPersistStream(void)
}
}
}
}
static
void
test_UninitializedUri
(
void
)
{
IUri
*
uri
;
IUriBuilderFactory
*
ubf
;
IPersistStream
*
ps
;
IUriBuilder
*
ub
;
BSTR
bstr
;
DWORD
dword
;
BOOL
eq
;
ULARGE_INTEGER
ui
;
HRESULT
hr
;
hr
=
CoCreateInstance
(
&
CLSID_CUri
,
NULL
,
CLSCTX_INPROC_SERVER
|
CLSCTX_INPROC_HANDLER
,
&
IID_IUri
,
(
void
**
)
&
uri
);
if
(
FAILED
(
hr
))
{
win_skip
(
"Skipping uninitialized Uri tests.
\n
"
);
return
;
}
hr
=
IUri_QueryInterface
(
uri
,
&
IID_IUriBuilderFactory
,
(
void
**
)
&
ubf
);
ok
(
hr
==
S_OK
,
"QueryInterface(IID_IUriBuillderFactory) failed: %x.
\n
"
,
hr
);
hr
=
IUri_QueryInterface
(
uri
,
&
IID_IPersistStream
,
(
void
**
)
&
ps
);
ok
(
hr
==
S_OK
,
"QueryInterface(IID_IPersistStream) failed: %x.
\n
"
,
hr
);
hr
=
IUri_GetAbsoluteUri
(
uri
,
NULL
);
ok
(
hr
==
E_UNEXPECTED
,
"GetAbsoluteUri returned %x, expected E_UNEXPECTED.
\n
"
,
hr
);
hr
=
IUri_GetAbsoluteUri
(
uri
,
&
bstr
);
ok
(
hr
==
E_UNEXPECTED
,
"GetAbsoluteUri returned %x, expected E_UNEXPECTED.
\n
"
,
hr
);
hr
=
IUri_GetAuthority
(
uri
,
&
bstr
);
ok
(
hr
==
E_UNEXPECTED
,
"GetAuthority returned %x, expected E_UNEXPECTED.
\n
"
,
hr
);
hr
=
IUri_GetDisplayUri
(
uri
,
&
bstr
);
ok
(
hr
==
E_UNEXPECTED
,
"GetDisplayUri returned %x, expected E_UNEXPECTED.
\n
"
,
hr
);
hr
=
IUri_GetDomain
(
uri
,
&
bstr
);
ok
(
hr
==
E_UNEXPECTED
,
"GetDomain returned %x, expected E_UNEXPECTED.
\n
"
,
hr
);
hr
=
IUri_GetExtension
(
uri
,
&
bstr
);
ok
(
hr
==
E_UNEXPECTED
,
"GetExtension returned %x, expected E_UNEXPECTED.
\n
"
,
hr
);
hr
=
IUri_GetFragment
(
uri
,
&
bstr
);
ok
(
hr
==
E_UNEXPECTED
,
"GetFragment returned %x, expected E_UNEXPECTED.
\n
"
,
hr
);
hr
=
IUri_GetHost
(
uri
,
&
bstr
);
ok
(
hr
==
E_UNEXPECTED
,
"GetHost returned %x, expected E_UNEXPECTED.
\n
"
,
hr
);
hr
=
IUri_GetHostType
(
uri
,
&
dword
);
ok
(
hr
==
E_UNEXPECTED
,
"GetHostType returned %x, expected E_UNEXPECTED.
\n
"
,
hr
);
hr
=
IUri_GetPassword
(
uri
,
&
bstr
);
ok
(
hr
==
E_UNEXPECTED
,
"GetPassword returned %x, expected E_UNEXPECTED.
\n
"
,
hr
);
hr
=
IUri_GetPassword
(
uri
,
&
bstr
);
ok
(
hr
==
E_UNEXPECTED
,
"GetPassword returned %x, expected E_UNEXPECTED.
\n
"
,
hr
);
hr
=
IUri_GetPathAndQuery
(
uri
,
&
bstr
);
ok
(
hr
==
E_UNEXPECTED
,
"GetPathAndQuery returned %x, expected E_UNEXPECTED.
\n
"
,
hr
);
hr
=
IUri_GetPort
(
uri
,
&
dword
);
ok
(
hr
==
E_UNEXPECTED
,
"GetPort returned %x, expected E_UNEXPECTED.
\n
"
,
hr
);
hr
=
IUri_GetProperties
(
uri
,
&
dword
);
ok
(
hr
==
E_UNEXPECTED
,
"GetProperties returned %x, expected E_UNEXPECTED.
\n
"
,
hr
);
hr
=
IUri_GetPropertyBSTR
(
uri
,
Uri_PROPERTY_RAW_URI
,
&
bstr
,
0
);
ok
(
hr
==
E_UNEXPECTED
,
"GetPropertyBSTR returned %x, expected E_UNEXPECTED.
\n
"
,
hr
);
hr
=
IUri_GetPropertyDWORD
(
uri
,
Uri_PROPERTY_PORT
,
&
dword
,
0
);
ok
(
hr
==
E_UNEXPECTED
,
"GetPropertyDWORD returned %x, expected E_UNEXPECTED.
\n
"
,
hr
);
hr
=
IUri_GetPropertyLength
(
uri
,
Uri_PROPERTY_RAW_URI
,
&
dword
,
0
);
ok
(
hr
==
E_UNEXPECTED
,
"GetPropertyLength returned %x, expected E_UNEXPECTED.
\n
"
,
hr
);
hr
=
IUri_GetQuery
(
uri
,
&
bstr
);
ok
(
hr
==
E_UNEXPECTED
,
"GetQuery returned %x, expected E_UNEXPECTED.
\n
"
,
hr
);
hr
=
IUri_GetRawUri
(
uri
,
&
bstr
);
ok
(
hr
==
E_UNEXPECTED
,
"GetRawUri returned %x, expected E_UNEXPECTED.
\n
"
,
hr
);
hr
=
IUri_GetScheme
(
uri
,
&
dword
);
ok
(
hr
==
E_UNEXPECTED
,
"GetScheme returned %x, expected E_UNEXPECTED.
\n
"
,
hr
);
hr
=
IUri_GetSchemeName
(
uri
,
&
bstr
);
ok
(
hr
==
E_UNEXPECTED
,
"GetSchemeName returned %x, expected E_UNEXPECTED.
\n
"
,
hr
);
hr
=
IUri_GetUserInfo
(
uri
,
&
bstr
);
ok
(
hr
==
E_UNEXPECTED
,
"GetUserInfo returned %x, expected E_UNEXPECTED.
\n
"
,
hr
);
hr
=
IUri_GetUserName
(
uri
,
&
bstr
);
ok
(
hr
==
E_UNEXPECTED
,
"GetUserName returned %x, expected E_UNEXPECTED.
\n
"
,
hr
);
hr
=
IUri_GetZone
(
uri
,
&
dword
);
ok
(
hr
==
E_UNEXPECTED
,
"GetZone returned %x, expected E_UNEXPECTED.
\n
"
,
hr
);
hr
=
IUri_IsEqual
(
uri
,
uri
,
&
eq
);
ok
(
hr
==
E_UNEXPECTED
,
"IsEqual returned %x, expected E_UNEXPECTED.
\n
"
,
hr
);
hr
=
IUriBuilderFactory_CreateInitializedIUriBuilder
(
ubf
,
0
,
0
,
&
ub
);
ok
(
hr
==
E_UNEXPECTED
,
"CreateInitializedIUriBuilder returned %x, expected E_UNEXPECTED.
\n
"
,
hr
);
hr
=
IUriBuilderFactory_CreateIUriBuilder
(
ubf
,
0
,
0
,
&
ub
);
ok
(
hr
==
S_OK
,
"CreateIUriBuilder returned %x, expected S_OK.
\n
"
,
hr
);
IUriBuilder_Release
(
ub
);
hr
=
IPersistStream_GetSizeMax
(
ps
,
&
ui
);
ok
(
hr
==
S_OK
,
"GetSizeMax returned %x, expected S_OK.
\n
"
,
hr
);
ok
(
ui
.
u
.
LowPart
==
34
,
"ui.LowPart = %d, expected 34.
\n
"
,
ui
.
u
.
LowPart
);
hr
=
IPersistStream_IsDirty
(
ps
);
ok
(
hr
==
S_FALSE
,
"IsDirty returned %x, expected S_FALSE.
\n
"
,
hr
);
IPersistStream_Release
(
ps
);
IUriBuilderFactory_Release
(
ubf
);
IUri_Release
(
uri
);
}
START_TEST
(
uri
)
{
START_TEST
(
uri
)
{
HMODULE
hurlmon
;
HMODULE
hurlmon
;
...
@@ -10916,5 +11011,11 @@ START_TEST(uri) {
...
@@ -10916,5 +11011,11 @@ START_TEST(uri) {
trace
(
"test IPersistStream...
\n
"
);
trace
(
"test IPersistStream...
\n
"
);
test_IPersistStream
();
test_IPersistStream
();
CoInitialize
(
NULL
);
trace
(
"test uninitialized Uri...
\n
"
);
test_UninitializedUri
();
CoUninitialize
();
unregister_protocols
();
unregister_protocols
();
}
}
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