Author: akhaldi
Date: Sat Apr 25 11:03:24 2015
New Revision: 67403
URL:
http://svn.reactos.org/svn/reactos?rev=67403&view=rev
Log:
[VBSCRIPT_WINETEST] Sync with Wine Staging 1.7.37. CORE-9246
Modified:
trunk/rostests/winetests/vbscript/api.vbs
trunk/rostests/winetests/vbscript/error.vbs
trunk/rostests/winetests/vbscript/lang.vbs
trunk/rostests/winetests/vbscript/run.c
Modified: trunk/rostests/winetests/vbscript/api.vbs
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/vbscript/api.vb…
==============================================================================
--- trunk/rostests/winetests/vbscript/api.vbs [iso-8859-1] (original)
+++ trunk/rostests/winetests/vbscript/api.vbs [iso-8859-1] Sat Apr 25 11:03:24 2015
@@ -242,6 +242,7 @@
x = InStr("abcd", "bc")
Call ok(x = 2, "InStr returned " & x)
+Call ok(getVT(x) = "VT_I4*", "getVT(InStr) returned " &
getVT(x))
x = InStr("abc", "bc")
Call ok(x = 2, "InStr returned " & x)
@@ -280,6 +281,64 @@
x = InStr(2.6, "abcd", "bc")
Call ok(x = 0, "InStr returned " & x)
+
+
+x = InStrRev("bcabcd", "bc")
+Call ok(x = 4, "InStrRev returned " & x)
+Call ok(getVT(x) = "VT_I4*", "getVT(InStrRev) returned " &
getVT(x))
+
+x = InStrRev("bcabcd", "bc", 6)
+Call ok(x = 4, "InStrRev returned " & x)
+
+x = InStrRev("abcd", "bcx")
+Call ok(x = 0, "InStrRev returned " & x)
+
+x = InStrRev("abcd", "bc", 3)
+Call ok(x = 2, "InStrRev returned " & x)
+
+x = InStrRev("abcd", "bc", 2)
+Call ok(x = 0, "InStrRev returned " & x)
+
+x = InStrRev("abcd", "b", 2)
+Call ok(x = 2, "InStrRev returned " & x)
+
+x = InStrRev("abcd", "bc", 5)
+Call ok(x = 0, "InStrRev returned " & x)
+
+x = InStrRev("abcd", "bc", 15)
+Call ok(x = 0, "InStrRev returned " & x)
+
+x = "abcd"
+x = InStrRev(x, "bc")
+Call ok(x = 2, "InStrRev returned " & x)
+
+x = InStrRev("abcd", "bc", 1.3)
+Call ok(x = 0, "InStrRev returned " & x)
+
+x = InStrRev("abcd", "bc", 2.3)
+Call ok(x = 0, "InStrRev returned " & x)
+
+x = InStrRev("abcd", "bc", 2.6)
+Call ok(x = 2, "InStrRev returned " & x)
+
+x = InStrRev("1234", 34)
+Call ok(x = 3, "InStrRev returned " & x)
+
+x = InStrRev(1234, 34)
+Call ok(x = 3, "InStrRev returned " & x)
+
+Sub testInStrRevError(arg1, arg2, arg3, error_num)
+ on error resume next
+ Dim x
+
+ Call Err.clear()
+ x = InStrRev(arg1, arg2, arg3)
+ Call ok(Err.number = error_num, "Err.number = " & Err.number)
+End Sub
+
+call testInStrRevError("abcd", null, 2, 94)
+call testInStrRevError(null, "abcd", 2, 94)
+call testInStrRevError("abcd", "abcd", null, 94)
Sub TestMid(str, start, len, ex)
x = Mid(str, start, len)
@@ -335,6 +394,7 @@
Call ok(Len(1) = 1, "Len(1) = " & Len(1))
Call ok(isNull(Len(null)), "Len(null) = " & Len(null))
Call ok(Len(empty) = 0, "Len(empty) = " & Len(empty))
+Call ok(getVT(Len("abc")) = "VT_I4", "getVT(Len(abc)) = "
& getVT(Len("abc")))
Call ok(Space(1) = " ", "Space(1) = " & Space(1) &
"""")
Call ok(Space(0) = "", "Space(0) = " & Space(0) &
"""")
@@ -1240,4 +1300,28 @@
Call ok(getVT(Date) = "VT_DATE", "getVT(Date) = " & getVT(Date))
Call ok(getVT(Time) = "VT_DATE", "getVT(Time) = " & getVT(Time))
+Sub testRGBError(arg1, arg2, arg3, error_num)
+ on error resume next
+ Dim x
+
+ Call Err.clear()
+ x = RGB(arg1, arg2, arg3)
+ Call ok(Err.number = error_num, "Err.number1 = " & Err.number)
+
+ Call Err.clear()
+ Call RGB(arg1, arg2, arg3)
+ Call ok(Err.number = error_num, "Err.number2 = " & Err.number)
+End Sub
+
+Call ok(RGB(0, &h1f&, &hf1&) = &hf11f00&, "RGB(0,
&h1f&, &hf1&) = " & RGB(0, &h1f&, &hf1&))
+Call ok(getVT(RGB(0, &h1f&, &hf1&)) = "VT_I4",
"getVT(RGB(&hf1&, &h1f&, &hf1&)) = " &
getVT(RGB(&hf1&, &h1f&, &hf1&)))
+Call ok(RGB(&hef&, &hab&, &hcd&) = &hcdabef&,
"RGB(&hef&, &hab&, &hcd&) = " & RGB(&hef&,
&hab&, &hcd&))
+Call ok(getVT(RGB(&hef&, &hab&, &hcd&)) = "VT_I4",
"getVT(RGB(&hef&, &hab&, &hcd&)) = " &
getVT(RGB(&hef&, &hab&, &hcd&)))
+Call ok(RGB(&h1&, &h100&, &h111&) = &hffff01&,
"RGB(&h1&, &h100&, &h111&) = " & RGB(&h1&,
&h100&, &h111&))
+Call ok(getVT(RGB(&h1&, &h100&, &h111&)) = "VT_I4",
"getVT(RGB(&h1&, &h100&, &h111&)) = " &
getVT(RGB(&h1&, &h100&, &h111&)))
+Call testRGBError(-1, &h1e&, &h3b&, 5)
+Call testRGBError(&h4d&, -2, &h2f&, 5)
+
+Call ok(getVT(Timer) = "VT_R4", "getVT(Timer) = " &
getVT(Timer))
+
Call reportSuccess()
Modified: trunk/rostests/winetests/vbscript/error.vbs
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/vbscript/error.…
==============================================================================
--- trunk/rostests/winetests/vbscript/error.vbs [iso-8859-1] (original)
+++ trunk/rostests/winetests/vbscript/error.vbs [iso-8859-1] Sat Apr 25 11:03:24 2015
@@ -75,6 +75,7 @@
const CO_E_SERVER_EXEC_FAILURE = &h80080005&
call ok(Err.Number = 0, "Err.Number = " & Err.Number)
+call ok(getVT(Err.Number) = "VT_I4", "getVT(Err.Number) = " &
getVT(Err.Number))
dim calledFunc
Modified: trunk/rostests/winetests/vbscript/lang.vbs
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/vbscript/lang.v…
==============================================================================
--- trunk/rostests/winetests/vbscript/lang.vbs [iso-8859-1] (original)
+++ trunk/rostests/winetests/vbscript/lang.vbs [iso-8859-1] Sat Apr 25 11:03:24 2015
@@ -234,6 +234,7 @@
if false then x = y : if true then call ok(false, "embedded if called")
if false then x=1 else x=2 end if
+if true then x=1 end if
x = false
if false then x = true : x = true
Modified: trunk/rostests/winetests/vbscript/run.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/vbscript/run.c?…
==============================================================================
--- trunk/rostests/winetests/vbscript/run.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/vbscript/run.c [iso-8859-1] Sat Apr 25 11:03:24 2015
@@ -99,6 +99,7 @@
DEFINE_EXPECT(global_propargput_i);
DEFINE_EXPECT(global_propargput1_d);
DEFINE_EXPECT(global_propargput1_i);
+DEFINE_EXPECT(global_testoptionalarg_i);
DEFINE_EXPECT(collectionobj_newenum_i);
DEFINE_EXPECT(Next);
DEFINE_EXPECT(GetWindow);
@@ -122,6 +123,7 @@
#define DISPID_GLOBAL_DOUBLEASSTRING 1014
#define DISPID_GLOBAL_TESTARRAY 1015
#define DISPID_GLOBAL_THROWINT 1016
+#define DISPID_GLOBAL_TESTOPTIONALARG 1017
#define DISPID_TESTOBJ_PROPGET 2000
#define DISPID_TESTOBJ_PROPPUT 2001
@@ -1014,6 +1016,11 @@
*pid = DISPID_GLOBAL_THROWINT;
return S_OK;
}
+ if(!strcmp_wa(bstrName, "testOptionalArg")) {
+ test_grfdex(grfdex, fdexNameCaseInsensitive);
+ *pid = DISPID_GLOBAL_TESTOPTIONALARG;
+ return S_OK;
+ }
if(strict_dispid_check && strcmp_wa(bstrName, "x"))
ok(0, "unexpected call %s %x\n", wine_dbgstr_w(bstrName), grfdex);
@@ -1051,7 +1058,7 @@
return S_OK;
}
- case DISPID_GLOBAL_TRACE:
+ case DISPID_GLOBAL_TRACE:
ok(wFlags == INVOKE_FUNC, "wFlags = %x\n", wFlags);
ok(pdp != NULL, "pdp == NULL\n");
ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
@@ -1326,6 +1333,30 @@
}
return hres;
+ }
+
+ case DISPID_GLOBAL_TESTOPTIONALARG: {
+ VARIANT *v;
+ int opt;
+
+ CHECK_EXPECT(global_testoptionalarg_i);
+
+ 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 == 3, "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) == VT_I2, "V_VT(pdp->rgvarg) = %d\n",
V_VT(pdp->rgvarg));
+ opt = V_I2(pdp->rgvarg);
+ ok(opt == 1 || opt == 2, "opt = %d\n", opt);
+ v = pdp->rgvarg+pdp->cArgs-opt;
+ ok(V_VT(v) == VT_ERROR, "V_VT(v) = %d\n", V_VT(v));
+ ok(V_ERROR(v) == DISP_E_PARAMNOTFOUND, "V_ERROR(v) = %08x\n",
V_ERROR(v));
+ return S_OK;
}
}
@@ -2082,6 +2113,18 @@
hres = parse_script_ar("throwInt(&h80004001&)");
ok(hres == MAKE_VBSERROR(445), "hres = %08x\n", hres);
+ SET_EXPECT(global_testoptionalarg_i);
+ parse_script_a("call testOptionalArg(1,,2)");
+ CHECK_CALLED(global_testoptionalarg_i);
+
+ SET_EXPECT(global_testoptionalarg_i);
+ parse_script_a("call testOptionalArg(,1,1)");
+ CHECK_CALLED(global_testoptionalarg_i);
+
+ SET_EXPECT(global_testoptionalarg_i);
+ parse_script_a("testOptionalArg 1,,2");
+ CHECK_CALLED(global_testoptionalarg_i);
+
strict_dispid_check = FALSE;
SET_EXPECT(testobj_value_i);