vbscript: Added interp_equal implementation.

This commit is contained in:
Jacek Caban 2011-09-09 14:48:35 +02:00 committed by Alexandre Julliard
parent eb88228b62
commit 6d7ec9cf71
2 changed files with 35 additions and 2 deletions

View File

@ -253,10 +253,38 @@ static HRESULT interp_not(exec_ctx_t *ctx)
return stack_push(ctx, &v); return stack_push(ctx, &v);
} }
static HRESULT cmp_oper(exec_ctx_t *ctx)
{
variant_val_t l, r;
HRESULT hres;
hres = stack_pop_val(ctx, &r);
if(FAILED(hres))
return hres;
hres = stack_pop_val(ctx, &l);
if(SUCCEEDED(hres))
hres = VarCmp(l.v, r.v, ctx->script->lcid, 0);
release_val(&r);
release_val(&l);
return hres;
}
static HRESULT interp_equal(exec_ctx_t *ctx) static HRESULT interp_equal(exec_ctx_t *ctx)
{ {
FIXME("\n"); VARIANT v;
return E_NOTIMPL; HRESULT hres;
TRACE("\n");
hres = cmp_oper(ctx);
if(FAILED(hres))
return hres;
V_VT(&v) = VT_BOOL;
V_BOOL(&v) = hres == VARCMP_EQ ? VARIANT_TRUE : VARIANT_FALSE;
return stack_push(ctx, &v);
} }
static const instr_func_t op_funcs[] = { static const instr_func_t op_funcs[] = {

View File

@ -25,4 +25,9 @@ call ok((true), "true is not true?")
ok not false, "not false but not true?" ok not false, "not false but not true?"
ok not not true, "not not true but not true?" ok not not true, "not not true but not true?"
Call ok(true = true, "true = true is false")
Call ok(false = false, "false = false is false")
Call ok(not (true = false), "true = false is true")
Call ok("x" = "x", """x"" = ""x"" is false")
reportSuccess() reportSuccess()