78865: Subject: [PATCH 11/21 try2] vbscript: Added function parser implementation

buildbot at kegel.com buildbot at kegel.com
Wed Sep 14 11:03:39 CDT 2011


This is an experimental automated build and test service.
Please feel free to ignore this email while we work the kinks out.

For more info about this message, see http://wiki.winehq.org/BuildBot

The Buildbot has detected a failed build on builder runtests-default while building Wine.
Full details are available at: http://buildbot.kegel.com/builders/runtests-default/builds/58 (though maybe not for long, as I'm still reinstalling the buildbot periodically while experimenting)
BUILD FAILED: failed git

Errors:
error: patch failed: dlls/vbscript/compile.c:621
error: dlls/vbscript/compile.c: patch does not apply
error: patch failed: dlls/vbscript/parser.y:253
error: dlls/vbscript/parser.y: patch does not apply
error: patch failed: dlls/vbscript/tests/lang.vbs:241
error: dlls/vbscript/tests/lang.vbs: patch does not apply
error: patch failed: dlls/vbscript/vbscript.h:164
error: dlls/vbscript/vbscript.h: patch does not apply

-------------- next part --------------
From: Jacek Caban <jacek at codeweavers.com>
Subject: [PATCH 11/21 try2] vbscript: Added function parser implementation
Message-Id: <4E70C077.6040606 at codeweavers.com>
Date: Wed, 14 Sep 2011 16:55:51 +0200

try2: Fixed warn+heap failures reported by Dan

---
  dlls/vbscript/compile.c        |    2 +
  dlls/vbscript/parser.y         |    2 +
  dlls/vbscript/tests/lang.vbs   |   63 
++++++++++++++++++++++++++++++++++++++++
  dlls/vbscript/tests/vbscript.c |    3 --
  dlls/vbscript/vbscript.h       |    1 +
  5 files changed, 68 insertions(+), 3 deletions(-)

diff --git a/dlls/vbscript/compile.c b/dlls/vbscript/compile.c
index dd756b3..a4608be 100644
--- a/dlls/vbscript/compile.c
+++ b/dlls/vbscript/compile.c
@@ -621,6 +621,7 @@ static HRESULT compile_func(compile_ctx_t *ctx, statement_t *stat, function_t *f
         if(ctx->sub_end_label == -1)
             return E_OUTOFMEMORY;
         break;
+    case FUNC_FUNCTION: /* FIXME */
     case FUNC_GLOBAL:
         break;
     }
@@ -833,6 +834,7 @@ static vbscode_t *alloc_vbscode(compile_ctx_t *ctx, const WCHAR *source)
     ret->bstr_pool = NULL;
     ret->bstr_pool_size = 0;
     ret->bstr_cnt = 0;
+    ret->global_executed = FALSE;
 
     ret->global_code.type = FUNC_GLOBAL;
     ret->global_code.name = NULL;
diff --git a/dlls/vbscript/parser.y b/dlls/vbscript/parser.y
index f406f8e..36edc02 100644
--- a/dlls/vbscript/parser.y
+++ b/dlls/vbscript/parser.y
@@ -253,6 +253,8 @@ PrimaryExpression
 FunctionDecl
     : /* Storage_opt */ tSUB tIdentifier ArgumentsDecl_opt tNL StatementsNl_opt tEND tSUB
                                     { $$ = new_function_decl(ctx, $2, FUNC_SUB, $3, $5); CHECK_ERROR; }
+    | /* Storage_opt */ tFUNCTION tIdentifier ArgumentsDecl_opt tNL StatementsNl_opt tEND tFUNCTION
+                                    { $$ = new_function_decl(ctx, $2, FUNC_FUNCTION, $3, $5); CHECK_ERROR; }
 
 ArgumentsDecl_opt
     : EmptyBrackets_opt                         { $$ = NULL; }
diff --git a/dlls/vbscript/tests/lang.vbs b/dlls/vbscript/tests/lang.vbs
index a46394b..5f47360 100644
--- a/dlls/vbscript/tests/lang.vbs
+++ b/dlls/vbscript/tests/lang.vbs
@@ -241,4 +241,67 @@ y = true
 Call TestSubLocalVal
 Call ok(x, "global x is not true?")
 
+if false then
+Function testfunc
+    x = true
+End Function
+end if
+
+x = false
+Call TestFunc
+Call ok(x, "x is false, testfunc not called?")
+
+Function FuncSetTrue(v)
+    Call ok(not v, "v is not true")
+    v = true
+End Function
+
+x = false
+FuncSetTrue x
+Call ok(x, "x was not set by FuncSetTrue")
+
+FuncSetTrue false
+Call ok(not false, "false is no longer false?")
+
+Function FuncSetTrue2(ByRef v)
+    Call ok(not v, "v is not true")
+    v = true
+End Function
+
+x = false
+FuncSetTrue2 x
+Call ok(x, "x was not set by FuncSetTrue")
+
+Function TestFuncArgVal(ByVal v)
+    Call ok(not v, "v is not false")
+    v = true
+    Call ok(v, "v is not true?")
+End Function
+
+x = false
+Call TestFuncArgVal(x)
+Call ok(not x, "x is true after TestFuncArgVal call?")
+
+Function TestFuncMultiArgs(a,b,c,d,e)
+    Call ok(a=1, "a = " & a)
+    Call ok(b=2, "b = " & b)
+    Call ok(c=3, "c = " & c)
+    Call ok(d=4, "d = " & d)
+    Call ok(e=5, "e = " & e)
+End Function
+
+TestFuncMultiArgs 1, 2, 3, 4, 5
+Call TestFuncMultiArgs(1, 2, 3, 4, 5)
+
+Function TestFuncLocalVal
+    x = false
+    Call ok(not x, "local x is not false?")
+    Dim x
+End Function
+
+x = true
+y = true
+Call TestFuncLocalVal
+Call ok(x, "global x is not true?")
+
 reportSuccess()
diff --git a/dlls/vbscript/tests/vbscript.c b/dlls/vbscript/tests/vbscript.c
index ab5c8af..6ead8f4 100644
--- a/dlls/vbscript/tests/vbscript.c
+++ b/dlls/vbscript/tests/vbscript.c
@@ -412,7 +412,6 @@ static void test_vbscript_uninitializing(void)
     test_state(script, SCRIPTSTATE_INITIALIZED);
 
     hres = IActiveScriptParse64_ParseScriptText(parse, script_textW, NULL, NULL, NULL, 0, 1, 0x42, NULL, NULL);
-    todo_wine
     ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
 
     hres = IActiveScript_SetScriptSite(script, &ActiveScriptSite);
@@ -441,9 +440,7 @@ static void test_vbscript_uninitializing(void)
     hres = IActiveScript_SetScriptState(script, SCRIPTSTATE_CONNECTED);
     ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_CONNECTED) failed: %08x\n", hres);
     CHECK_CALLED(OnStateChange_CONNECTED);
-    todo_wine
     CHECK_CALLED(OnEnterScript);
-    todo_wine
     CHECK_CALLED(OnLeaveScript);
 
     test_state(script, SCRIPTSTATE_CONNECTED);
diff --git a/dlls/vbscript/vbscript.h b/dlls/vbscript/vbscript.h
index cf625cc..5e86176 100644
--- a/dlls/vbscript/vbscript.h
+++ b/dlls/vbscript/vbscript.h
@@ -164,6 +164,7 @@ typedef struct {
 
 typedef enum {
     FUNC_GLOBAL,
+    FUNC_FUNCTION,
     FUNC_SUB
 } function_type_t;
 



More information about the wine-tests-results mailing list