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
b9117b61
Commit
b9117b61
authored
Apr 10, 2008
by
Jacek Caban
Committed by
Alexandre Julliard
Apr 10, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Added IObjectSafety tests.
parent
5ba99f4e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
2 deletions
+63
-2
Makefile.in
dlls/jscript/tests/Makefile.in
+1
-0
jscript.c
dlls/jscript/tests/jscript.c
+62
-2
No files found.
dlls/jscript/tests/Makefile.in
View file @
b9117b61
...
...
@@ -4,6 +4,7 @@ SRCDIR = @srcdir@
VPATH
=
@srcdir@
TESTDLL
=
jscript.dll
IMPORTS
=
ole32 kernel32
EXTRALIBS
=
-luuid
CTESTS
=
\
jscript.c
...
...
dlls/jscript/tests/jscript.c
View file @
b9117b61
...
...
@@ -18,16 +18,74 @@
#define COBJMACROS
#include <initguid.h>
#include <ole2.h>
#include <activscp.h>
#include <objsafe.h>
#include "wine/test.h"
static
const
CLSID
CLSID_JScript
=
{
0xf414c260
,
0x6ac0
,
0x11cf
,{
0xb6
,
0xd1
,
0x00
,
0xaa
,
0x00
,
0xbb
,
0xbb
,
0x58
}};
static
void
test_safety
(
IUnknown
*
unk
)
{
IObjectSafety
*
safety
;
DWORD
supported
,
enabled
;
HRESULT
hres
;
hres
=
IUnknown_QueryInterface
(
unk
,
&
IID_IObjectSafety
,
(
void
**
)
&
safety
);
ok
(
hres
==
S_OK
,
"Could not get IObjectSafety: %08x
\n
"
,
hres
);
if
(
FAILED
(
hres
))
return
;
hres
=
IObjectSafety_GetInterfaceSafetyOptions
(
safety
,
&
IID_NULL
,
&
supported
,
NULL
);
ok
(
hres
==
E_POINTER
,
"GetInterfaceSafetyOptions failed: %08x, expected E_POINTER
\n
"
,
hres
);
hres
=
IObjectSafety_GetInterfaceSafetyOptions
(
safety
,
&
IID_NULL
,
NULL
,
&
enabled
);
ok
(
hres
==
E_POINTER
,
"GetInterfaceSafetyOptions failed: %08x, expected E_POINTER
\n
"
,
hres
);
supported
=
enabled
=
0xdeadbeef
;
hres
=
IObjectSafety_GetInterfaceSafetyOptions
(
safety
,
&
IID_NULL
,
&
supported
,
&
enabled
);
ok
(
hres
==
S_OK
,
"GetInterfaceSafetyOptions failed: %08x
\n
"
,
hres
);
ok
(
supported
==
(
INTERFACESAFE_FOR_UNTRUSTED_DATA
|
INTERFACE_USES_DISPEX
|
INTERFACE_USES_SECURITY_MANAGER
),
"supported=%x
\n
"
,
supported
);
ok
(
enabled
==
INTERFACE_USES_DISPEX
,
"enabled=%x
\n
"
,
enabled
);
supported
=
enabled
=
0xdeadbeef
;
hres
=
IObjectSafety_GetInterfaceSafetyOptions
(
safety
,
&
IID_IActiveScript
,
&
supported
,
&
enabled
);
ok
(
hres
==
S_OK
,
"GetInterfaceSafetyOptions failed: %08x
\n
"
,
hres
);
ok
(
supported
==
(
INTERFACESAFE_FOR_UNTRUSTED_DATA
|
INTERFACE_USES_DISPEX
|
INTERFACE_USES_SECURITY_MANAGER
),
"supported=%x
\n
"
,
supported
);
ok
(
enabled
==
INTERFACE_USES_DISPEX
,
"enabled=%x
\n
"
,
enabled
);
supported
=
enabled
=
0xdeadbeef
;
hres
=
IObjectSafety_GetInterfaceSafetyOptions
(
safety
,
&
IID_IActiveScriptParse
,
&
supported
,
&
enabled
);
ok
(
hres
==
S_OK
,
"GetInterfaceSafetyOptions failed: %08x
\n
"
,
hres
);
ok
(
supported
==
(
INTERFACESAFE_FOR_UNTRUSTED_DATA
|
INTERFACE_USES_DISPEX
|
INTERFACE_USES_SECURITY_MANAGER
),
"supported=%x
\n
"
,
supported
);
ok
(
enabled
==
INTERFACE_USES_DISPEX
,
"enabled=%x
\n
"
,
enabled
);
hres
=
IObjectSafety_SetInterfaceSafetyOptions
(
safety
,
&
IID_IActiveScriptParse
,
INTERFACESAFE_FOR_UNTRUSTED_DATA
|
INTERFACE_USES_DISPEX
|
INTERFACE_USES_SECURITY_MANAGER
|
INTERFACESAFE_FOR_UNTRUSTED_CALLER
,
INTERFACESAFE_FOR_UNTRUSTED_DATA
|
INTERFACE_USES_DISPEX
|
INTERFACE_USES_SECURITY_MANAGER
);
ok
(
hres
==
E_FAIL
,
"SetInterfaceSafetyOptions failed: %08x
\n
, expected E_FAIL"
,
hres
);
hres
=
IObjectSafety_SetInterfaceSafetyOptions
(
safety
,
&
IID_IActiveScriptParse
,
INTERFACESAFE_FOR_UNTRUSTED_DATA
|
INTERFACE_USES_DISPEX
|
INTERFACE_USES_SECURITY_MANAGER
,
INTERFACESAFE_FOR_UNTRUSTED_DATA
|
INTERFACE_USES_DISPEX
|
INTERFACE_USES_SECURITY_MANAGER
);
ok
(
hres
==
S_OK
,
"SetInterfaceSafetyOptions failed: %08x
\n
"
,
hres
);
supported
=
enabled
=
0xdeadbeef
;
hres
=
IObjectSafety_GetInterfaceSafetyOptions
(
safety
,
&
IID_IActiveScriptParse
,
&
supported
,
&
enabled
);
ok
(
hres
==
S_OK
,
"GetInterfaceSafetyOptions failed: %08x
\n
"
,
hres
);
ok
(
supported
==
(
INTERFACESAFE_FOR_UNTRUSTED_DATA
|
INTERFACE_USES_DISPEX
|
INTERFACE_USES_SECURITY_MANAGER
),
"supported=%x
\n
"
,
supported
);
ok
(
enabled
==
(
INTERFACESAFE_FOR_UNTRUSTED_DATA
|
INTERFACE_USES_DISPEX
|
INTERFACE_USES_SECURITY_MANAGER
),
"enabled=%x
\n
"
,
enabled
);
IObjectSafety_Release
(
safety
);
}
static
void
test_jscript
(
void
)
{
IActiveScriptParse
*
parse
;
...
...
@@ -47,6 +105,8 @@ static void test_jscript(void)
hres
=
IUnknown_QueryInterface
(
unk
,
&
IID_IActiveScriptParse
,
(
void
**
)
&
parse
);
ok
(
hres
==
S_OK
,
"Could not get IActiveScriptParse: %08x
\n
"
,
hres
);
test_safety
(
unk
);
IActiveScriptParse_Release
(
parse
);
IActiveScript_Release
(
script
);
IUnknown_Release
(
unk
);
...
...
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