vbscript: Added Global_IsEmpty implementation.

This commit is contained in:
Jacek Caban 2011-10-19 19:39:00 +02:00 committed by Alexandre Julliard
parent 8a17193d8d
commit 7fa15c5f4d
2 changed files with 21 additions and 2 deletions

View File

@ -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)

View File

@ -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)