Fix range check tests for DataView#set methods

Fixes gh-685
This commit is contained in:
Leonardo Balter 2016-06-23 17:34:58 -04:00
parent 9370371ac5
commit 9ff1cbb50c
No known key found for this signature in database
GPG Key ID: 4191D7EB5EC82FF7
16 changed files with 32 additions and 64 deletions

View File

@ -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)");

View File

@ -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)");

View File

@ -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)");

View File

@ -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)");

View File

@ -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)");

View File

@ -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)");

View File

@ -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)");

View File

@ -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)");

View File

@ -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)");

View File

@ -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)");

View File

@ -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)");

View File

@ -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)");

View File

@ -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)");

View File

@ -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)");

View File

@ -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)");

View File

@ -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)");