vbscript: Added Global_isNull implementation.

This commit is contained in:
Jacek Caban 2011-10-20 12:57:18 +02:00 committed by Alexandre Julliard
parent 9ed15fbf14
commit a37ea54183
2 changed files with 21 additions and 2 deletions

View File

@ -291,8 +291,15 @@ static HRESULT Global_IsEmpty(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, V
static HRESULT Global_IsNull(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_NULL ? VARIANT_TRUE : VARIANT_FALSE;
}
return S_OK;
}
static HRESULT Global_IsNumeric(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)

View File

@ -44,6 +44,18 @@ 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(not isNull(new EmptyClass), "isNull(new EmptyClass) is true?")
Set x = new EmptyClass
Call ok(not isNull(x), "isNull(x) is true?")
x = null
Call ok(isNull(x), "isNull(x) is not true?")
Call ok(not isNull(empty), "isNull(empty) is true?")
Call ok(not isNull(Nothing), "isNull(Nothing) is true?")
Call ok(not isNull(true), "isNull(true) is true?")
Call ok(not isNull(4), "isNull(4) is true?")
Call ok(not isNull("x"), "isNull(""x"") is true?")
Call ok(isNull(Null), "isNull(Null) is not true?")
Call ok(getVT(err) = "VT_DISPATCH", "getVT(err) = " & getVT(err))
Sub TestHex(x, ex)