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
ff3d22ba
Commit
ff3d22ba
authored
Nov 13, 2013
by
Jacek Caban
Committed by
Alexandre Julliard
Nov 13, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Added some array tests.
parent
7917b67a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
118 additions
and
0 deletions
+118
-0
lang.vbs
dlls/vbscript/tests/lang.vbs
+70
-0
run.c
dlls/vbscript/tests/run.c
+48
-0
No files found.
dlls/vbscript/tests/lang.vbs
View file @
ff3d22ba
...
...
@@ -972,4 +972,74 @@ Class Property2
End
Sub
End
Class
' Array tests
Call
ok
(
getVT
(
arr
)
=
"VT_EMPTY*"
,
"getVT(arr) = "
&
getVT
(
arr
))
Dim
arr
(
3
)
Dim
arr2
(
4
,
3
),
arr3
(
5
,
4
,
3
),
arr0
(
0
),
noarr
()
Call
ok
(
getVT
(
arr
)
=
"VT_ARRAY|VT_BYREF|VT_VARIANT*"
,
"getVT(arr) = "
&
getVT
(
arr
))
Call
ok
(
getVT
(
arr2
)
=
"VT_ARRAY|VT_BYREF|VT_VARIANT*"
,
"getVT(arr2) = "
&
getVT
(
arr2
))
Call
ok
(
getVT
(
arr0
)
=
"VT_ARRAY|VT_BYREF|VT_VARIANT*"
,
"getVT(arr0) = "
&
getVT
(
arr0
))
Call
ok
(
getVT
(
noarr
)
=
"VT_ARRAY|VT_BYREF|VT_VARIANT*"
,
"getVT(noarr) = "
&
getVT
(
noarr
))
Call
testArray
(
1
,
arr
)
Call
testArray
(
2
,
arr2
)
Call
testArray
(
3
,
arr3
)
Call
testArray
(
0
,
arr0
)
Call
testArray
(
-
1
,
noarr
)
Call
ok
(
getVT
(
arr
(
1
))
=
"VT_EMPTY*"
,
"getVT(arr(1)) = "
&
getVT
(
arr
(
1
)))
Call
ok
(
getVT
(
arr2
(
1
,
2
))
=
"VT_EMPTY*"
,
"getVT(arr2(1,2)) = "
&
getVT
(
arr2
(
1
,
2
)))
Call
ok
(
getVT
(
arr3
(
1
,
2
,
2
))
=
"VT_EMPTY*"
,
"getVT(arr3(1,2,3)) = "
&
getVT
(
arr3
(
1
,
2
,
2
)))
Call
ok
(
getVT
(
arr
(
0
))
=
"VT_EMPTY*"
,
"getVT(arr(0)) = "
&
getVT
(
arr
(
0
)))
Call
ok
(
getVT
(
arr
(
3
))
=
"VT_EMPTY*"
,
"getVT(arr(3)) = "
&
getVT
(
arr
(
3
)))
Call
ok
(
getVT
(
arr0
(
0
))
=
"VT_EMPTY*"
,
"getVT(arr0(0)) = "
&
getVT
(
arr0
(
0
)))
arr
(
2
)
=
3
Call
ok
(
arr
(
2
)
=
3
,
"arr(2) = "
&
arr
(
2
))
Call
ok
(
getVT
(
arr
(
2
))
=
"VT_I2*"
,
"getVT(arr(2)) = "
&
getVT
(
arr
(
2
)))
arr3
(
3
,
2
,
1
)
=
1
arr3
(
1
,
2
,
3
)
=
2
Call
ok
(
arr3
(
3
,
2
,
1
)
=
1
,
"arr3(3,2,1) = "
&
arr3
(
3
,
2
,
1
))
Call
ok
(
arr3
(
1
,
2
,
3
)
=
2
,
"arr3(1,2,3) = "
&
arr3
(
1
,
2
,
3
))
x
=
arr3
Call
ok
(
x
(
3
,
2
,
1
)
=
1
,
"x(3,2,1) = "
&
x
(
3
,
2
,
1
))
Function
getarr
()
Dim
arr
(
3
)
arr
(
2
)
=
2
getarr
=
arr
arr
(
3
)
=
3
End
Function
x
=
getarr
()
Call
ok
(
getVT
(
x
)
=
"VT_ARRAY|VT_VARIANT*"
,
"getVT(x) = "
&
getVT
(
x
))
Call
ok
(
x
(
2
)
=
2
,
"x(2) = "
&
x
(
2
))
Call
ok
(
getVT
(
x
(
3
))
=
"VT_EMPTY*"
,
"getVT(x(3)) = "
&
getVT
(
x
(
3
)))
x
(
1
)
=
1
Call
ok
(
x
(
1
)
=
1
,
"x(1) = "
&
x
(
1
))
x
=
getarr
()
Call
ok
(
getVT
(
x
(
1
))
=
"VT_EMPTY*"
,
"getVT(x(1)) = "
&
getVT
(
x
(
1
)))
Call
ok
(
x
(
2
)
=
2
,
"x(2) = "
&
x
(
2
))
x
(
1
)
=
1
y
=
x
x
(
1
)
=
2
Call
ok
(
y
(
1
)
=
1
,
"y(1) = "
&
y
(
1
))
for
x
=
1
to
1
Dim
forarr
(
3
)
if
x
=
1
then
Call
ok
(
getVT
(
forarr
(
1
))
=
"VT_EMPTY*"
,
"getVT(forarr(1)) = "
&
getVT
(
forarr
(
1
)))
else
Call
ok
(
forarr
(
1
)
=
x
,
"forarr(1) = "
&
forarr
(
1
))
end
if
forarr
(
1
)
=
x
+
1
next
reportSuccess
()
dlls/vbscript/tests/run.c
View file @
ff3d22ba
...
...
@@ -112,6 +112,7 @@ DEFINE_EXPECT(EnableModeless);
#define DISPID_GLOBAL_PROPARGPUT1 1012
#define DISPID_GLOBAL_COLLOBJ 1013
#define DISPID_GLOBAL_DOUBLEASSTRING 1014
#define DISPID_GLOBAL_TESTARRAY 1015
#define DISPID_TESTOBJ_PROPGET 2000
#define DISPID_TESTOBJ_PROPPUT 2001
...
...
@@ -186,6 +187,8 @@ static const char *vt2a(VARIANT *v)
return
"VT_BOOL"
;
case
VT_ARRAY
|
VT_VARIANT
:
return
"VT_ARRAY|VT_VARIANT"
;
case
VT_ARRAY
|
VT_BYREF
|
VT_VARIANT
:
return
"VT_ARRAY|VT_BYREF|VT_VARIANT"
;
default:
ok
(
0
,
"unknown vt %d
\n
"
,
V_VT
(
v
));
return
NULL
;
...
...
@@ -439,6 +442,26 @@ static void test_disp(IDispatch *disp)
IDispatchEx_Release
(
dispex
);
}
static
void
test_safearray
(
SAFEARRAY
*
safearray
,
unsigned
indims
)
{
int
i
,
exdims
=
indims
;
if
(
!
exdims
)
exdims
=
1
;
ok
(
safearray
->
cDims
==
exdims
,
"safearray->cDims = %d, expected %d
\n
"
,
safearray
->
cDims
,
exdims
);
todo_wine
ok
(
safearray
->
fFeatures
==
(
FADF_VARIANT
|
FADF_HAVEVARTYPE
|
FADF_FIXEDSIZE
|
FADF_STATIC
),
"safearray->fFeatures = %x
\n
"
,
safearray
->
fFeatures
);
ok
(
safearray
->
cbElements
==
sizeof
(
VARIANT
),
"safearray->cbElements = %x
\n
"
,
safearray
->
cbElements
);
ok
(
!
safearray
->
cLocks
,
"safearray->cLocks = %x
\n
"
,
safearray
->
cLocks
);
for
(
i
=
0
;
i
<
safearray
->
cDims
;
i
++
)
{
ok
(
safearray
->
rgsabound
[
i
].
cElements
==
indims
?
i
+
4
:
1
,
"safearray->rgsabound[%d].cElements = %d
\n
"
,
i
,
safearray
->
rgsabound
[
i
].
cElements
);
ok
(
!
safearray
->
rgsabound
[
i
].
lLbound
,
"safearray->rgsabound[%d].lLbound = %d
\n
"
,
i
,
safearray
->
rgsabound
[
i
].
lLbound
);
}
}
#define test_grfdex(a,b) _test_grfdex(__LINE__,a,b)
static
void
_test_grfdex
(
unsigned
line
,
DWORD
grfdex
,
DWORD
expect
)
{
...
...
@@ -906,6 +929,11 @@ static HRESULT WINAPI Global_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD
*
pid
=
DISPID_GLOBAL_DOUBLEASSTRING
;
return
S_OK
;
}
if
(
!
strcmp_wa
(
bstrName
,
"testArray"
))
{
test_grfdex
(
grfdex
,
fdexNameCaseInsensitive
);
*
pid
=
DISPID_GLOBAL_TESTARRAY
;
return
S_OK
;
}
if
(
strict_dispid_check
&&
strcmp_wa
(
bstrName
,
"x"
))
ok
(
0
,
"unexpected call %s %x
\n
"
,
wine_dbgstr_w
(
bstrName
),
grfdex
);
...
...
@@ -1164,6 +1192,26 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid,
V_VT
(
pvarRes
)
=
VT_BSTR
;
return
VarBstrFromR8
(
V_R8
(
pdp
->
rgvarg
),
0
,
0
,
&
V_BSTR
(
pvarRes
));
case
DISPID_GLOBAL_TESTARRAY
:
ok
(
wFlags
==
INVOKE_FUNC
,
"wFlags = %x
\n
"
,
wFlags
);
ok
(
pdp
!=
NULL
,
"pdp == NULL
\n
"
);
ok
(
pdp
->
rgvarg
!=
NULL
,
"rgvarg == NULL
\n
"
);
ok
(
!
pdp
->
rgdispidNamedArgs
,
"rgdispidNamedArgs != NULL
\n
"
);
ok
(
pdp
->
cArgs
==
2
,
"cArgs = %d
\n
"
,
pdp
->
cArgs
);
ok
(
!
pdp
->
cNamedArgs
,
"cNamedArgs = %d
\n
"
,
pdp
->
cNamedArgs
);
ok
(
!
pvarRes
,
"pvarRes != NULL
\n
"
);
ok
(
pei
!=
NULL
,
"pei == NULL
\n
"
);
ok
(
V_VT
(
pdp
->
rgvarg
+
1
)
==
VT_I2
,
"V_VT(psp->rgvargs+1) = %d
\n
"
,
V_VT
(
pdp
->
rgvarg
+
1
));
ok
(
V_VT
(
pdp
->
rgvarg
)
==
(
VT_BYREF
|
VT_VARIANT
),
"V_VT(psp->rgvargs) = %d
\n
"
,
V_VT
(
pdp
->
rgvarg
));
ok
(
V_VT
(
V_VARIANTREF
(
pdp
->
rgvarg
))
==
(
VT_ARRAY
|
VT_BYREF
|
VT_VARIANT
),
"V_VT(V_VARIANTREF(psp->rgvargs)) = %d
\n
"
,
V_VT
(
V_VARIANTREF
(
pdp
->
rgvarg
)));
if
(
V_I2
(
pdp
->
rgvarg
+
1
)
==
-
1
)
ok
(
!*
V_ARRAYREF
(
V_VARIANTREF
(
pdp
->
rgvarg
)),
"*V_ARRAYREF(V_VARIANTREF(pdp->rgvarg)) != NULL
\n
"
);
else
test_safearray
(
*
V_ARRAYREF
(
V_VARIANTREF
(
pdp
->
rgvarg
)),
V_I2
(
pdp
->
rgvarg
+
1
));
return
S_OK
;
}
ok
(
0
,
"unexpected call %d
\n
"
,
id
);
...
...
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