Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stefan Dösinger
wine
Commits
694bf576
Commit
694bf576
authored
15 years ago
by
Detlef Riekenberg
Committed by
Alexandre Julliard
15 years ago
Browse files
Options
Downloads
Patches
Plain Diff
urlmon/tests: Add tests for the ZoneEnumerator.
parent
9a7f221b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/urlmon/tests/sec_mgr.c
+120
-0
120 additions, 0 deletions
dlls/urlmon/tests/sec_mgr.c
with
120 additions
and
0 deletions
dlls/urlmon/tests/sec_mgr.c
+
120
−
0
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
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment