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
a489b7ef
Commit
a489b7ef
authored
Jul 30, 2023
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Aug 01, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript/tests: Avoid using a2bstr() in the run.c helpers.
parent
23e2eb39
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
95 additions
and
95 deletions
+95
-95
run.c
dlls/vbscript/tests/run.c
+95
-95
No files found.
dlls/vbscript/tests/run.c
View file @
a489b7ef
...
...
@@ -2118,23 +2118,23 @@ static HRESULT parse_script(DWORD flags, BSTR script_str, const WCHAR *delim)
return
hres
;
}
static
void
parse_script_
af
(
DWORD
flags
,
const
char
*
src
)
static
void
parse_script_
wf
(
DWORD
flags
,
const
WCHAR
*
src
)
{
BSTR
tmp
;
HRESULT
hres
;
tmp
=
a2bstr
(
src
);
tmp
=
SysAllocString
(
src
);
hres
=
parse_script
(
flags
,
tmp
,
NULL
);
SysFreeString
(
tmp
);
ok
(
hres
==
S_OK
,
"parse_script failed: %08lx
\n
"
,
hres
);
}
static
HRESULT
parse_script_
ar
(
const
char
*
src
)
static
HRESULT
parse_script_
wr
(
const
WCHAR
*
src
)
{
BSTR
tmp
;
HRESULT
hres
;
tmp
=
a2bstr
(
src
);
tmp
=
SysAllocString
(
src
);
hres
=
parse_script
(
SCRIPTITEM_GLOBALMEMBERS
,
tmp
,
NULL
);
SysFreeString
(
tmp
);
return
hres
;
...
...
@@ -2196,31 +2196,31 @@ static void test_parse_context(void)
ok
(
global_ref
==
1
,
"global_ref = %lu
\n
"
,
global_ref
);
}
static
void
parse_script_
a
(
const
char
*
src
)
static
void
parse_script_
w
(
const
WCHAR
*
src
)
{
parse_script_
a
f
(
SCRIPTITEM_GLOBALMEMBERS
,
src
);
parse_script_
w
f
(
SCRIPTITEM_GLOBALMEMBERS
,
src
);
}
#define parse_htmlscript
_a(a) _parse_htmlscript_a
(__LINE__,a)
static
void
_parse_htmlscript
_a
(
unsigned
line
,
const
char
*
src
)
#define parse_htmlscript
(a) _parse_htmlscript
(__LINE__,a)
static
void
_parse_htmlscript
(
unsigned
line
,
const
WCHAR
*
src
)
{
BSTR
tmp
;
HRESULT
hres
;
tmp
=
a2bstr
(
src
);
tmp
=
SysAllocString
(
src
);
hres
=
parse_script
(
SCRIPTITEM_GLOBALMEMBERS
,
tmp
,
L"</SCRIPT>"
);
SysFreeString
(
tmp
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"parse_script failed: %08lx
\n
"
,
hres
);
}
static
IDispatchEx
*
parse_procedure
(
IActiveScriptParseProcedure2
*
parse_proc
,
const
char
*
src
,
DWORD
flags
)
static
IDispatchEx
*
parse_procedure
(
IActiveScriptParseProcedure2
*
parse_proc
,
const
WCHAR
*
src
,
DWORD
flags
)
{
IDispatchEx
*
dispex
;
IDispatch
*
disp
;
BSTR
str
;
HRESULT
hres
;
str
=
a2bstr
(
src
);
str
=
SysAllocString
(
src
);
hres
=
IActiveScriptParseProcedure2_ParseProcedureText
(
parse_proc
,
str
,
NULL
,
L""
,
NULL
,
NULL
,
L"
\"
"
,
0
,
0
,
SCRIPTPROC_HOSTMANAGESSOURCE
|
SCRIPTPROC_IMPLICIT_THIS
|
SCRIPTPROC_IMPLICIT_PARENTS
|
flags
,
&
disp
);
SysFreeString
(
str
);
...
...
@@ -2256,7 +2256,7 @@ static void test_procedures(void)
ok
(
hres
==
S_OK
,
"ParseProcedureText failed: %08lx
\n
"
,
hres
);
IDispatch_Release
(
disp
);
proc
=
parse_procedure
(
parse_proc
,
"dim x
\n
if true then x=false"
,
0
);
proc
=
parse_procedure
(
parse_proc
,
L
"dim x
\n
if true then x=false"
,
0
);
SET_EXPECT
(
OnEnterScript
);
SET_EXPECT
(
OnLeaveScript
);
...
...
@@ -2268,7 +2268,7 @@ static void test_procedures(void)
VariantClear
(
&
v
);
IDispatchEx_Release
(
proc
);
proc
=
parse_procedure
(
parse_proc
,
"
\"
foobar
\"
"
,
SCRIPTPROC_ISEXPRESSION
);
proc
=
parse_procedure
(
parse_proc
,
L
"
\"
foobar
\"
"
,
SCRIPTPROC_ISEXPRESSION
);
SET_EXPECT
(
OnEnterScript
);
SET_EXPECT
(
OnLeaveScript
);
...
...
@@ -2458,7 +2458,7 @@ static void test_callbacks(void)
store_script_error
=
&
error1
;
SET_EXPECT
(
OnScriptError
);
hres
=
parse_script_
ar
(
"throwException &h80004002&"
);
hres
=
parse_script_
wr
(
L
"throwException &h80004002&"
);
ok
(
hres
==
MAKE_VBSERROR
(
430
),
"got error: %08lx
\n
"
,
hres
);
CHECK_CALLED
(
OnScriptError
);
...
...
@@ -2484,7 +2484,7 @@ static void test_callbacks(void)
store_script_error
=
&
error1
;
SET_EXPECT
(
OnScriptError
);
hres
=
parse_script_
ar
(
"throwException &h80004002&,
\"
test src
\"
"
);
hres
=
parse_script_
wr
(
L
"throwException &h80004002&,
\"
test src
\"
"
);
ok
(
hres
==
MAKE_VBSERROR
(
430
),
"got error: %08lx
\n
"
,
hres
);
CHECK_CALLED
(
OnScriptError
);
...
...
@@ -2509,7 +2509,7 @@ static void test_callbacks(void)
store_script_error
=
&
error1
;
SET_EXPECT
(
OnScriptError
);
hres
=
parse_script_
ar
(
"throwException &h80004002&, ,
\"
test desc
\"
"
);
hres
=
parse_script_
wr
(
L
"throwException &h80004002&, ,
\"
test desc
\"
"
);
ok
(
hres
==
E_NOINTERFACE
,
"got error: %08lx
\n
"
,
hres
);
CHECK_CALLED
(
OnScriptError
);
...
...
@@ -2534,7 +2534,7 @@ static void test_callbacks(void)
store_script_error
=
&
error1
;
SET_EXPECT
(
OnScriptError
);
hres
=
parse_script_
ar
(
"throwException &h80004002&,
\"
test src
\"
,
\"
test desc
\"
"
);
hres
=
parse_script_
wr
(
L
"throwException &h80004002&,
\"
test src
\"
,
\"
test desc
\"
"
);
ok
(
hres
==
E_NOINTERFACE
,
"got error: %08lx
\n
"
,
hres
);
CHECK_CALLED
(
OnScriptError
);
...
...
@@ -2559,7 +2559,7 @@ static void test_callbacks(void)
store_script_error
=
&
error1
;
SET_EXPECT
(
OnScriptError
);
hres
=
parse_script_
ar
(
"throwException &h8000FFFF&"
);
hres
=
parse_script_
wr
(
L
"throwException &h8000FFFF&"
);
ok
(
hres
==
E_UNEXPECTED
,
"got error: %08lx
\n
"
,
hres
);
CHECK_CALLED
(
OnScriptError
);
...
...
@@ -2644,7 +2644,7 @@ static void test_parse_errors(void)
{
static
const
struct
{
const
char
*
src
;
const
WCHAR
*
src
;
unsigned
error_line
;
int
error_char
;
}
...
...
@@ -2652,49 +2652,49 @@ static void test_parse_errors(void)
{
{
/* If...End If */
"If 0 > 1 Then
\n
"
L
"If 0 > 1 Then
\n
"
" x = 0 End If
\n
"
,
1
,
10
},
{
/* While...End While */
"While False
\n
"
L
"While False
\n
"
" x = 0 End While
\n
"
,
1
,
10
},
{
/* While...Wend */
"While False
\n
"
L
"While False
\n
"
" x = 0 Wend
\n
"
,
1
,
10
},
{
/* Do While...Loop */
"Do While False
\n
"
L
"Do While False
\n
"
" x = 0 Loop
\n
"
,
1
,
10
},
{
/* Do Until...Loop */
"Do Until True
\n
"
L
"Do Until True
\n
"
" x = 0 Loop
\n
"
,
1
,
10
},
{
/* Do...Loop While */
"Do
\n
"
L
"Do
\n
"
" x = 0 Loop While False
\n
"
,
1
,
10
},
{
/* Do...Loop Until */
"Do
\n
"
L
"Do
\n
"
" x = 0 Loop Until True
\n
"
,
1
,
10
},
{
/* Select...End Select */
"x = False
\n
"
L
"x = False
\n
"
"Select Case 42
\n
"
" Case 0
\n
"
" Call ok(False,
\"
unexpected case
\"
)
\n
"
...
...
@@ -2705,35 +2705,35 @@ static void test_parse_errors(void)
},
{
/* Class...End Class (empty) */
"Class C End Class"
,
L
"Class C End Class"
,
0
,
8
},
{
/* Class...End Class (empty) */
"Class C _
\n
End Class"
,
L
"Class C _
\n
End Class"
,
1
,
0
},
{
/* invalid use of parentheses for call statement */
"strcomp(
\"
x
\"
,
\"
y
\"
)"
,
L
"strcomp(
\"
x
\"
,
\"
y
\"
)"
,
0
,
-
17
},
{
"
\n\n\n
cint _
\n
throwInt(&h80001234&)"
,
L
"
\n\n\n
cint _
\n
throwInt(&h80001234&)"
,
3
,
2
},
{
"dim x
\n
"
L
"dim x
\n
"
"if true then throwInt(&h80001234&)"
,
1
,
13
},
{
"dim x
\n
"
L
"dim x
\n
"
"if x = throwInt(&h80001234&) then x = 1"
,
1
,
0
},
{
"sub test
\n
"
L
"sub test
\n
"
" dim x
\n
"
" if x = throwInt(&h80001234&) then x = 1
\n
"
"end sub
\n
"
...
...
@@ -2741,14 +2741,14 @@ static void test_parse_errors(void)
2
,
4
},
{
"dim x
\n
"
L
"dim x
\n
"
"do
\n
"
" x = 1
\n
"
"loop until throwInt(&h80001234&)
\n
"
,
3
,
0
},
{
"
\n
select case 3
\n
"
L
"
\n
select case 3
\n
"
" case 2
\n
"
" ok false,
\"
unexpected case
\"\n
"
" case throwInt(&h80001234&)
\n
"
...
...
@@ -2757,7 +2757,7 @@ static void test_parse_errors(void)
1
,
2
},
{
"if false then
\n
"
L
"if false then
\n
"
" ok false,
\"
unexpected case
\"\n
"
" elseif throwInt(&h80001234&) then
\n
"
" throwInt &h87001234&
\n
"
...
...
@@ -2777,7 +2777,7 @@ static void test_parse_errors(void)
onerror_hres
=
S_OK
;
SET_EXPECT
(
OnScriptError
);
hres
=
parse_script_
a
r
(
invalid_scripts
[
i
].
src
);
hres
=
parse_script_
w
r
(
invalid_scripts
[
i
].
src
);
ok
(
hres
==
SCRIPT_E_REPORTED
,
"[%u] script returned: %08lx
\n
"
,
i
,
hres
);
CHECK_CALLED
(
OnScriptError
);
...
...
@@ -2798,7 +2798,7 @@ static void test_msgbox(void)
SET_EXPECT
(
GetUIBehavior
);
SET_EXPECT
(
GetWindow
);
SET_EXPECT
(
EnableModeless
);
hres
=
parse_script_
ar
(
"MsgBox
\"
testing...
\"
"
);
hres
=
parse_script_
wr
(
L
"MsgBox
\"
testing...
\"
"
);
CLEAR_CALLED
(
GetUIBehavior
);
CLEAR_CALLED
(
GetWindow
);
CLEAR_CALLED
(
EnableModeless
);
...
...
@@ -2808,11 +2808,11 @@ static void test_msgbox(void)
}
SET_EXPECT
(
GetUIBehavior
);
parse_script_
a
(
"dim r
\n
r=MsgBox(
\"
testing...
\"
)
\n
Call ok(r=0,
\"
r=
\"
&r)"
);
parse_script_
w
(
L
"dim r
\n
r=MsgBox(
\"
testing...
\"
)
\n
Call ok(r=0,
\"
r=
\"
&r)"
);
CHECK_CALLED
(
GetUIBehavior
);
SET_EXPECT
(
GetUIBehavior
);
parse_script_
a
(
"MsgBox 10"
);
parse_script_
w
(
L
"MsgBox 10"
);
CHECK_CALLED
(
GetUIBehavior
);
uic_handling
=
SCRIPTUICHANDLING_ALLOW
;
...
...
@@ -2821,7 +2821,7 @@ static void test_msgbox(void)
SET_EXPECT
(
GetWindow
);
SET_EXPECT
(
EnableModeless
);
SET_EXPECT
(
OnScriptError
);
hres
=
parse_script_
ar
(
"MsgBox
\"
testing...
\"
"
);
hres
=
parse_script_
wr
(
L
"MsgBox
\"
testing...
\"
"
);
ok
(
FAILED
(
hres
),
"script not failed
\n
"
);
CHECK_CALLED
(
GetUIBehavior
);
CHECK_CALLED
(
GetWindow
);
...
...
@@ -2832,7 +2832,7 @@ static void test_msgbox(void)
SET_EXPECT
(
GetUIBehavior
);
SET_EXPECT
(
OnScriptError
);
hres
=
parse_script_
ar
(
"MsgBox
\"
testing...
\"
"
);
hres
=
parse_script_
wr
(
L
"MsgBox
\"
testing...
\"
"
);
ok
(
FAILED
(
hres
),
"script not failed
\n
"
);
CHECK_CALLED
(
GetUIBehavior
);
CHECK_CALLED
(
OnScriptError
);
...
...
@@ -3175,210 +3175,210 @@ static void run_tests(void)
strict_dispid_check
=
TRUE
;
parse_script_
a
(
""
);
parse_script_
a
(
"' empty ;"
);
parse_script_
w
(
L
""
);
parse_script_
w
(
L
"' empty ;"
);
SET_EXPECT
(
global_success_d
);
SET_EXPECT
(
global_success_i
);
parse_script_
a
(
"reportSuccess"
);
parse_script_
w
(
L
"reportSuccess"
);
CHECK_CALLED
(
global_success_d
);
CHECK_CALLED
(
global_success_i
);
SET_EXPECT
(
global_success_d
);
SET_EXPECT
(
global_success_i
);
parse_script_
a
(
"reportSuccess()"
);
parse_script_
w
(
L
"reportSuccess()"
);
CHECK_CALLED
(
global_success_d
);
CHECK_CALLED
(
global_success_i
);
SET_EXPECT
(
global_success_d
);
SET_EXPECT
(
global_success_i
);
parse_script_
a
(
"Call reportSuccess"
);
parse_script_
w
(
L
"Call reportSuccess"
);
CHECK_CALLED
(
global_success_d
);
CHECK_CALLED
(
global_success_i
);
SET_EXPECT
(
global_success_d
);
SET_EXPECT
(
global_success_i
);
parse_script_
a
(
"test.reportSuccess()"
);
parse_script_
w
(
L
"test.reportSuccess()"
);
CHECK_CALLED
(
global_success_d
);
CHECK_CALLED
(
global_success_i
);
SET_EXPECT
(
global_success_d
);
SET_EXPECT
(
global_success_i
);
parse_script_
af
(
0
,
"TEST.reportSuccess()"
);
parse_script_
wf
(
0
,
L
"TEST.reportSuccess()"
);
CHECK_CALLED
(
global_success_d
);
CHECK_CALLED
(
global_success_i
);
SET_EXPECT
(
global_vbvar_d
);
SET_EXPECT
(
global_vbvar_i
);
parse_script_
a
(
"Option Explicit
\n
vbvar = 3"
);
parse_script_
w
(
L
"Option Explicit
\n
vbvar = 3"
);
CHECK_CALLED
(
global_vbvar_d
);
CHECK_CALLED
(
global_vbvar_i
);
SET_EXPECT
(
global_vbvar_d
);
SET_EXPECT
(
global_vbvar_i
);
parse_script_
a
(
"Option Explicit
\n
vbvar() = 3"
);
parse_script_
w
(
L
"Option Explicit
\n
vbvar() = 3"
);
CHECK_CALLED
(
global_vbvar_d
);
CHECK_CALLED
(
global_vbvar_i
);
SET_EXPECT
(
global_letobj_i
);
parse_script_
a
(
"Option Explicit
\n
letobj = testObj"
);
parse_script_
w
(
L
"Option Explicit
\n
letobj = testObj"
);
CHECK_CALLED
(
global_letobj_i
);
SET_EXPECT
(
global_letobj_i
);
parse_script_
a
(
"Option Explicit
\n
test.letobj = testObj"
);
parse_script_
w
(
L
"Option Explicit
\n
test.letobj = testObj"
);
CHECK_CALLED
(
global_letobj_i
);
SET_EXPECT
(
global_setobj_i
);
parse_script_
a
(
"Option Explicit
\n
set setobj = testObj"
);
parse_script_
w
(
L
"Option Explicit
\n
set setobj = testObj"
);
CHECK_CALLED
(
global_setobj_i
);
SET_EXPECT
(
global_setobj_i
);
parse_script_
a
(
"Option Explicit
\n
set test.setobj = testObj"
);
parse_script_
w
(
L
"Option Explicit
\n
set test.setobj = testObj"
);
CHECK_CALLED
(
global_setobj_i
);
hres
=
parse_script_
ar
(
"dim x
\n
x = testObj.rem"
);
hres
=
parse_script_
wr
(
L
"dim x
\n
x = testObj.rem"
);
ok
(
hres
==
S_OK
,
"use of 'rem' as dot identifier failed: %lx08
\n
"
,
hres
);
SET_EXPECT
(
testobj_propget_d
);
SET_EXPECT
(
testobj_propget_i
);
parse_script_
a
(
"dim x
\n
x = testObj.propget"
);
parse_script_
w
(
L
"dim x
\n
x = testObj.propget"
);
CHECK_CALLED
(
testobj_propget_d
);
CHECK_CALLED
(
testobj_propget_i
);
SET_EXPECT
(
testobj_propput_d
);
SET_EXPECT
(
testobj_propput_i
);
parse_script_
a
(
"testObj.propput = 1"
);
parse_script_
w
(
L
"testObj.propput = 1"
);
CHECK_CALLED
(
testobj_propput_d
);
CHECK_CALLED
(
testobj_propput_i
);
SET_EXPECT
(
global_propargput_d
);
SET_EXPECT
(
global_propargput_i
);
parse_script_
a
(
"propargput(counter(), counter()) = counter()"
);
parse_script_
w
(
L
"propargput(counter(), counter()) = counter()"
);
CHECK_CALLED
(
global_propargput_d
);
CHECK_CALLED
(
global_propargput_i
);
SET_EXPECT
(
global_propargput_d
);
SET_EXPECT
(
global_propargput_i
);
parse_script_
a
(
"test.propargput(counter(), counter()) = counter()"
);
parse_script_
w
(
L
"test.propargput(counter(), counter()) = counter()"
);
CHECK_CALLED
(
global_propargput_d
);
CHECK_CALLED
(
global_propargput_i
);
SET_EXPECT
(
global_propargput1_d
);
SET_EXPECT
(
global_propargput1_i
);
parse_script_
a
(
"propargput1 (counter()) = counter()"
);
parse_script_
w
(
L
"propargput1 (counter()) = counter()"
);
CHECK_CALLED
(
global_propargput1_d
);
CHECK_CALLED
(
global_propargput1_i
);
SET_EXPECT
(
global_propargput1_d
);
SET_EXPECT
(
global_propargput1_i
);
parse_script_
a
(
"test.propargput1(counter()) = counter()"
);
parse_script_
w
(
L
"test.propargput1(counter()) = counter()"
);
CHECK_CALLED
(
global_propargput1_d
);
CHECK_CALLED
(
global_propargput1_i
);
SET_EXPECT
(
global_propargset_d
);
SET_EXPECT
(
global_propargset_i
);
parse_script_
a
(
"set propargset (counter()) = testObj"
);
parse_script_
w
(
L
"set propargset (counter()) = testObj"
);
CHECK_CALLED
(
global_propargset_d
);
CHECK_CALLED
(
global_propargset_i
);
SET_EXPECT
(
testobj_propget_d
);
SET_EXPECT
(
testobj_propget_i
);
parse_script_
a
(
"dim x
\n
with testObj
\n
x=1+.propget
\n
end with"
);
parse_script_
w
(
L
"dim x
\n
with testObj
\n
x=1+.propget
\n
end with"
);
CHECK_CALLED
(
testobj_propget_d
);
CHECK_CALLED
(
testobj_propget_i
);
SET_EXPECT
(
testobj_propput_d
);
SET_EXPECT
(
testobj_propput_i
);
parse_script_
a
(
"with testObj
\n
.propput = 1
\n
end with"
);
parse_script_
w
(
L
"with testObj
\n
.propput = 1
\n
end with"
);
CHECK_CALLED
(
testobj_propput_d
);
CHECK_CALLED
(
testobj_propput_i
);
SET_EXPECT
(
testobj_valueput_i
);
parse_script_
a
(
"dim x
\n
"
parse_script_
w
(
L
"dim x
\n
"
"set x = testObj
\n
"
"x(counter(), counter()) = counter
\n
"
);
CHECK_CALLED
(
testobj_valueput_i
);
parse_script_
a
(
"dim x
\n
x = testObj.property(1)"
);
parse_script_
w
(
L
"dim x
\n
x = testObj.property(1)"
);
parse_htmlscript
_a
(
"<!--"
);
parse_htmlscript
_a
(
" -->"
);
parse_htmlscript
_a
(
"<!--
\n
dim x
\n
x=1
\n
-->
\n
"
);
parse_htmlscript
_a
(
"<!--
\n
dim x
\n
-->
\n
<!--
\n
x=1
\n
-->
\n
"
);
parse_htmlscript
(
L
"<!--"
);
parse_htmlscript
(
L
" -->"
);
parse_htmlscript
(
L
"<!--
\n
dim x
\n
x=1
\n
-->
\n
"
);
parse_htmlscript
(
L
"<!--
\n
dim x
\n
-->
\n
<!--
\n
x=1
\n
-->
\n
"
);
SET_EXPECT
(
OnScriptError
);
hres
=
parse_script_
ar
(
"<!--"
);
hres
=
parse_script_
wr
(
L
"<!--"
);
ok
(
FAILED
(
hres
),
"script didn't fail
\n
"
);
CHECK_CALLED
(
OnScriptError
);
SET_EXPECT
(
global_success_d
);
SET_EXPECT
(
global_success_i
);
parse_htmlscript
_a
(
"<!--
\n
<!-- ignore this <> <>
\n
--> <>
\n
Call reportSuccess()
\n
-->
\n
"
);
parse_htmlscript
(
L
"<!--
\n
<!-- ignore this <> <>
\n
--> <>
\n
Call reportSuccess()
\n
-->
\n
"
);
CHECK_CALLED
(
global_success_d
);
CHECK_CALLED
(
global_success_i
);
next_cnt
=
0
;
SET_EXPECT
(
collectionobj_newenum_i
);
SET_EXPECT
(
Next
);
parse_script_
a
(
"for each x in collectionObj
\n
next"
);
parse_script_
w
(
L
"for each x in collectionObj
\n
next"
);
CHECK_CALLED
(
collectionobj_newenum_i
);
CHECK_CALLED
(
Next
);
ok
(
next_cnt
==
4
,
"next_cnt = %d
\n
"
,
next_cnt
);
parse_script_
a
(
"x = 1
\n
Call ok(x = 1,
\"
x =
\"
& x)"
);
parse_script_
w
(
L
"x = 1
\n
Call ok(x = 1,
\"
x =
\"
& x)"
);
parse_script_
a
(
"x = _
\n
3"
);
parse_script_
w
(
L
"x = _
\n
3"
);
test_global_vars_ref
(
TRUE
);
test_global_vars_ref
(
FALSE
);
SET_EXPECT
(
OnScriptError
);
hres
=
parse_script_
ar
(
"throwInt(&h80080008&)"
);
hres
=
parse_script_
wr
(
L
"throwInt(&h80080008&)"
);
ok
(
hres
==
0x80080008
,
"hres = %08lx
\n
"
,
hres
);
CHECK_CALLED
(
OnScriptError
);
/* DISP_E_BADINDEX */
SET_EXPECT
(
OnScriptError
);
hres
=
parse_script_
ar
(
"throwInt(&h8002000b&)"
);
hres
=
parse_script_
wr
(
L
"throwInt(&h8002000b&)"
);
ok
(
hres
==
MAKE_VBSERROR
(
9
),
"hres = %08lx
\n
"
,
hres
);
CHECK_CALLED
(
OnScriptError
);
SET_EXPECT
(
OnScriptError
);
hres
=
parse_script_
ar
(
"throwInt(&h800a0009&)"
);
hres
=
parse_script_
wr
(
L
"throwInt(&h800a0009&)"
);
ok
(
hres
==
MAKE_VBSERROR
(
9
),
"hres = %08lx
\n
"
,
hres
);
CHECK_CALLED
(
OnScriptError
);
onerror_hres
=
S_OK
;
SET_EXPECT
(
OnScriptError
);
hres
=
parse_script_
ar
(
"throwInt(&h800a0009&)"
);
hres
=
parse_script_
wr
(
L
"throwInt(&h800a0009&)"
);
ok
(
hres
==
SCRIPT_E_REPORTED
,
"hres = %08lx
\n
"
,
hres
);
CHECK_CALLED
(
OnScriptError
);
/* E_NOTIMPL */
SET_EXPECT
(
OnScriptError
);
hres
=
parse_script_
ar
(
"throwInt(&h80004001&)"
);
hres
=
parse_script_
wr
(
L
"throwInt(&h80004001&)"
);
ok
(
hres
==
MAKE_VBSERROR
(
445
),
"hres = %08lx
\n
"
,
hres
);
CHECK_CALLED
(
OnScriptError
);
onerror_hres
=
S_OK
;
SET_EXPECT
(
OnScriptError
);
hres
=
parse_script_
ar
(
"throwInt(&h80004001&)"
);
hres
=
parse_script_
wr
(
L
"throwInt(&h80004001&)"
);
ok
(
hres
==
SCRIPT_E_REPORTED
,
"hres = %08lx
\n
"
,
hres
);
CHECK_CALLED
(
OnScriptError
);
SET_EXPECT
(
global_testoptionalarg_i
);
parse_script_
a
(
"call testOptionalArg(1,,2)"
);
parse_script_
w
(
L
"call testOptionalArg(1,,2)"
);
CHECK_CALLED
(
global_testoptionalarg_i
);
SET_EXPECT
(
global_testoptionalarg_i
);
parse_script_
a
(
"call testOptionalArg(,1,1)"
);
parse_script_
w
(
L
"call testOptionalArg(,1,1)"
);
CHECK_CALLED
(
global_testoptionalarg_i
);
SET_EXPECT
(
global_testoptionalarg_i
);
parse_script_
a
(
"testOptionalArg 1,,2"
);
parse_script_
w
(
L
"testOptionalArg 1,,2"
);
CHECK_CALLED
(
global_testoptionalarg_i
);
parse_script_
a
(
"sub x()
\n
"
parse_script_
w
(
L
"sub x()
\n
"
" dim y
\n
"
" y = cint(3)
\n
"
"end sub
\n
"
...
...
@@ -3387,32 +3387,32 @@ static void run_tests(void)
strict_dispid_check
=
FALSE
;
SET_EXPECT
(
testobj_value_i
);
parse_script_
a
(
"dim n,o
\n
set o = testObj
\n
n = o(1,2)
\n
call ok(n=2,
\"
n =
\"
& n)
\n
"
);
parse_script_
w
(
L
"dim n,o
\n
set o = testObj
\n
n = o(1,2)
\n
call ok(n=2,
\"
n =
\"
& n)
\n
"
);
CHECK_CALLED
(
testobj_value_i
);
SET_EXPECT
(
testobj_value_i
);
parse_script_
a
(
"dim n,o
\n
set o = testObj
\n
n = o
\n
call ok(n=0,
\"
n =
\"
& n)
\n
"
);
parse_script_
w
(
L
"dim n,o
\n
set o = testObj
\n
n = o
\n
call ok(n=0,
\"
n =
\"
& n)
\n
"
);
CHECK_CALLED
(
testobj_value_i
);
parse_script_
a
(
"Sub testsub
\n
"
parse_script_
w
(
L
"Sub testsub
\n
"
"x = 1
\n
"
"Call ok(x = 1,
\"
x =
\"
& x)
\n
"
"End Sub
\n
"
"Call testsub()"
);
parse_script_
a
(
"Call ok(getVT(x) =
\"
VT_EMPTY*
\"
,
\"
getVT(x) =
\"
& getVT(x))
\n
"
);
parse_script_
a
(
"Call ok(x =
\"\"
,
\"
x =
\"
& x)
\n
"
);
parse_script_
a
(
"x = y
\n
"
parse_script_
w
(
L
"Call ok(getVT(x) =
\"
VT_EMPTY*
\"
,
\"
getVT(x) =
\"
& getVT(x))
\n
"
);
parse_script_
w
(
L
"Call ok(x =
\"\"
,
\"
x =
\"
& x)
\n
"
);
parse_script_
w
(
L
"x = y
\n
"
"Call ok(getVT(x) =
\"
VT_EMPTY*
\"
,
\"
getVT(x) =
\"
& getVT(x))
\n
"
"Call ok(getVT(y) =
\"
VT_EMPTY*
\"
,
\"
getVT(y) =
\"
& getVT(y))"
);
SET_EXPECT
(
OnScriptError
);
hres
=
parse_script_
ar
(
"x = y(
\"
a
\"
)"
);
hres
=
parse_script_
wr
(
L
"x = y(
\"
a
\"
)"
);
ok
(
FAILED
(
hres
),
"script didn't fail
\n
"
);
CHECK_CALLED
(
OnScriptError
);
SET_EXPECT
(
global_success_d
);
SET_EXPECT
(
global_success_i
);
parse_script_
a
(
"' comment
\r
"
parse_script_
w
(
L
"' comment
\r
"
"x = _
\r
3
\r
"
"x = _
\n
3
\r
"
"x = _
\r\n
3
\r
"
...
...
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