Jacek Caban : vbscript/tests: Add more call tests.
Alexandre Julliard
julliard at winehq.org
Mon Oct 28 16:43:37 CDT 2019
Module: wine
Branch: master
Commit: 273a3a586915e6de6e2fcd64bec1751fdde92e8c
URL: https://source.winehq.org/git/wine.git/?a=commit;h=273a3a586915e6de6e2fcd64bec1751fdde92e8c
Author: Jacek Caban <jacek at codeweavers.com>
Date: Mon Oct 28 18:40:47 2019 +0100
vbscript/tests: Add more call tests.
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/vbscript/tests/lang.vbs | 76 ++++++++++++++++++++++++++++++++++++++++++++
dlls/vbscript/tests/run.c | 5 ++-
2 files changed, 80 insertions(+), 1 deletion(-)
diff --git a/dlls/vbscript/tests/lang.vbs b/dlls/vbscript/tests/lang.vbs
index ef31004cc4..334de7aa0e 100644
--- a/dlls/vbscript/tests/lang.vbs
+++ b/dlls/vbscript/tests/lang.vbs
@@ -1246,6 +1246,59 @@ next
x=1
Call ok(forarr(x) = 2, "forarr(x) = " & forarr(x))
+sub accessArr()
+ ok arr(1) = 1, "arr(1) = " & arr(1)
+ arr(1) = 2
+end sub
+arr(1) = 1
+call accessArr
+ok arr(1) = 2, "arr(1) = " & arr(1)
+
+sub accessArr2(x,y)
+ ok arr2(x,y) = 1, "arr2(x,y) = " & arr2(x,y)
+ x = arr2(x,y)
+ arr2(x,y) = 2
+end sub
+arr2(1,2) = 1
+call accessArr2(1, 2)
+ok arr2(1,2) = 2, "arr2(1,2) = " & arr2(1,2)
+
+x = Array(Array(3))
+call ok(x(0)(0) = 3, "x(0)(0) = " & x(0)(0))
+
+function seta0(arr)
+ arr(0) = 2
+ seta0 = 1
+end function
+
+x = Array(1)
+seta0 x
+ok x(0) = 2, "x(0) = " & x(0)
+
+x = Array(1)
+seta0 (x)
+todo_wine_ok x(0) = 1, "x(0) = " & x(0)
+
+x = Array(Array(3))
+seta0 x(0)
+call ok(x(0)(0) = 2, "x(0)(0) = " & x(0)(0))
+
+x = Array(Array(3))
+seta0 (x(0))
+call todo_wine_ok(x(0)(0) = 3, "x(0)(0) = " & x(0)(0))
+
+sub changearg(x)
+ x = 2
+end sub
+
+x = Array(1)
+changearg x(0)
+ok x(0) = 2, "x(0) = " & x(0)
+
+x = Array(1)
+changearg (x(0))
+todo_wine_ok x(0) = 1, "x(0) = " & x(0)
+
Class ArrClass
Dim classarr(3)
Dim classnoarr()
@@ -1478,4 +1531,27 @@ Class EndTestClassWithProperty
Public default Property Get defprop
defprop = x End Property End Class
+class TestPropSyntax
+ public prop
+
+ function getProp()
+ set getProp = prop
+ end function
+
+ public default property get def()
+ def = ""
+ end property
+end class
+
+set x = new TestPropSyntax
+set x.prop = new TestPropSyntax
+set x.prop.prop = new TestPropSyntax
+x.prop.prop.prop = 2
+call ok(x.getProp().getProp.prop = 2, "x.getProp().getProp.prop = " & x.getProp().getProp.prop)
+x.getprop.getprop().prop = 3
+call ok(x.getProp.prop.prop = 3, "x.getProp.prop.prop = " & x.getProp.prop.prop)
+
+ok getVT(x) = "VT_DISPATCH*", "getVT(x) = " & getVT(x)
+todo_wine_ok getVT(x()) = "VT_BSTR", "getVT(x()) = " & getVT(x())
+
reportSuccess()
diff --git a/dlls/vbscript/tests/run.c b/dlls/vbscript/tests/run.c
index 2d34a8c80f..2c0ccdd25b 100644
--- a/dlls/vbscript/tests/run.c
+++ b/dlls/vbscript/tests/run.c
@@ -2467,7 +2467,10 @@ static void test_parse_errors(void)
"Call ok(x, \"wrong case\")\n",
/* Class...End Class (empty) */
- "Class C End Class"
+ "Class C End Class",
+
+ /* invalid use of parentheses for call statement */
+ "strcomp(\"x\", \"y\")"
};
HRESULT hres;
UINT i;
More information about the wine-cvs
mailing list