Piotr Caban : jscript: Added Math_SQRT1_2 implementations and tests.

Alexandre Julliard julliard at winehq.org
Mon May 25 10:06:30 CDT 2009


Module: wine
Branch: master
Commit: e4bc0def3be95a95d006da8dcb4a03d98966824f
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=e4bc0def3be95a95d006da8dcb4a03d98966824f

Author: Piotr Caban <piotr.caban at gmail.com>
Date:   Sun May 24 21:07:22 2009 +0200

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 1157fed..f7cf3d1 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 a4dd9f5..71517cb 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();




More information about the wine-cvs mailing list