From fa6326df886b8c6b3c9d4142cd8d894ac6c7dbf5 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Thu, 17 Nov 2016 23:16:08 +0000 Subject: [PATCH] [VBSCRIPT_WINETEST] Sync with Wine Staging 1.9.23. CORE-12409 svn path=/trunk/; revision=73299 --- rostests/winetests/vbscript/api.vbs | 29 +++++++++++++++++++++++++++++ rostests/winetests/vbscript/run.c | 6 ++++++ 2 files changed, 35 insertions(+) diff --git a/rostests/winetests/vbscript/api.vbs b/rostests/winetests/vbscript/api.vbs index 2a365c7588d..f6b6f69420e 100644 --- a/rostests/winetests/vbscript/api.vbs +++ b/rostests/winetests/vbscript/api.vbs @@ -440,6 +440,35 @@ TestLCase 0.123, doubleAsString(0.123) TestLCase Empty, "" Call ok(getVT(LCase(Null)) = "VT_NULL", "getVT(LCase(Null)) = " & getVT(LCase(Null))) +Sub TestStrComp(str_left, str_right, mode, ex) + x = StrComp(str_left, str_right, mode) + Call ok(x = ex, "StrComp(" & str_left & ", " & str_right & ", " & mode & ") = " & x & " expected " & ex) +End Sub + +TestStrComp "ABC", "abc", 0, -1 +TestStrComp "abc", "ABC", 0, 1 +TestStrComp "ABC", "ABC", 0, 0 +TestStrComp "ABC", "abc", 0, -1 +TestStrComp "abc", "ABC", 0, 1 +TestStrComp "ABC", "ABC", 0, 0 +TestStrComp "ABCD", "ABC", 0, 1 +TestStrComp "ABC", "ABCD", 0, -1 +TestStrComp "ABC", "abc", 1, 0 +TestStrComp "ABC", "ABC", 1, 0 +TestStrComp "ABCD", "ABC", 1, 1 +TestStrComp "ABC", "ABCD", 1, -1 +TestStrComp "ABC", "ABCD", "0", -1 +TestStrComp "ABC", "ABCD", "1", -1 +TestStrComp 1, 1, 1, 0 +TestStrComp "1", 1, 1, 0 +TestStrComp "1", 1.0, 1, 0 +TestStrComp Empty, Empty, 1, 0 +TestStrComp Empty, "", 1, 0 +TestStrComp Empty, "ABC", 1, -1 +TestStrComp "ABC", Empty, 1, 1 +TestStrComp vbNull, vbNull, 1, 0 +TestStrComp "", vbNull, 1, -1 + Call ok(Len("abc") = 3, "Len(abc) = " & Len("abc")) Call ok(Len("") = 0, "Len() = " & Len("")) Call ok(Len(1) = 1, "Len(1) = " & Len(1)) diff --git a/rostests/winetests/vbscript/run.c b/rostests/winetests/vbscript/run.c index fa111c0b1b3..8821b796db1 100644 --- a/rostests/winetests/vbscript/run.c +++ b/rostests/winetests/vbscript/run.c @@ -2133,6 +2133,12 @@ static void run_tests(void) 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()"); + 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\nvbvar = 3"); -- 2.17.1