From e4bc0def3be95a95d006da8dcb4a03d98966824f Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Sun, 24 May 2009 21:07:22 +0200 Subject: [PATCH] jscript: Added Math_SQRT1_2 implementations and tests. --- dlls/jscript/math.c | 4 ++-- dlls/jscript/tests/api.js | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/dlls/jscript/math.c b/dlls/jscript/math.c index 1157fed3c3f..f7cf3d18807 100644 --- a/dlls/jscript/math.c +++ b/dlls/jscript/math.c @@ -127,8 +127,8 @@ static HRESULT Math_SQRT2(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS static HRESULT Math_SQRT1_2(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { - FIXME("\n"); - return E_NOTIMPL; + TRACE("\n"); + return math_constant(M_SQRT1_2, flags, retv); } /* ECMA-262 3rd Edition 15.8.2.12 */ diff --git a/dlls/jscript/tests/api.js b/dlls/jscript/tests/api.js index a4dd9f50fcd..71517cbb23e 100644 --- a/dlls/jscript/tests/api.js +++ b/dlls/jscript/tests/api.js @@ -680,4 +680,9 @@ ok(Math.floor(Math.SQRT2*100) === 141, "Math.SQRT2 = " + Math.SQRT2); Math.SQRT2 = "test"; ok(Math.floor(Math.SQRT2*100) === 141, "modified Math.SQRT2 = " + Math.SQRT2); +ok(typeof(Math.SQRT1_2) === "number", "typeof(Math.SQRT1_2) = " + typeof(Math.SQRT1_2)); +ok(Math.floor(Math.SQRT1_2*100) === 70, "Math.SQRT1_2 = " + Math.SQRT1_2); +Math.SQRT1_2 = "test"; +ok(Math.floor(Math.SQRT1_2*100) === 70, "modified Math.SQRT1_2 = " + Math.SQRT1_2); + reportSuccess();