From 813bb5166c4a26598fcf59e7a585c46baec331fc Mon Sep 17 00:00:00 2001 From: Leonardo Balter <leonardo.balter@gmail.com> Date: Mon, 20 Jun 2016 17:44:11 -0400 Subject: [PATCH] Remove precision-equivalency tests Due to specs approximation values, some tests are invalid as the harness helpers rely on another approximated values as Math.LN2. --- harness/math_isequal.js | 19 ----------------- harness/math_precision.js | 11 ---------- test/built-ins/Math/atan/S15.8.2.4_A4.js | 21 ------------------- test/built-ins/Math/atan/S15.8.2.4_A5.js | 21 ------------------- .../Number/MIN_VALUE/S15.7.3.3_A1.js | 16 -------------- 5 files changed, 88 deletions(-) delete mode 100644 harness/math_isequal.js delete mode 100644 harness/math_precision.js delete mode 100644 test/built-ins/Math/atan/S15.8.2.4_A4.js delete mode 100644 test/built-ins/Math/atan/S15.8.2.4_A5.js delete mode 100644 test/built-ins/Number/MIN_VALUE/S15.7.3.3_A1.js diff --git a/harness/math_isequal.js b/harness/math_isequal.js deleted file mode 100644 index a68434e075..0000000000 --- a/harness/math_isequal.js +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -var prec; -function isEqual(num1, num2) -{ - if ((num1 === Infinity)&&(num2 === Infinity)) - { - return(true); - } - if ((num1 === -Infinity)&&(num2 === -Infinity)) - { - return(true); - } - prec = getPrecision(Math.min(Math.abs(num1), Math.abs(num2))); - return(Math.abs(num1 - num2) <= prec); - //return(num1 === num2); -} - diff --git a/harness/math_precision.js b/harness/math_precision.js deleted file mode 100644 index fd6ed1d0a3..0000000000 --- a/harness/math_precision.js +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -function getPrecision(num) { - //TODO: Create a table of prec's, - // because using Math for testing Math isn't that correct. - - var log2num = Math.log(Math.abs(num)) / Math.LN2; - var pernum = Math.ceil(log2num); - return 2 * Math.pow(2, -52 + pernum); -} diff --git a/test/built-ins/Math/atan/S15.8.2.4_A4.js b/test/built-ins/Math/atan/S15.8.2.4_A4.js deleted file mode 100644 index 43eb7869bf..0000000000 --- a/test/built-ins/Math/atan/S15.8.2.4_A4.js +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: > - If x is +Infinity, Math.atan(x) is an implementation-dependent - approximation to +PI/2 -es5id: 15.8.2.4_A4 -description: Checking if Math.atan(+Infinity) is an approximation to +PI/2 -includes: - - math_precision.js - - math_isequal.js ----*/ - -// CHECK#1 - -var x = +Infinity; -if (!isEqual(Math.atan(x),Math.PI/2)) -{ - $ERROR("#1: '!isEqual(Math.atan(+Infinity), Math.PI/2)'"); -} diff --git a/test/built-ins/Math/atan/S15.8.2.4_A5.js b/test/built-ins/Math/atan/S15.8.2.4_A5.js deleted file mode 100644 index 1544c2ed56..0000000000 --- a/test/built-ins/Math/atan/S15.8.2.4_A5.js +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: > - If x is -Infinity, Math.atan(x) is an implementation-dependent - approximation to -PI/2 -es5id: 15.8.2.4_A5 -description: Checking if Math.atan(-Infinity) is an approximation to -PI/2 -includes: - - math_precision.js - - math_isequal.js ----*/ - -// CHECK#1 - -var x = -Infinity; -if (!isEqual(Math.atan(x), -Math.PI/2)) -{ - $ERROR("#1: '!isEqual(Math.atan(-Infinity), -Math.PI/2)'"); -} diff --git a/test/built-ins/Number/MIN_VALUE/S15.7.3.3_A1.js b/test/built-ins/Number/MIN_VALUE/S15.7.3.3_A1.js deleted file mode 100644 index d70230fa3e..0000000000 --- a/test/built-ins/Number/MIN_VALUE/S15.7.3.3_A1.js +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: Number.MIN_VALUE is approximately 5e-324 -es5id: 15.7.3.3_A1 -description: Checking Number.MIN_VALUE value -includes: - - math_precision.js - - math_isequal.js ----*/ - -// CHECK#1 -if (!isEqual(Number.MIN_VALUE, 5e-324)) { - $ERROR('#1: Number.MIN_VALUE approximately equal to 5e-324'); -} -- GitLab