Piotr Caban : jscript: Improved VBArray related tests.
Alexandre Julliard
julliard at winehq.org
Tue Oct 19 13:03:48 CDT 2010
Module: wine
Branch: master
Commit: dcdc6c7013906f555e8c860ab64497e7590f94c9
URL: http://source.winehq.org/git/wine.git/?a=commit;h=dcdc6c7013906f555e8c860ab64497e7590f94c9
Author: Piotr Caban <piotr at codeweavers.com>
Date: Tue Oct 19 14:00:14 2010 +0200
jscript: Improved VBArray related tests.
---
dlls/jscript/tests/api.js | 14 +++++++++-----
dlls/jscript/tests/run.c | 3 +++
2 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/dlls/jscript/tests/api.js b/dlls/jscript/tests/api.js
index 1334f7e..6d88b53 100644
--- a/dlls/jscript/tests/api.js
+++ b/dlls/jscript/tests/api.js
@@ -149,8 +149,8 @@ tmp = Object.prototype.toString.call(this);
ok(tmp === "[object Object]", "toString.call(this) = " + tmp);
(function () { tmp = Object.prototype.toString.call(arguments); })();
ok(tmp === "[object Object]", "toString.call(arguments) = " + tmp);
-(tmp = new VBArray(createArray())).f = Object.prototype.toString;
-ok(tmp.f() === "[object Object]", "tmp.f() = " + tmp.f());
+tmp = Object.prototype.toString.call(new VBArray(createArray()));
+ok(tmp === "[object Object]", "toString.call(new VBArray()) = " + tmp);
ok(Object(1) instanceof Number, "Object(1) is not instance of Number");
ok(Object("") instanceof String, "Object('') is not instance of String");
@@ -1903,8 +1903,7 @@ exception_test(function() {new VBArray();}, "TypeError", -2146823275);
exception_test(function() {new VBArray(new VBArray(createArray()));}, "TypeError", -2146823275);
exception_test(function() {createArray().lbound("aaa");}, "RangeError", -2146828279);
exception_test(function() {createArray().lbound(3);}, "RangeError", -2146828279);
-exception_test(function() {tmp = new Object(); tmp.lb = VBArray.prototype.lbound; tmp.lb();}, "TypeError", -2146823275);
-exception_test(function() {tmp = new Object(); tmp.lb = VBArray.prototype.lbound; tmp.lb();}, "TypeError", -2146823275);
+exception_test(function() {VBArray.prototype.lbound.call(new Object());}, "TypeError", -2146823275);
exception_test(function() {createArray().getItem(3);}, "RangeError", -2146828279);
function testThisExcept(func, number) {
@@ -2253,7 +2252,10 @@ ok(unescape.length == 1, "unescape.length = " + unescape.length);
String.length = 3;
ok(String.length == 1, "String.length = " + String.length);
-var tmp = new VBArray(createArray());
+var tmp = createArray();
+ok(getVT(tmp) == "VT_ARRAY|VT_VARIANT", "getVT(createArray()) = " + getVT(tmp));
+ok(getVT(VBArray(tmp)) == "VT_ARRAY|VT_VARIANT", "getVT(VBArray(tmp)) = " + getVT(VBArray(tmp)));
+tmp = new VBArray(tmp);
tmp = new VBArray(VBArray(createArray()));
ok(tmp.dimensions() == 2, "tmp.dimensions() = " + tmp.dimensions());
ok(tmp.lbound() == 0, "tmp.lbound() = " + tmp.lbound());
@@ -2265,5 +2267,7 @@ ok(tmp.getItem(1, 2) == 3, "tmp.getItem(1, 2) = " + tmp.getItem(1, 2));
ok(tmp.getItem(2, 3) == 33, "tmp.getItem(2, 3) = " + tmp.getItem(2, 3));
ok(tmp.getItem(3, 2) == 13, "tmp.getItem(3, 2) = " + tmp.getItem(3, 2));
ok(tmp.toArray() == "2,3,12,13,22,23,32,33,42,43", "tmp.toArray() = " + tmp.toArray());
+ok(createArray().toArray() == "2,3,12,13,22,23,32,33,42,43",
+ "createArray.toArray()=" + createArray().toArray());
reportSuccess();
diff --git a/dlls/jscript/tests/run.c b/dlls/jscript/tests/run.c
index 9bca966..5c1a9f6 100644
--- a/dlls/jscript/tests/run.c
+++ b/dlls/jscript/tests/run.c
@@ -487,6 +487,9 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid,
case VT_BOOL:
V_BSTR(pvarRes) = a2bstr("VT_BOOL");
break;
+ case VT_ARRAY|VT_VARIANT:
+ V_BSTR(pvarRes) = a2bstr("VT_ARRAY|VT_VARIANT");
+ break;
default:
ok(0, "unknown vt %d\n", V_VT(pdp->rgvarg));
return E_FAIL;
More information about the wine-cvs
mailing list