Atomics tests for BigInt

This commit is contained in:
Robin Templeton 2018-01-22 20:40:35 -05:00 committed by Rick Waldron
parent baa5d94bc5
commit 8b71c5fea5
22 changed files with 135 additions and 21 deletions

View File

@ -9,9 +9,14 @@ includes: [testAtomics.js, testTypedArray.js]
features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, TypedArray, for-of]
---*/
var sab = new SharedArrayBuffer(4);
var sab = new SharedArrayBuffer(8);
var views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
if (typeof BigInt !== "undefined") {
views.push(BigInt64Array);
views.push(BigUint64Array);
}
testWithTypedArrayConstructors(function(View) {
let view = new View(sab);
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {

View File

@ -13,6 +13,11 @@ var ab = new ArrayBuffer(16);
var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
if (typeof BigInt !== "undefined") {
int_views.push(BigInt64Array);
int_views.push(BigUint64Array);
}
testWithTypedArrayConstructors(function(View) {
var view = new View(ab);

View File

@ -9,9 +9,14 @@ includes: [testAtomics.js, testTypedArray.js]
features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, TypedArray, for-of]
---*/
var sab = new SharedArrayBuffer(4);
var sab = new SharedArrayBuffer(8);
var views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
if (typeof BigInt !== "undefined") {
views.push(BigInt64Array);
views.push(BigUint64Array);
}
testWithTypedArrayConstructors(function(View) {
let view = new View(sab);
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {

View File

@ -13,6 +13,11 @@ var ab = new ArrayBuffer(16);
var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
if (typeof BigInt !== "undefined") {
int_views.push(BigInt64Array);
int_views.push(BigUint64Array);
}
testWithTypedArrayConstructors(function(View) {
var view = new View(ab);

View File

@ -9,9 +9,14 @@ includes: [testAtomics.js, testTypedArray.js]
features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, TypedArray, for-of]
---*/
var sab = new SharedArrayBuffer(4);
var sab = new SharedArrayBuffer(8);
var views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
if (typeof BigInt !== "undefined") {
views.push(BigInt64Array);
views.push(BigUint64Array);
}
testWithTypedArrayConstructors(function(View) {
let view = new View(sab);
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {

View File

@ -13,6 +13,11 @@ var ab = new ArrayBuffer(16);
var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
if (typeof BigInt !== "undefined") {
int_views.push(BigInt64Array);
int_views.push(BigUint64Array);
}
testWithTypedArrayConstructors(function(View) {
var view = new View(ab);

View File

@ -9,9 +9,14 @@ includes: [testAtomics.js, testTypedArray.js]
features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, TypedArray, for-of]
---*/
var sab = new SharedArrayBuffer(4);
var sab = new SharedArrayBuffer(8);
var views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
if (typeof BigInt !== "undefined") {
views.push(BigInt64Array);
views.push(BigUint64Array);
}
testWithTypedArrayConstructors(function(View) {
let view = new View(sab);
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {

View File

@ -13,6 +13,11 @@ var ab = new ArrayBuffer(16);
var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
if (typeof BigInt !== "undefined") {
int_views.push(BigInt64Array);
int_views.push(BigUint64Array);
}
testWithTypedArrayConstructors(function(View) {
var view = new View(ab);

View File

@ -9,9 +9,14 @@ includes: [testAtomics.js, testTypedArray.js]
features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, TypedArray, for-of]
---*/
var sab = new SharedArrayBuffer(4);
var sab = new SharedArrayBuffer(8);
var views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
if (typeof BigInt !== "undefined") {
views.push(BigInt64Array);
views.push(BigUint64Array);
}
testWithTypedArrayConstructors(function(View) {
let view = new View(sab);
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {

View File

@ -13,6 +13,11 @@ var ab = new ArrayBuffer(16);
var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
if (typeof BigInt !== "undefined") {
int_views.push(BigInt64Array);
int_views.push(BigUint64Array);
}
testWithTypedArrayConstructors(function(View) {
var view = new View(ab);

View File

@ -9,9 +9,14 @@ includes: [testAtomics.js, testTypedArray.js]
features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, TypedArray, for-of]
---*/
var sab = new SharedArrayBuffer(4);
var sab = new SharedArrayBuffer(8);
var views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
if (typeof BigInt !== "undefined") {
views.push(BigInt64Array);
views.push(BigUint64Array);
}
testWithTypedArrayConstructors(function(View) {
let view = new View(sab);
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {

View File

@ -13,6 +13,11 @@ var ab = new ArrayBuffer(16);
var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
if (typeof BigInt !== "undefined") {
int_views.push(BigInt64Array);
int_views.push(BigUint64Array);
}
testWithTypedArrayConstructors(function(View) {
var view = new View(ab);

View File

@ -9,9 +9,14 @@ includes: [testAtomics.js, testTypedArray.js]
features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, TypedArray, for-of]
---*/
var sab = new SharedArrayBuffer(4);
var sab = new SharedArrayBuffer(8);
var views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
if (typeof BigInt !== "undefined") {
views.push(BigInt64Array);
views.push(BigUint64Array);
}
testWithTypedArrayConstructors(function(View) {
let view = new View(sab);
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {

View File

@ -13,6 +13,11 @@ var ab = new ArrayBuffer(16);
var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
if (typeof BigInt !== "undefined") {
int_views.push(BigInt64Array);
int_views.push(BigUint64Array);
}
testWithTypedArrayConstructors(function(View) {
var view = new View(ab);

View File

@ -9,9 +9,14 @@ includes: [testAtomics.js, testTypedArray.js]
features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, TypedArray, for-of]
---*/
var sab = new SharedArrayBuffer(4);
var sab = new SharedArrayBuffer(8);
var views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
if (typeof BigInt !== "undefined") {
views.push(BigInt64Array);
views.push(BigUint64Array);
}
testWithTypedArrayConstructors(function(View) {
let view = new View(sab);
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {

View File

@ -13,6 +13,11 @@ var ab = new ArrayBuffer(16);
var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
if (typeof BigInt !== "undefined") {
int_views.push(BigInt64Array);
int_views.push(BigUint64Array);
}
testWithTypedArrayConstructors(function(View) {
var view = new View(ab);

View File

@ -5,14 +5,21 @@
esid: sec-atomics.wait
description: >
Test range checking of Atomics.wait on arrays that allow atomic operations
includes: [testAtomics.js]
features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, for-of]
includes: [testAtomics.js, testTypedArray.js]
features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, TypedArray, arrow-function, let, for-of]
---*/
var sab = new SharedArrayBuffer(4);
var view = new Int32Array(sab);
var sab = new SharedArrayBuffer(8);
var views = [Int32Array];
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {
if (typeof BigInt !== "undefined") {
views.push(BigInt64Array);
}
testWithTypedArrayConstructors(function(View) {
let view = new View(sab);
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {
let Idx = IdxGen(view);
assert.throws(RangeError, () => Atomics.wait(view, Idx, 10, 0)); // Even with zero timeout
});
});
}, views);

View File

@ -13,6 +13,11 @@ var ab = new ArrayBuffer(16);
var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
if (typeof BigInt !== "undefined") {
int_views.push(BigInt64Array);
int_views.push(BigUint64Array);
}
testWithTypedArrayConstructors(function(View) {
var view = new View(ab);

View File

@ -5,14 +5,21 @@
esid: sec-atomics.wake
description: >
Test range checking of Atomics.wake on arrays that allow atomic operations
includes: [testAtomics.js]
features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, for-of]
includes: [testAtomics.js, testTypedArray.js]
features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, TypedArray, arrow-function, let, for-of]
---*/
var sab = new SharedArrayBuffer(4);
var view = new Int32Array(sab);
var sab = new SharedArrayBuffer(8);
var views = [Int32Array];
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {
if (typeof BigInt !== "undefined") {
views.push(BigInt64Array);
}
testWithTypedArrayConstructors(function(View) {
let view = new View(sab);
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {
let Idx = IdxGen(view);
assert.throws(RangeError, () => Atomics.wake(view, Idx, 0)); // Even with waking zero
});
});
}, views);

View File

@ -13,6 +13,11 @@ var ab = new ArrayBuffer(16);
var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
if (typeof BigInt !== "undefined") {
int_views.push(BigInt64Array);
int_views.push(BigUint64Array);
}
testWithTypedArrayConstructors(function(View) {
var view = new View(ab);

View File

@ -9,9 +9,14 @@ includes: [testAtomics.js, testTypedArray.js]
features: [SharedArrayBuffer, ArrayBuffer, DataView, Atomics, arrow-function, let, TypedArray, for-of]
---*/
var sab = new SharedArrayBuffer(4);
var sab = new SharedArrayBuffer(8);
var views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
if (typeof BigInt !== "undefined") {
views.push(BigInt64Array);
views.push(BigUint64Array);
}
testWithTypedArrayConstructors(function(View) {
let view = new View(sab);
testWithAtomicsOutOfBoundsIndices(function(IdxGen) {

View File

@ -13,6 +13,11 @@ var ab = new ArrayBuffer(16);
var int_views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array];
if (typeof BigInt !== "undefined") {
int_views.push(BigInt64Array);
int_views.push(BigUint64Array);
}
testWithTypedArrayConstructors(function(View) {
var view = new View(ab);