vbscript: Added interp_mod implementation.

This commit is contained in:
Jacek Caban 2011-09-13 11:40:02 +02:00 committed by Alexandre Julliard
parent 1c2ec6d44f
commit bb62059cc9
2 changed files with 27 additions and 2 deletions

View File

@ -644,8 +644,26 @@ static HRESULT interp_sub(exec_ctx_t *ctx)
static HRESULT interp_mod(exec_ctx_t *ctx)
{
FIXME("\n");
return E_NOTIMPL;
variant_val_t r, l;
VARIANT v;
HRESULT hres;
TRACE("\n");
hres = stack_pop_val(ctx, &r);
if(FAILED(hres))
return hres;
hres = stack_pop_val(ctx, &l);
if(SUCCEEDED(hres)) {
hres = VarMod(l.v, r.v, &v);
release_val(&l);
}
release_val(&r);
if(FAILED(hres))
return hres;
return stack_push(ctx, &v);
}
static HRESULT interp_neg(exec_ctx_t *ctx)

View File

@ -99,6 +99,13 @@ Call ok(getVT(2-null) = "VT_NULL", "getVT(2-null) = " & getVT(2-null))
Call ok(2-empty = 2, "2-empty = " & (2-empty))
Call ok(2-x = -1, "2-x = " & (2-x))
Call ok(9 Mod 6 = 3, "9 Mod 6 = " & (9 Mod 6))
Call ok(11.6 Mod 5.5 = False, "11.6 Mod 5.5 = " & (11.6 Mod 5.5 = 0.6))
Call ok(7 Mod 4+2 = 5, "7 Mod 4+2 <> 5")
Call ok(getVT(2 mod null) = "VT_NULL", "getVT(2 mod null) = " & getVT(2 mod null))
Call ok(getVT(null mod 2) = "VT_NULL", "getVT(null mod 2) = " & getVT(null mod 2))
'FIXME: Call ok(empty mod 2 = 0, "empty mod 2 = " & (empty mod 2))
if false then
ok false, "if false called"
end if