vbscript: Added interp_neg implementation.

This commit is contained in:
Jacek Caban 2011-09-12 12:31:47 +02:00 committed by Alexandre Julliard
parent fb5509ec06
commit 8e1ccb8be6
2 changed files with 20 additions and 2 deletions

View File

@ -393,8 +393,20 @@ static HRESULT interp_concat(exec_ctx_t *ctx)
static HRESULT interp_neg(exec_ctx_t *ctx)
{
FIXME("\n");
return E_NOTIMPL;
variant_val_t val;
VARIANT v;
HRESULT hres;
hres = stack_pop_val(ctx, &val);
if(FAILED(hres))
return hres;
hres = VarNeg(val.v, &v);
release_val(&val);
if(FAILED(hres))
return hres;
return stack_push(ctx, &v);
}
static const instr_func_t op_funcs[] = {

View File

@ -35,6 +35,10 @@ Call ok(0 = 0.0, "0 <> 0.0")
Call ok(16 = &h10&, "16 <> &h10&")
Call ok(010 = 10, "010 <> 10")
Call ok(10. = 10, "10. <> 10")
Call ok(&hffFFffFF& = -1, "&hffFFffFF& <> -1")
Call ok(&hffFFffFF& = -1, "&hffFFffFF& <> -1")
Call ok(--1 = 1, "--1 = " & --1)
Call ok(-empty = 0, "-empty = " & (-empty))
Call ok(getVT(false) = "VT_BOOL", "getVT(false) is not VT_BOOL")
Call ok(getVT(true) = "VT_BOOL", "getVT(true) is not VT_BOOL")
@ -53,6 +57,8 @@ Call ok(getVT(&h10000&) = "VT_I4", "getVT(&h10000&) is not VT_I4")
Call ok(getVT(&H10000&) = "VT_I4", "getVT(&H10000&) is not VT_I4")
Call ok(getVT(&hffFFffFF&) = "VT_I2", "getVT(&hffFFffFF&) is not VT_I2")
Call ok(getVT(1 & 100000) = "VT_BSTR", "getVT(1 & 100000) is not VT_BSTR")
Call ok(getVT(-empty) = "VT_I2", "getVT(-empty) = " & getVT(-empty))
Call ok(getVT(-null) = "VT_NULL", "getVT(-null) = " & getVT(-null))
Call ok("ab" & "cd" = "abcd", """ab"" & ""cd"" <> ""abcd""")
Call ok("ab " & null = "ab ", """ab"" & null = " & ("ab " & null))