Module: wine Branch: master Commit: 27f327aebc64e4e95c90e91c4625500b74a08174 URL: http://source.winehq.org/git/wine.git/?a=commit;h=27f327aebc64e4e95c90e91c46...
Author: Piotr Caban piotr.caban@gmail.com Date: Sun May 24 21:06:23 2009 +0200
jscript: Added Math_SQRT2 implementation 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 ac487d1..1157fed 100644 --- a/dlls/jscript/math.c +++ b/dlls/jscript/math.c @@ -120,8 +120,8 @@ static HRESULT Math_PI(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp static HRESULT Math_SQRT2(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_SQRT2, flags, retv); }
static HRESULT Math_SQRT1_2(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, diff --git a/dlls/jscript/tests/api.js b/dlls/jscript/tests/api.js index 30f2017..a4dd9f5 100644 --- a/dlls/jscript/tests/api.js +++ b/dlls/jscript/tests/api.js @@ -675,4 +675,9 @@ ok(Math.floor(Math.LN2*100) === 69, "Math.LN2 = " + Math.LN2); Math.LN2 = "test"; ok(Math.floor(Math.LN2*100) === 69, "modified Math.LN2 = " + Math.LN2);
+ok(typeof(Math.SQRT2) === "number", "typeof(Math.SQRT2) = " + typeof(Math.SQRT2)); +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); + reportSuccess();