Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com ---
Supersedes 169498. Please apply after 169497 for the test results. They are clean, see https://testbot.winehq.org/JobDetails.pl?Key=56309
dlls/vbscript/tests/lang.vbs | 28 ++++++++++++++++++ dlls/vbscript/tests/run.c | 57 ++++++++++++++++++++++++++++++++++++ 2 files changed, 85 insertions(+)
diff --git a/dlls/vbscript/tests/lang.vbs b/dlls/vbscript/tests/lang.vbs index 6b45865..5d9fb80 100644 --- a/dlls/vbscript/tests/lang.vbs +++ b/dlls/vbscript/tests/lang.vbs @@ -1429,4 +1429,32 @@ sub test_dotIdentifiers end sub call test_dotIdentifiers
+' Test End statements not required to be preceeded by a newline or separator +Sub EndTestSub + x = 1 End Sub + +Sub EndTestSubWithCall + x = 1 + Call ok(x = 1, "x = " & x)End Sub +Call EndTestSubWithCall() + +Function EndTestFunc(x) + Call ok(x > 0, "x = " & x)End Function +EndTestFunc(1) + +Class EndTestClassWithStorageId + Public x End Class + +Class EndTestClassWithDim + Dim x End Class + +Class EndTestClassWithFunc + Function test(ByVal x) + x = 0 End Function End Class + +Class EndTestClassWithProperty + Public x + Public default Property Get defprop + defprop = x End Property End Class + reportSuccess() diff --git a/dlls/vbscript/tests/run.c b/dlls/vbscript/tests/run.c index 15a8f10..f10a42b 100644 --- a/dlls/vbscript/tests/run.c +++ b/dlls/vbscript/tests/run.c @@ -2077,6 +2077,62 @@ static void test_gc(void) IActiveScriptParse_Release(parser); }
+static void test_parse_errors(void) +{ + static const char *invalid_scripts[] = + { + /* If...End If */ + "If 0 > 1 Then\n" + " x = 0 End If\n", + + /* While...End While */ + "While False\n" + " x = 0 End While\n", + + /* While...Wend */ + "While False\n" + " x = 0 Wend\n", + + /* Do While...Loop */ + "Do While False\n" + " x = 0 Loop\n", + + /* Do Until...Loop */ + "Do Until True\n" + " x = 0 Loop\n", + + /* Do...Loop While */ + "Do\n" + " x = 0 Loop While False\n", + + /* Do...Loop Until */ + "Do\n" + " x = 0 Loop Until True\n", + + /* Select...End Select */ + "x = False\n" + "Select Case 42\n" + " Case 0\n" + " Call ok(False, "unexpected case")\n" + " Case 42\n" + " x = True End Select\n" + "Call ok(x, "wrong case")\n", + + /* Class...End Class (empty) */ + "Class C End Class" + }; + HRESULT hres; + UINT i; + + for (i = 0; i < ARRAY_SIZE(invalid_scripts); i++) + { + SET_EXPECT(OnScriptError); + hres = parse_script_ar(invalid_scripts[i]); + ok(FAILED(hres), "[%u] script did not fail\n", i); + todo_wine CHECK_CALLED(OnScriptError); + } +} + static void test_msgbox(void) { HRESULT hres; @@ -2500,6 +2556,7 @@ static void run_tests(void) test_procedures(); test_gc(); test_msgbox(); + test_parse_errors(); test_parse_context(); }
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=56311
Your paranoid android.
=== debian10 (32 bit report) ===
vbscript: run.c:2319: Test failed: expected global_success_d run.c:2320: Test failed: expected global_success_i run.c:2322: Test failed: parse_script failed: 80004005
=== debian10 (32 bit French report) ===
vbscript: run.c:2319: Test failed: expected global_success_d run.c:2320: Test failed: expected global_success_i run.c:2322: Test failed: parse_script failed: 80004005
=== debian10 (32 bit Japanese:Japan report) ===
vbscript: run.c:2319: Test failed: expected global_success_d run.c:2320: Test failed: expected global_success_i run.c:2322: Test failed: parse_script failed: 80004005
=== debian10 (32 bit Chinese:China report) ===
vbscript: run.c:2319: Test failed: expected global_success_d run.c:2320: Test failed: expected global_success_i run.c:2322: Test failed: parse_script failed: 80004005
=== debian10 (32 bit WoW report) ===
vbscript: run.c:2319: Test failed: expected global_success_d run.c:2320: Test failed: expected global_success_i run.c:2322: Test failed: parse_script failed: 80004005
=== debian10 (64 bit WoW report) ===
vbscript: run.c:2319: Test failed: expected global_success_d run.c:2320: Test failed: expected global_success_i run.c:2322: Test failed: parse_script failed: 80004005