From 9ff1cbb50c42577f6b04cea4efec4add81279b6d Mon Sep 17 00:00:00 2001 From: Leonardo Balter Date: Thu, 23 Jun 2016 17:34:58 -0400 Subject: [PATCH] Fix range check tests for DataView#set methods Fixes gh-685 --- .../setFloat32/index-check-before-value-conversion.js | 4 ++++ .../setFloat32/range-check-after-value-conversion.js | 8 -------- .../setFloat64/index-check-before-value-conversion.js | 4 ++++ .../setFloat64/range-check-after-value-conversion.js | 8 -------- .../setInt16/index-check-before-value-conversion.js | 4 ++++ .../setInt16/range-check-after-value-conversion.js | 8 -------- .../setInt32/index-check-before-value-conversion.js | 4 ++++ .../setInt32/range-check-after-value-conversion.js | 8 -------- .../setInt8/index-check-before-value-conversion.js | 4 ++++ .../setInt8/range-check-after-value-conversion.js | 8 -------- .../setUint16/index-check-before-value-conversion.js | 4 ++++ .../setUint16/range-check-after-value-conversion.js | 8 -------- .../setUint32/index-check-before-value-conversion.js | 4 ++++ .../setUint32/range-check-after-value-conversion.js | 8 -------- .../setUint8/index-check-before-value-conversion.js | 4 ++++ .../setUint8/range-check-after-value-conversion.js | 8 -------- 16 files changed, 32 insertions(+), 64 deletions(-) diff --git a/test/built-ins/DataView/prototype/setFloat32/index-check-before-value-conversion.js b/test/built-ins/DataView/prototype/setFloat32/index-check-before-value-conversion.js index 34cf980535..bdf09e3d1c 100755 --- a/test/built-ins/DataView/prototype/setFloat32/index-check-before-value-conversion.js +++ b/test/built-ins/DataView/prototype/setFloat32/index-check-before-value-conversion.js @@ -35,3 +35,7 @@ assert.throws(RangeError, function() { assert.throws(RangeError, function() { dataView.setFloat32(-Infinity, poisoned); }, "setFloat32(-Infinity, poisoned)"); + +assert.throws(RangeError, function() { + dataView.setFloat32(Infinity, poisoned); +}, "setFloat32(Infinity, poisoned)"); diff --git a/test/built-ins/DataView/prototype/setFloat32/range-check-after-value-conversion.js b/test/built-ins/DataView/prototype/setFloat32/range-check-after-value-conversion.js index e048fdfa15..8a1b4013ef 100755 --- a/test/built-ins/DataView/prototype/setFloat32/range-check-after-value-conversion.js +++ b/test/built-ins/DataView/prototype/setFloat32/range-check-after-value-conversion.js @@ -30,18 +30,10 @@ var poisoned = { } }; -assert.throws(Test262Error, function() { - dataView.setFloat32(Infinity, poisoned); -}, "setFloat32(Infinity, poisoned)"); - assert.throws(Test262Error, function() { dataView.setFloat32(100, poisoned); }, "setFloat32(100, poisoned)"); -assert.throws(Test262Error, function() { - dataView.setFloat32('Infinity', poisoned); -}, "setFloat32('Infinity', poisoned)"); - assert.throws(Test262Error, function() { dataView.setFloat32('100', poisoned); }, "setFloat32('100', poisoned)"); diff --git a/test/built-ins/DataView/prototype/setFloat64/index-check-before-value-conversion.js b/test/built-ins/DataView/prototype/setFloat64/index-check-before-value-conversion.js index 5e66803fb7..792e8cc18a 100755 --- a/test/built-ins/DataView/prototype/setFloat64/index-check-before-value-conversion.js +++ b/test/built-ins/DataView/prototype/setFloat64/index-check-before-value-conversion.js @@ -36,3 +36,7 @@ assert.throws(RangeError, function() { assert.throws(RangeError, function() { dataView.setFloat64(-Infinity, poisoned); }, "setFloat64(-Infinity, poisoned)"); + +assert.throws(RangeError, function() { + dataView.setFloat64(Infinity, poisoned); +}, "setFloat64(Infinity, poisoned)"); diff --git a/test/built-ins/DataView/prototype/setFloat64/range-check-after-value-conversion.js b/test/built-ins/DataView/prototype/setFloat64/range-check-after-value-conversion.js index 5843fdc54c..3482407718 100755 --- a/test/built-ins/DataView/prototype/setFloat64/range-check-after-value-conversion.js +++ b/test/built-ins/DataView/prototype/setFloat64/range-check-after-value-conversion.js @@ -30,18 +30,10 @@ var poisoned = { } }; -assert.throws(Test262Error, function() { - dataView.setFloat64(Infinity, poisoned); -}, "setFloat64(Infinity, poisoned)"); - assert.throws(Test262Error, function() { dataView.setFloat64(100, poisoned); }, "setFloat64(100, poisoned)"); -assert.throws(Test262Error, function() { - dataView.setFloat64('Infinity', poisoned); -}, "setFloat64('Infinity', poisoned)"); - assert.throws(Test262Error, function() { dataView.setFloat64('100', poisoned); }, "setFloat64('100', poisoned)"); diff --git a/test/built-ins/DataView/prototype/setInt16/index-check-before-value-conversion.js b/test/built-ins/DataView/prototype/setInt16/index-check-before-value-conversion.js index 826cbc8313..7a07fd8e64 100755 --- a/test/built-ins/DataView/prototype/setInt16/index-check-before-value-conversion.js +++ b/test/built-ins/DataView/prototype/setInt16/index-check-before-value-conversion.js @@ -36,3 +36,7 @@ assert.throws(RangeError, function() { assert.throws(RangeError, function() { dataView.setInt16(-Infinity, poisoned); }, "setInt16(-Infinity, poisoned)"); + +assert.throws(RangeError, function() { + dataView.setInt16(Infinity, poisoned); +}, "setInt16(Infinity, poisoned)"); diff --git a/test/built-ins/DataView/prototype/setInt16/range-check-after-value-conversion.js b/test/built-ins/DataView/prototype/setInt16/range-check-after-value-conversion.js index 7778ab7b76..043c2abd24 100755 --- a/test/built-ins/DataView/prototype/setInt16/range-check-after-value-conversion.js +++ b/test/built-ins/DataView/prototype/setInt16/range-check-after-value-conversion.js @@ -30,18 +30,10 @@ var poisoned = { } }; -assert.throws(Test262Error, function() { - dataView.setInt16(Infinity, poisoned); -}, "setInt16(Infinity, poisoned)"); - assert.throws(Test262Error, function() { dataView.setInt16(100, poisoned); }, "setInt16(100, poisoned)"); -assert.throws(Test262Error, function() { - dataView.setInt16('Infinity', poisoned); -}, "setInt16('Infinity', poisoned)"); - assert.throws(Test262Error, function() { dataView.setInt16('100', poisoned); }, "setInt16('100', poisoned)"); diff --git a/test/built-ins/DataView/prototype/setInt32/index-check-before-value-conversion.js b/test/built-ins/DataView/prototype/setInt32/index-check-before-value-conversion.js index ee0adecbf3..8fa67a3a88 100755 --- a/test/built-ins/DataView/prototype/setInt32/index-check-before-value-conversion.js +++ b/test/built-ins/DataView/prototype/setInt32/index-check-before-value-conversion.js @@ -36,3 +36,7 @@ assert.throws(RangeError, function() { assert.throws(RangeError, function() { dataView.setInt32(-Infinity, poisoned); }, "setInt32(-Infinity, poisoned)"); + +assert.throws(RangeError, function() { + dataView.setInt32(Infinity, poisoned); +}, "setInt32(Infinity, poisoned)"); diff --git a/test/built-ins/DataView/prototype/setInt32/range-check-after-value-conversion.js b/test/built-ins/DataView/prototype/setInt32/range-check-after-value-conversion.js index 951de20ba0..a514260a47 100755 --- a/test/built-ins/DataView/prototype/setInt32/range-check-after-value-conversion.js +++ b/test/built-ins/DataView/prototype/setInt32/range-check-after-value-conversion.js @@ -30,18 +30,10 @@ var poisoned = { } }; -assert.throws(Test262Error, function() { - dataView.setInt32(Infinity, poisoned); -}, "setInt32(Infinity, poisoned)"); - assert.throws(Test262Error, function() { dataView.setInt32(100, poisoned); }, "setInt32(100, poisoned)"); -assert.throws(Test262Error, function() { - dataView.setInt32('Infinity', poisoned); -}, "setInt32('Infinity', poisoned)"); - assert.throws(Test262Error, function() { dataView.setInt32('100', poisoned); }, "setInt32('100', poisoned)"); diff --git a/test/built-ins/DataView/prototype/setInt8/index-check-before-value-conversion.js b/test/built-ins/DataView/prototype/setInt8/index-check-before-value-conversion.js index ca6ce0c5a9..1766d04eb1 100755 --- a/test/built-ins/DataView/prototype/setInt8/index-check-before-value-conversion.js +++ b/test/built-ins/DataView/prototype/setInt8/index-check-before-value-conversion.js @@ -36,3 +36,7 @@ assert.throws(RangeError, function() { assert.throws(RangeError, function() { dataView.setInt8(-Infinity, poisoned); }, "setInt8(-Infinity, poisoned)"); + +assert.throws(RangeError, function() { + dataView.setInt8(Infinity, poisoned); +}, "setInt8(Infinity, poisoned)"); diff --git a/test/built-ins/DataView/prototype/setInt8/range-check-after-value-conversion.js b/test/built-ins/DataView/prototype/setInt8/range-check-after-value-conversion.js index d723d74341..a41d72e9a6 100755 --- a/test/built-ins/DataView/prototype/setInt8/range-check-after-value-conversion.js +++ b/test/built-ins/DataView/prototype/setInt8/range-check-after-value-conversion.js @@ -30,18 +30,10 @@ var poisoned = { } }; -assert.throws(Test262Error, function() { - dataView.setInt8(Infinity, poisoned); -}, "setInt8(Infinity, poisoned)"); - assert.throws(Test262Error, function() { dataView.setInt8(100, poisoned); }, "setInt8(100, poisoned)"); -assert.throws(Test262Error, function() { - dataView.setInt8('Infinity', poisoned); -}, "setInt8('Infinity', poisoned)"); - assert.throws(Test262Error, function() { dataView.setInt8('100', poisoned); }, "setInt8('100', poisoned)"); diff --git a/test/built-ins/DataView/prototype/setUint16/index-check-before-value-conversion.js b/test/built-ins/DataView/prototype/setUint16/index-check-before-value-conversion.js index 6fed3d7b4f..544459a974 100755 --- a/test/built-ins/DataView/prototype/setUint16/index-check-before-value-conversion.js +++ b/test/built-ins/DataView/prototype/setUint16/index-check-before-value-conversion.js @@ -36,3 +36,7 @@ assert.throws(RangeError, function() { assert.throws(RangeError, function() { dataView.setUint16(-Infinity, poisoned); }, "setUint16(-Infinity, poisoned)"); + +assert.throws(RangeError, function() { + dataView.setUint16(Infinity, poisoned); +}, "setUint16(Infinity, poisoned)"); diff --git a/test/built-ins/DataView/prototype/setUint16/range-check-after-value-conversion.js b/test/built-ins/DataView/prototype/setUint16/range-check-after-value-conversion.js index de7bbbec2c..09a67898c6 100755 --- a/test/built-ins/DataView/prototype/setUint16/range-check-after-value-conversion.js +++ b/test/built-ins/DataView/prototype/setUint16/range-check-after-value-conversion.js @@ -30,18 +30,10 @@ var poisoned = { } }; -assert.throws(Test262Error, function() { - dataView.setUint16(Infinity, poisoned); -}, "setUint16(Infinity, poisoned)"); - assert.throws(Test262Error, function() { dataView.setUint16(100, poisoned); }, "setUint16(100, poisoned)"); -assert.throws(Test262Error, function() { - dataView.setUint16('Infinity', poisoned); -}, "setUint16('Infinity', poisoned)"); - assert.throws(Test262Error, function() { dataView.setUint16('100', poisoned); }, "setUint16('100', poisoned)"); diff --git a/test/built-ins/DataView/prototype/setUint32/index-check-before-value-conversion.js b/test/built-ins/DataView/prototype/setUint32/index-check-before-value-conversion.js index 7bbab801d3..115b9a4b49 100755 --- a/test/built-ins/DataView/prototype/setUint32/index-check-before-value-conversion.js +++ b/test/built-ins/DataView/prototype/setUint32/index-check-before-value-conversion.js @@ -36,3 +36,7 @@ assert.throws(RangeError, function() { assert.throws(RangeError, function() { dataView.setUint32(-Infinity, poisoned); }, "setUint32(-Infinity, poisoned)"); + +assert.throws(RangeError, function() { + dataView.setUint32(Infinity, poisoned); +}, "setUint32(Infinity, poisoned)"); diff --git a/test/built-ins/DataView/prototype/setUint32/range-check-after-value-conversion.js b/test/built-ins/DataView/prototype/setUint32/range-check-after-value-conversion.js index be32633578..03155eacdd 100755 --- a/test/built-ins/DataView/prototype/setUint32/range-check-after-value-conversion.js +++ b/test/built-ins/DataView/prototype/setUint32/range-check-after-value-conversion.js @@ -30,18 +30,10 @@ var poisoned = { } }; -assert.throws(Test262Error, function() { - dataView.setUint32(Infinity, poisoned); -}, "setUint32(Infinity, poisoned)"); - assert.throws(Test262Error, function() { dataView.setUint32(100, poisoned); }, "setUint32(100, poisoned)"); -assert.throws(Test262Error, function() { - dataView.setUint32('Infinity', poisoned); -}, "setUint32('Infinity', poisoned)"); - assert.throws(Test262Error, function() { dataView.setUint32('100', poisoned); }, "setUint32('100', poisoned)"); diff --git a/test/built-ins/DataView/prototype/setUint8/index-check-before-value-conversion.js b/test/built-ins/DataView/prototype/setUint8/index-check-before-value-conversion.js index d1a93d452b..34690136ee 100755 --- a/test/built-ins/DataView/prototype/setUint8/index-check-before-value-conversion.js +++ b/test/built-ins/DataView/prototype/setUint8/index-check-before-value-conversion.js @@ -36,3 +36,7 @@ assert.throws(RangeError, function() { assert.throws(RangeError, function() { dataView.setUint8(-Infinity, poisoned); }, "setUint8(-Infinity, poisoned)"); + +assert.throws(RangeError, function() { + dataView.setUint8(Infinity, poisoned); +}, "setUint8(Infinity, poisoned)"); diff --git a/test/built-ins/DataView/prototype/setUint8/range-check-after-value-conversion.js b/test/built-ins/DataView/prototype/setUint8/range-check-after-value-conversion.js index c22efa0bf1..d377b99e0f 100755 --- a/test/built-ins/DataView/prototype/setUint8/range-check-after-value-conversion.js +++ b/test/built-ins/DataView/prototype/setUint8/range-check-after-value-conversion.js @@ -30,18 +30,10 @@ var poisoned = { } }; -assert.throws(Test262Error, function() { - dataView.setUint8(Infinity, poisoned); -}, "setUint8(Infinity, poisoned)"); - assert.throws(Test262Error, function() { dataView.setUint8(100, poisoned); }, "setUint8(100, poisoned)"); -assert.throws(Test262Error, function() { - dataView.setUint8('Infinity', poisoned); -}, "setUint8('Infinity', poisoned)"); - assert.throws(Test262Error, function() { dataView.setUint8('100', poisoned); }, "setUint8('100', poisoned)");