Jacek Caban : vbscript: Added Global_IsEmpty implementation.

Alexandre Julliard julliard at winehq.org
Wed Oct 19 14:05:26 CDT 2011


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Wed Oct 19 19:39:00 2011 +0200

vbscript: Added Global_IsEmpty implementation.

---

 dlls/vbscript/global.c      |   11 +++++++++--
 dlls/vbscript/tests/api.vbs |   12 ++++++++++++
 2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/dlls/vbscript/global.c b/dlls/vbscript/global.c
index 97fbeb7..98f41f2 100644
--- a/dlls/vbscript/global.c
+++ b/dlls/vbscript/global.c
@@ -278,8 +278,15 @@ static HRESULT Global_IsDate(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VA
 
 static HRESULT Global_IsEmpty(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
 {
-    FIXME("\n");
-    return E_NOTIMPL;
+    TRACE("(%s)\n", debugstr_variant(arg));
+
+    assert(args_cnt == 1);
+
+    if(res) {
+        V_VT(res) = VT_BOOL;
+        V_BOOL(res) = V_VT(arg) == VT_EMPTY ? VARIANT_TRUE : VARIANT_FALSE;
+    }
+    return S_OK;
 }
 
 static HRESULT Global_IsNull(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
diff --git a/dlls/vbscript/tests/api.vbs b/dlls/vbscript/tests/api.vbs
index d5653ab..d5b75db 100644
--- a/dlls/vbscript/tests/api.vbs
+++ b/dlls/vbscript/tests/api.vbs
@@ -32,6 +32,18 @@ Call ok(not isObject(4), "isObject(4) is true?")
 Call ok(not isObject("x"), "isObject(""x"") is true?")
 Call ok(not isObject(Null), "isObject(Null) is true?")
 
+Call ok(not isEmpty(new EmptyClass), "isEmpty(new EmptyClass) is true?")
+Set x = new EmptyClass
+Call ok(not isEmpty(x), "isEmpty(x) is true?")
+x = empty
+Call ok(isEmpty(x), "isEmpty(x) is not true?")
+Call ok(isEmpty(empty), "isEmpty(empty) is not true?")
+Call ok(not isEmpty(Nothing), "isEmpty(Nothing) is not true?")
+Call ok(not isEmpty(true), "isEmpty(true) is true?")
+Call ok(not isEmpty(4), "isEmpty(4) is true?")
+Call ok(not isEmpty("x"), "isEmpty(""x"") is true?")
+Call ok(not isEmpty(Null), "isEmpty(Null) is true?")
+
 Call ok(getVT(err) = "VT_DISPATCH", "getVT(err) = " & getVT(err))
 
 Sub TestHex(x, ex)




More information about the wine-cvs mailing list