Jacek Caban : vbscript: Added interp_lteq implementation.

Alexandre Julliard julliard at winehq.org
Mon Sep 19 13:48:44 CDT 2011


Module: wine
Branch: master
Commit: 33a81218adc851966427b50f0c770751c9d33ec7
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=33a81218adc851966427b50f0c770751c9d33ec7

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Mon Sep 19 14:07:51 2011 +0200

vbscript: Added interp_lteq implementation.

---

 dlls/vbscript/interp.c       |   14 ++++++++++++--
 dlls/vbscript/tests/lang.vbs |    2 ++
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/dlls/vbscript/interp.c b/dlls/vbscript/interp.c
index a609056..d3c3483 100644
--- a/dlls/vbscript/interp.c
+++ b/dlls/vbscript/interp.c
@@ -991,8 +991,18 @@ static HRESULT interp_lt(exec_ctx_t *ctx)
 
 static HRESULT interp_lteq(exec_ctx_t *ctx)
 {
-    FIXME("\n");
-    return E_NOTIMPL;
+    VARIANT v;
+    HRESULT hres;
+
+    TRACE("\n");
+
+    hres = cmp_oper(ctx);
+    if(FAILED(hres))
+        return hres;
+
+    V_VT(&v) = VT_BOOL;
+    V_BOOL(&v) = hres == VARCMP_LT || hres == VARCMP_EQ ? VARIANT_TRUE : VARIANT_FALSE;
+    return stack_push(ctx, &v);
 }
 
 static HRESULT interp_concat(exec_ctx_t *ctx)
diff --git a/dlls/vbscript/tests/lang.vbs b/dlls/vbscript/tests/lang.vbs
index 699d78c..a63f9cf 100644
--- a/dlls/vbscript/tests/lang.vbs
+++ b/dlls/vbscript/tests/lang.vbs
@@ -126,6 +126,8 @@ Call ok(not (true > 0), "true > 0")
 Call ok(not (0 > 1 = 1), "0 > 1 = 1")
 Call ok(1 < 2, "! 1 < 2")
 Call ok(1 = 1 < 0, "! 1 = 1 < 0")
+Call ok(1 <= 2, "! 1 <= 2")
+Call ok(2 <= 2, "! 2 <= 2")
 
 x = 3
 Call ok(2+2 = 4, "2+2 = " & (2+2))




More information about the wine-cvs mailing list