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
84d5a396
Commit
84d5a396
authored
Oct 14, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 14, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Added more script state tests.
parent
b1c7f544
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
121 additions
and
0 deletions
+121
-0
vbscript.c
dlls/vbscript/tests/vbscript.c
+121
-0
No files found.
dlls/vbscript/tests/vbscript.c
View file @
84d5a396
...
...
@@ -471,12 +471,130 @@ static void test_vbscript_uninitializing(void)
test_state
(
script
,
SCRIPTSTATE_CLOSED
);
SET_EXPECT
(
GetLCID
);
SET_EXPECT
(
OnStateChange_INITIALIZED
);
hres
=
IActiveScript_SetScriptSite
(
script
,
&
ActiveScriptSite
);
ok
(
hres
==
S_OK
,
"SetScriptSite failed: %08x
\n
"
,
hres
);
CHECK_CALLED
(
GetLCID
);
CHECK_CALLED
(
OnStateChange_INITIALIZED
);
test_state
(
script
,
SCRIPTSTATE_INITIALIZED
);
SET_EXPECT
(
OnStateChange_CLOSED
);
hres
=
IActiveScript_Close
(
script
);
ok
(
hres
==
S_OK
,
"Close failed: %08x
\n
"
,
hres
);
CHECK_CALLED
(
OnStateChange_CLOSED
);
test_state
(
script
,
SCRIPTSTATE_CLOSED
);
IUnknown_Release
(
parse
);
ref
=
IActiveScript_Release
(
script
);
ok
(
!
ref
,
"ref = %d
\n
"
,
ref
);
}
static
void
test_vbscript_release
(
void
)
{
IActiveScriptParse
*
parser
;
IActiveScript
*
vbscript
;
ULONG
ref
;
HRESULT
hres
;
vbscript
=
create_vbscript
();
hres
=
IActiveScript_QueryInterface
(
vbscript
,
&
IID_IActiveScriptParse
,
(
void
**
)
&
parser
);
ok
(
hres
==
S_OK
,
"Could not get IActiveScriptParse iface: %08x
\n
"
,
hres
);
test_state
(
vbscript
,
SCRIPTSTATE_UNINITIALIZED
);
test_safety
(
vbscript
);
SET_EXPECT
(
GetLCID
);
hres
=
IActiveScript_SetScriptSite
(
vbscript
,
&
ActiveScriptSite
);
ok
(
hres
==
S_OK
,
"SetScriptSite failed: %08x
\n
"
,
hres
);
CHECK_CALLED
(
GetLCID
);
test_state
(
vbscript
,
SCRIPTSTATE_UNINITIALIZED
);
SET_EXPECT
(
OnStateChange_INITIALIZED
);
hres
=
IActiveScriptParse64_InitNew
(
parser
);
ok
(
hres
==
S_OK
,
"InitNew failed: %08x
\n
"
,
hres
);
CHECK_CALLED
(
OnStateChange_INITIALIZED
);
test_state
(
vbscript
,
SCRIPTSTATE_INITIALIZED
);
SET_EXPECT
(
OnStateChange_CONNECTED
);
hres
=
IActiveScript_SetScriptState
(
vbscript
,
SCRIPTSTATE_CONNECTED
);
ok
(
hres
==
S_OK
,
"SetScriptState(SCRIPTSTATE_CONNECTED) failed: %08x
\n
"
,
hres
);
CHECK_CALLED
(
OnStateChange_CONNECTED
);
test_state
(
vbscript
,
SCRIPTSTATE_CONNECTED
);
IActiveScriptParse64_Release
(
parser
);
SET_EXPECT
(
OnStateChange_DISCONNECTED
);
SET_EXPECT
(
OnStateChange_INITIALIZED
);
SET_EXPECT
(
OnStateChange_CLOSED
);
ref
=
IActiveScript_Release
(
vbscript
);
ok
(
!
ref
,
"ref = %d
\n
"
,
ref
);
CHECK_CALLED
(
OnStateChange_DISCONNECTED
);
CHECK_CALLED
(
OnStateChange_INITIALIZED
);
CHECK_CALLED
(
OnStateChange_CLOSED
);
}
static
void
test_vbscript_simplecreate
(
void
)
{
IActiveScript
*
script
;
ULONG
ref
;
HRESULT
hres
;
script
=
create_vbscript
();
hres
=
IActiveScript_SetScriptState
(
script
,
SCRIPTSTATE_UNINITIALIZED
);
ok
(
hres
==
S_OK
,
"SetScriptState(SCRIPTSTATE_UNINITIALIZED) failed: %08x
\n
"
,
hres
);
ref
=
IActiveScript_Release
(
script
);
ok
(
!
ref
,
"ref = %d
\n
"
,
ref
);
}
static
void
test_vbscript_initializing
(
void
)
{
IActiveScriptParse
*
parse
;
IActiveScript
*
script
;
ULONG
ref
;
HRESULT
hres
;
script
=
create_vbscript
();
hres
=
IActiveScript_QueryInterface
(
script
,
&
IID_IActiveScriptParse
,
(
void
**
)
&
parse
);
ok
(
hres
==
S_OK
,
"Could not get IActiveScriptParse: %08x
\n
"
,
hres
);
test_state
(
script
,
SCRIPTSTATE_UNINITIALIZED
);
SET_EXPECT
(
GetLCID
);
hres
=
IActiveScript_SetScriptSite
(
script
,
&
ActiveScriptSite
);
ok
(
hres
==
S_OK
,
"SetScriptSite failed: %08x
\n
"
,
hres
);
CHECK_CALLED
(
GetLCID
);
SET_EXPECT
(
OnStateChange_INITIALIZED
);
hres
=
IActiveScriptParse64_InitNew
(
parse
);
ok
(
hres
==
S_OK
,
"InitNew failed: %08x
\n
"
,
hres
);
CHECK_CALLED
(
OnStateChange_INITIALIZED
);
hres
=
IActiveScript_SetScriptSite
(
script
,
&
ActiveScriptSite
);
ok
(
hres
==
E_UNEXPECTED
,
"SetScriptSite failed: %08x, expected E_UNEXPECTED
\n
"
,
hres
);
SET_EXPECT
(
OnStateChange_CLOSED
);
hres
=
IActiveScript_Close
(
script
);
ok
(
hres
==
S_OK
,
"Close failed: %08x
\n
"
,
hres
);
CHECK_CALLED
(
OnStateChange_CLOSED
);
test_state
(
script
,
SCRIPTSTATE_CLOSED
);
IUnknown_Release
(
parse
);
ref
=
IActiveScript_Release
(
script
);
ok
(
!
ref
,
"ref = %d
\n
"
,
ref
);
}
static
BOOL
check_vbscript
(
void
)
{
...
...
@@ -498,6 +616,9 @@ START_TEST(vbscript)
if
(
check_vbscript
())
{
test_vbscript
();
test_vbscript_uninitializing
();
test_vbscript_release
();
test_vbscript_simplecreate
();
test_vbscript_initializing
();
}
else
{
win_skip
(
"VBScript engine not available
\n
"
);
}
...
...
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