chore: migrate $ERROR -> throw new Test262Error in test/built-ins/Math (#3088)

This commit is contained in:
Rick Waldron 2021-07-21 15:10:32 -04:00 committed by GitHub
parent a101757ca1
commit e4c53bef51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
34 changed files with 49 additions and 49 deletions

View File

@ -11,5 +11,5 @@ description: Checking if Math.abs(-Infinity) equals to +Infinity
var x = -Infinity;
if (Math.abs(x) !== +Infinity)
{
$ERROR("#1: 'var x=-Infinity; Math.abs(x) !== +Infinity'");
throw new Test262Error("#1: 'var x=-Infinity; Math.abs(x) !== +Infinity'");
}

View File

@ -11,5 +11,5 @@ description: Checking if Math.ceil(x) is +Infinity, where x is +Infinity
var x = +Infinity;
if (Math.ceil(x) !== +Infinity)
{
$ERROR("#1: 'var x = +Infinity; Math.ceil(x) !== +Infinity'");
throw new Test262Error("#1: 'var x = +Infinity; Math.ceil(x) !== +Infinity'");
}

View File

@ -11,5 +11,5 @@ description: Checking if Math.ceil(x) is -Infinity, where x is -Infinity
var x = -Infinity;
if (Math.ceil(x) !== -Infinity)
{
$ERROR("#1: 'var x = -Infinity; Math.ceil(x) !== -Infinity'");
throw new Test262Error("#1: 'var x = -Infinity; Math.ceil(x) !== -Infinity'");
}

View File

@ -15,6 +15,6 @@ for (var i = -1000; i < 1000; i++)
var x = i / 10.0;
if (Math.ceil(x) !== -Math.floor(-x))
{
$ERROR("#1: 'x = " + x + "; Math.ceil(x) !== -Math.floor(-x)'");
throw new Test262Error("#1: 'x = " + x + "; Math.ceil(x) !== -Math.floor(-x)'");
}
}

View File

@ -11,5 +11,5 @@ description: Checking if Math.cos(+0) is 1
var x = +0;
if (Math.cos(x) !== 1)
{
$ERROR("#1: 'var x = +0; Math.cos(x) !== 1'");
throw new Test262Error("#1: 'var x = +0; Math.cos(x) !== 1'");
}

View File

@ -11,5 +11,5 @@ description: Checking if Math.cos(-0) is 1
var x = -0;
if (Math.cos(x) !== 1)
{
$ERROR("#1: 'var x = -0; Math.cos(x) !== 1'");
throw new Test262Error("#1: 'var x = -0; Math.cos(x) !== 1'");
}

View File

@ -11,5 +11,5 @@ description: Checking if Math.exp(+0) is 1
var x = +0;
if (Math.exp(x) !== 1)
{
$ERROR("#1: 'var x = +0; Math.exp(x) !== 1'");
throw new Test262Error("#1: 'var x = +0; Math.exp(x) !== 1'");
}

View File

@ -11,5 +11,5 @@ description: Checking if Math.exp(-0) is 1
var x = -0;
if (Math.exp(x) !== 1)
{
$ERROR("#1: 'var x = -0; Math.exp(x) !== 1'");
throw new Test262Error("#1: 'var x = -0; Math.exp(x) !== 1'");
}

View File

@ -11,5 +11,5 @@ description: Checking if Math.exp(+Infinity) is +Ifinity
var x = +Infinity;
if (Math.exp(x) !== +Infinity)
{
$ERROR("#1: 'var x = +Infinity; Math.exp(x) !== +Infinity'");
throw new Test262Error("#1: 'var x = +Infinity; Math.exp(x) !== +Infinity'");
}

View File

@ -11,5 +11,5 @@ description: Checking if Math.floor(x) is +Infinity, where x is +Infinity
var x = +Infinity;
if (Math.floor(x) !== +Infinity)
{
$ERROR("#1: 'var x = +Infinity; Math.floor(x) !== +Infinity'");
throw new Test262Error("#1: 'var x = +Infinity; Math.floor(x) !== +Infinity'");
}

View File

@ -11,5 +11,5 @@ description: Checking if Math.floor(x) is -Infinity, where x is -Infinity
var x = -Infinity;
if (Math.floor(x) !== -Infinity)
{
$ERROR("#1: 'var x = -Infinity; Math.floor(x) !== -Infinity'");
throw new Test262Error("#1: 'var x = -Infinity; Math.floor(x) !== -Infinity'");
}

View File

@ -15,6 +15,6 @@ for (var i = -1000; i < 1000; i++)
var x = i / 10.0;
if (-Math.ceil(-x) !== Math.floor(x))
{
$ERROR("#1: 'x = " + x + "; Math.floor(x) !== -Math.ceil(-x)'");
throw new Test262Error("#1: 'x = " + x + "; Math.floor(x) !== -Math.ceil(-x)'");
}
}

View File

@ -11,12 +11,12 @@ description: Checking if Math.log(+0) and Math.log(-0) equals to -Infinity
var x = +0;
if (Math.log(x) !== -Infinity)
{
$ERROR("#1: 'var x=+0; Math.log(x) !== -Infinity'");
throw new Test262Error("#1: 'var x=+0; Math.log(x) !== -Infinity'");
}
// CHECK#2
var x = -0;
if (Math.log(x) !== -Infinity)
{
$ERROR("#1: 'var x=-0; Math.log(x) !== -Infinity'");
throw new Test262Error("#1: 'var x=-0; Math.log(x) !== -Infinity'");
}

View File

@ -11,5 +11,5 @@ description: Checking if Math.log(+Infinity) equals to +Infinity
var x = +Infinity;
if (Math.log(x) !== +Infinity)
{
$ERROR("#1: 'var x=+Infinity; Math.log(x) !== +Infinity'");
throw new Test262Error("#1: 'var x=+Infinity; Math.log(x) !== +Infinity'");
}

View File

@ -10,5 +10,5 @@ description: Checking if Math.max() equals to -Infinity
// CHECK#1
if (Math.max() != -Infinity)
{
$ERROR("#1: 'Math.max() != -Infinity'");
throw new Test262Error("#1: 'Math.max() != -Infinity'");
}

View File

@ -9,15 +9,15 @@ description: Checking if Math.max.length property is defined and equals to 2
// CHECK#1
if (typeof Math.max !== "function") {
$ERROR('#1: Math.max method is not defined');
throw new Test262Error('#1: Math.max method is not defined');
}
// CHECK#2
if (typeof Math.max.length === "undefined") {
$ERROR('#2: length property of Math.max method is undefined');
throw new Test262Error('#2: length property of Math.max method is undefined');
}
// CHECK#3
if (Math.max.length !== 2) {
$ERROR('#3: The length property of the Math.max method is not 2');
throw new Test262Error('#3: The length property of the Math.max method is not 2');
}

View File

@ -10,5 +10,5 @@ description: Checking if Math.min() equals to +Infinity
// CHECK#1
if (Math.min() != +Infinity)
{
$ERROR("#1: 'Math.min() != +Infinity'");
throw new Test262Error("#1: 'Math.min() != +Infinity'");
}

View File

@ -9,15 +9,15 @@ description: Checking if Math.min.length property is defined and equals to 2
// CHECK#1
if (typeof Math.min !== "function") {
$ERROR('#1: Math.min method is not defined');
throw new Test262Error('#1: Math.min method is not defined');
}
// CHECK#2
if (typeof Math.min.length === "undefined") {
$ERROR('#2: length property of Math.min method is undefined');
throw new Test262Error('#2: length property of Math.min method is undefined');
}
// CHECK#3
if (Math.min.length !== 2) {
$ERROR('#3: The length property of the Math.min method is not 2');
throw new Test262Error('#3: The length property of the Math.min method is not 2');
}

View File

@ -19,6 +19,6 @@ var basenum = 6;
for (var i = 0; i < basenum; i++) {
if (Math.pow(base[i], exponent) !== +Infinity) {
$ERROR("#1: Math.pow(" + base[i] + ", " + exponent + ") !== +Infinity");
throw new Test262Error("#1: Math.pow(" + base[i] + ", " + exponent + ") !== +Infinity");
}
}

View File

@ -17,6 +17,6 @@ var exponentnum = 4;
for (var i = 0; i < exponentnum; i++) {
if (Math.pow(base, exponent[i]) !== +Infinity) {
$ERROR("#1: Math.pow(" + base + ", " + exponent[i] + ") !== +Infinity");
throw new Test262Error("#1: Math.pow(" + base + ", " + exponent[i] + ") !== +Infinity");
}
}

View File

@ -16,6 +16,6 @@ var exponentnum = 3;
for (var i = 0; i < exponentnum; i++) {
if (Math.pow(base, exponent[i]) !== -Infinity) {
$ERROR("#1: Math.pow(" + base + ", " + exponent[i] + ") !== -Infinity");
throw new Test262Error("#1: Math.pow(" + base + ", " + exponent[i] + ") !== -Infinity");
}
}

View File

@ -18,6 +18,6 @@ var exponentnum = 5;
for (var i = 0; i < exponentnum; i++) {
if (Math.pow(base, exponent[i]) !== +Infinity) {
$ERROR("#1: Math.pow(" + base + ", " + exponent[i] + ") !== +Infinity");
throw new Test262Error("#1: Math.pow(" + base + ", " + exponent[i] + ") !== +Infinity");
}
}

View File

@ -17,6 +17,6 @@ var exponentnum = 4;
for (var i = 0; i < exponentnum; i++) {
if (Math.pow(base, exponent[i]) !== +Infinity) {
$ERROR("#1: Math.pow(" + base + ", " + exponent[i] + ") !== +Infinity");
throw new Test262Error("#1: Math.pow(" + base + ", " + exponent[i] + ") !== +Infinity");
}
}

View File

@ -22,6 +22,6 @@ var basenum = 9;
for (var i = 0; i < basenum; i++) {
if (Math.pow(base[i], exponent) !== 1) {
$ERROR("#1: Math.pow(" + base[i] + ", " + exponent + ") !== 1");
throw new Test262Error("#1: Math.pow(" + base[i] + ", " + exponent + ") !== 1");
}
}

View File

@ -16,6 +16,6 @@ var exponentnum = 3;
for (var i = 0; i < exponentnum; i++) {
if (Math.pow(base, exponent[i]) !== -Infinity) {
$ERROR("#1: Math.pow(" + base + ", " + exponent[i] + ") !== -Infinity");
throw new Test262Error("#1: Math.pow(" + base + ", " + exponent[i] + ") !== -Infinity");
}
}

View File

@ -18,6 +18,6 @@ var exponentnum = 5;
for (var i = 0; i < exponentnum; i++) {
if (Math.pow(base, exponent[i]) !== +Infinity) {
$ERROR("#1: Math.pow(" + base + ", " + exponent[i] + ") !== +Infinity");
throw new Test262Error("#1: Math.pow(" + base + ", " + exponent[i] + ") !== +Infinity");
}
}

View File

@ -22,6 +22,6 @@ var basenum = 9;
for (var i = 0; i < basenum; i++) {
if (Math.pow(base[i], exponent) !== 1) {
$ERROR("#1: Math.pow(" + base[i] + ", -0) !== 1");
throw new Test262Error("#1: Math.pow(" + base[i] + ", -0) !== 1");
}
}

View File

@ -19,6 +19,6 @@ var basenum = 6;
for (var i = 0; i < basenum; i++) {
if (Math.pow(base[i], exponent) !== +Infinity) {
$ERROR("#1: Math.pow(" + base[i] + ", " + exponent + ") !== +Infinity");
throw new Test262Error("#1: Math.pow(" + base[i] + ", " + exponent + ") !== +Infinity");
}
}

View File

@ -23,6 +23,6 @@ for (var i = 0; i < 100; i++)
if (val < 0 || val >= 1)
{
$ERROR("#1: Math.random() = " + val);
throw new Test262Error("#1: Math.random() = " + val);
}
}

View File

@ -11,5 +11,5 @@ description: Checking if Math.round(x) is +Infinity, where x is +Infinity
var x = +Infinity;
if (Math.round(x) !== +Infinity)
{
$ERROR("#1: 'var x=+Infinity; Math.round(x) !== +Infinity'");
throw new Test262Error("#1: 'var x=+Infinity; Math.round(x) !== +Infinity'");
}

View File

@ -11,5 +11,5 @@ description: Checking if Math.round(x) is -Infinity, where x is -Infinity
var x = -Infinity;
if (Math.round(x) !== -Infinity)
{
$ERROR("#1: 'var x=-Infinity; Math.round(x) !== -Infinity'");
throw new Test262Error("#1: 'var x=-Infinity; Math.round(x) !== -Infinity'");
}

View File

@ -18,7 +18,7 @@ for (var i = 0; i <= 1000; i++)
var x = i / 10.0;
if (Math.round(x) !== Math.floor(x + 0.5))
{
$ERROR("#1: 'x = " + x + "; Math.round(x) !== Math.floor(x + 0.5)'")
throw new Test262Error("#1: 'x = " + x + "; Math.round(x) !== Math.floor(x + 0.5)'")
}
}
@ -34,6 +34,6 @@ for (i = -5; i >= -1000; i--)
if (Math.round(x) !== Math.floor(x + 0.5))
{
$ERROR("#2: 'x = " + x + "; Math.round(x) !== Math.floor(x + 0.5)'")
throw new Test262Error("#2: 'x = " + x + "; Math.round(x) !== Math.floor(x + 0.5)'")
}
}

View File

@ -16,17 +16,17 @@ description: >
// CHECK#1
if (1 / Math.round(-0.5) !== 1 / -0) {
$ERROR("#1: '1 / Math.round(-0.5) !== 1 / -0'");
throw new Test262Error("#1: '1 / Math.round(-0.5) !== 1 / -0'");
}
// CHECK#2
if (1 / Math.round(-0.25) !== 1 / -0) {
$ERROR("#2: '1 / Math.round(-0.25) !== 1 / -0'");
throw new Test262Error("#2: '1 / Math.round(-0.25) !== 1 / -0'");
}
// CHECK#3
if (1 / Math.round(-0) !== 1 / -0) {
$ERROR("#3: '1 / Math.round(-0) !== 1 / -0'");
throw new Test262Error("#3: '1 / Math.round(-0) !== 1 / -0'");
}
var x = 0;
@ -34,41 +34,41 @@ var x = 0;
// CHECK#4
x = 0.5 - Number.EPSILON / 4;
if (1 / Math.round(x) !== 1 / 0) {
$ERROR("#4: '1 / Math.round(" + x + ") !== 1 / 0'");
throw new Test262Error("#4: '1 / Math.round(" + x + ") !== 1 / 0'");
}
// CHECK#5
x = -(2 / Number.EPSILON - 1);
if (Math.round(x) !== x) {
$ERROR("#5: 'Math.round(" + x + ") !== " + x + "'");
throw new Test262Error("#5: 'Math.round(" + x + ") !== " + x + "'");
}
// CHECK#6
x = -(1.5 / Number.EPSILON - 1);
if (Math.round(x) !== x) {
$ERROR("#6: 'Math.round(" + x + ") !== " + x + "'");
throw new Test262Error("#6: 'Math.round(" + x + ") !== " + x + "'");
}
// CHECK#7
x = -(1 / Number.EPSILON + 1);
if (Math.round(x) !== x) {
$ERROR("#7: 'Math.round(" + x + ") !== " + x + "'");
throw new Test262Error("#7: 'Math.round(" + x + ") !== " + x + "'");
}
// CHECK#8
x = 1 / Number.EPSILON + 1;
if (Math.round(x) !== x) {
$ERROR("#8: 'Math.round(" + x + ") !== " + x + "'");
throw new Test262Error("#8: 'Math.round(" + x + ") !== " + x + "'");
}
// CHECK#9
x = 1.5 / Number.EPSILON - 1;
if (Math.round(x) !== x) {
$ERROR("#9: 'Math.round(" + x + ") !== " + x + "'");
throw new Test262Error("#9: 'Math.round(" + x + ") !== " + x + "'");
}
// CHECK#10
x = 2 / Number.EPSILON - 1;
if (Math.round(x) !== x) {
$ERROR("#10: 'Math.round(" + x + ") !== " + x + "'");
throw new Test262Error("#10: 'Math.round(" + x + ") !== " + x + "'");
}

View File

@ -11,5 +11,5 @@ description: Checking if Math.sqrt(+Infinity) is +Infinity
var x = +Infinity;
if (Math.sqrt(x) !== +Infinity)
{
$ERROR("#1: 'var x=+Infinity; Math.sqrt(x) !== +Infinity'");
throw new Test262Error("#1: 'var x=+Infinity; Math.sqrt(x) !== +Infinity'");
}