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
694bf576
Commit
694bf576
authored
Jul 02, 2009
by
Detlef Riekenberg
Committed by
Alexandre Julliard
Jul 03, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon/tests: Add tests for the ZoneEnumerator.
parent
9a7f221b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
120 additions
and
0 deletions
+120
-0
sec_mgr.c
dlls/urlmon/tests/sec_mgr.c
+120
-0
No files found.
dlls/urlmon/tests/sec_mgr.c
View file @
694bf576
/*
* Copyright 2005-2006 Jacek Caban for CodeWeavers
* Copyright 2009 Detlef Riekenberg
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -281,6 +282,74 @@ static void test_polices(void)
IInternetZoneManager_Release
(
zonemgr
);
}
static
void
test_CreateZoneEnumerator
(
void
)
{
IInternetZoneManager
*
zonemgr
=
NULL
;
HRESULT
hr
;
DWORD
dwEnum
;
DWORD
dwEnum2
;
DWORD
dwCount
;
DWORD
dwCount2
;
hr
=
CoInternetCreateZoneManager
(
NULL
,
&
zonemgr
,
0
);
ok
(
hr
==
S_OK
,
"CoInternetCreateZoneManager result: 0x%x
\n
"
,
hr
);
if
(
FAILED
(
hr
))
return
;
dwEnum
=
0xdeadbeef
;
hr
=
IInternetZoneManager_CreateZoneEnumerator
(
zonemgr
,
&
dwEnum
,
NULL
,
0
);
ok
((
hr
==
E_INVALIDARG
)
&&
(
dwEnum
==
0xdeadbeef
),
"got 0x%x with 0x%x (expected E_INVALIDARG with 0xdeadbeef)
\n
"
,
hr
,
dwEnum
);
dwCount
=
0xdeadbeef
;
hr
=
IInternetZoneManager_CreateZoneEnumerator
(
zonemgr
,
NULL
,
&
dwCount
,
0
);
ok
((
hr
==
E_INVALIDARG
)
&&
(
dwCount
==
0xdeadbeef
),
"got 0x%x and 0x%x (expected E_INVALIDARG and 0xdeadbeef)
\n
"
,
hr
,
dwCount
);
dwEnum
=
0xdeadbeef
;
dwCount
=
0xdeadbeef
;
hr
=
IInternetZoneManager_CreateZoneEnumerator
(
zonemgr
,
&
dwEnum
,
&
dwCount
,
0xffffffff
);
ok
((
hr
==
E_INVALIDARG
)
&&
(
dwEnum
==
0xdeadbeef
)
&&
(
dwCount
==
0xdeadbeef
),
"got 0x%x with 0x%x and 0x%x (expected E_INVALIDARG with 0xdeadbeef and 0xdeadbeef)
\n
"
,
hr
,
dwEnum
,
dwCount
);
dwEnum
=
0xdeadbeef
;
dwCount
=
0xdeadbeef
;
hr
=
IInternetZoneManager_CreateZoneEnumerator
(
zonemgr
,
&
dwEnum
,
&
dwCount
,
1
);
ok
((
hr
==
E_INVALIDARG
)
&&
(
dwEnum
==
0xdeadbeef
)
&&
(
dwCount
==
0xdeadbeef
),
"got 0x%x with 0x%x and 0x%x (expected E_INVALIDARG with 0xdeadbeef and 0xdeadbeef)
\n
"
,
hr
,
dwEnum
,
dwCount
);
dwEnum
=
0xdeadbeef
;
dwCount
=
0xdeadbeef
;
/* Normal use */
hr
=
IInternetZoneManager_CreateZoneEnumerator
(
zonemgr
,
&
dwEnum
,
&
dwCount
,
0
);
ok
(
hr
==
S_OK
,
"got 0x%x (expected S_OK)
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
dwEnum2
=
0xdeadbeef
;
dwCount2
=
0xdeadbeef
;
hr
=
IInternetZoneManager_CreateZoneEnumerator
(
zonemgr
,
&
dwEnum2
,
&
dwCount2
,
0
);
ok
(
hr
==
S_OK
,
"got 0x%x (expected S_OK)
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
/* native urlmon has an incrementing counter for dwEnum */
hr
=
IInternetZoneManager_DestroyZoneEnumerator
(
zonemgr
,
dwEnum2
);
ok
(
hr
==
S_OK
,
"got 0x%x (expected S_OK)
\n
"
,
hr
);
}
hr
=
IInternetZoneManager_DestroyZoneEnumerator
(
zonemgr
,
dwEnum
);
ok
(
hr
==
S_OK
,
"got 0x%x (expected S_OK)
\n
"
,
hr
);
/* Destroy the Enumerator twice is detected and handled in native urlmon */
hr
=
IInternetZoneManager_DestroyZoneEnumerator
(
zonemgr
,
dwEnum
);
ok
((
hr
==
E_INVALIDARG
),
"got 0x%x (expected E_INVALIDARG)
\n
"
,
hr
);
}
/* ::Release succeed also, when a ::DestroyZoneEnumerator is missing */
hr
=
IInternetZoneManager_Release
(
zonemgr
);
ok
(
hr
==
S_OK
,
"got 0x%x (expected S_OK)
\n
"
,
hr
);
}
static
void
test_GetZoneActionPolicy
(
void
)
{
IInternetZoneManager
*
zonemgr
=
NULL
;
...
...
@@ -321,6 +390,55 @@ static void test_GetZoneActionPolicy(void)
IInternetZoneManager_Release
(
zonemgr
);
}
static
void
test_GetZoneAt
(
void
)
{
IInternetZoneManager
*
zonemgr
=
NULL
;
HRESULT
hr
;
DWORD
dwEnum
;
DWORD
dwCount
;
DWORD
dwZone
;
DWORD
i
;
hr
=
CoInternetCreateZoneManager
(
NULL
,
&
zonemgr
,
0
);
ok
(
hr
==
S_OK
,
"CoInternetCreateZoneManager result: 0x%x
\n
"
,
hr
);
if
(
FAILED
(
hr
))
return
;
hr
=
IInternetZoneManager_CreateZoneEnumerator
(
zonemgr
,
&
dwEnum
,
&
dwCount
,
0
);
if
(
FAILED
(
hr
))
goto
cleanup
;
if
(
0
)
{
/* this crashes with native urlmon */
hr
=
IInternetZoneManager_GetZoneAt
(
zonemgr
,
dwEnum
,
0
,
NULL
);
}
dwZone
=
0xdeadbeef
;
hr
=
IInternetZoneManager_GetZoneAt
(
zonemgr
,
0xdeadbeef
,
0
,
&
dwZone
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%x with 0x%x (expected E_INVALIDARG)
\n
"
,
hr
,
dwZone
);
for
(
i
=
0
;
i
<
dwCount
;
i
++
)
{
dwZone
=
0xdeadbeef
;
hr
=
IInternetZoneManager_GetZoneAt
(
zonemgr
,
dwEnum
,
i
,
&
dwZone
);
ok
(
hr
==
S_OK
,
"#%d: got x%x with %d (expected S_OK)
\n
"
,
i
,
hr
,
dwZone
);
}
dwZone
=
0xdeadbeef
;
/* MSDN (index .. must be .. less than or equal to) is wrong */
hr
=
IInternetZoneManager_GetZoneAt
(
zonemgr
,
dwEnum
,
dwCount
,
&
dwZone
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%x with 0x%x (expected E_INVALIDARG)
\n
"
,
hr
,
dwZone
);
hr
=
IInternetZoneManager_DestroyZoneEnumerator
(
zonemgr
,
dwEnum
);
ok
(
hr
==
S_OK
,
"got 0x%x (expected S_OK)
\n
"
,
hr
);
cleanup:
hr
=
IInternetZoneManager_Release
(
zonemgr
);
ok
(
hr
==
S_OK
,
"got 0x%x (expected S_OK)
\n
"
,
hr
);
}
static
void
test_GetZoneAttributes
(
void
)
{
IInternetZoneManager
*
zonemgr
=
NULL
;
...
...
@@ -382,7 +500,9 @@ START_TEST(sec_mgr)
test_SecurityManager
();
test_polices
();
test_CreateZoneEnumerator
();
test_GetZoneActionPolicy
();
test_GetZoneAt
();
test_GetZoneAttributes
();
OleUninitialize
();
...
...
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