summaryrefslogtreecommitdiff
path: root/test/built-ins/Atomics
diff options
context:
space:
mode:
authorRobin Templeton <robin@igalia.com>2018-01-22 20:40:35 -0500
committerRick Waldron <waldron.rick@gmail.com>2018-01-25 14:01:33 -0500
commit8b71c5fea5358cb91998a72ec741746606c1089e (patch)
treebd408485a682f150d8c72ee76204295932b310a5 /test/built-ins/Atomics
parentbaa5d94bc502db0c9caf8e6d39bba24773160b58 (diff)
downloadqtdeclarative-testsuites-8b71c5fea5358cb91998a72ec741746606c1089e.tar.gz
Atomics tests for BigInt
Diffstat (limited to 'test/built-ins/Atomics')
-rw-r--r--test/built-ins/Atomics/add/bad-range.js7
-rw-r--r--test/built-ins/Atomics/add/nonshared-int-views.js5
-rw-r--r--test/built-ins/Atomics/and/bad-range.js7
-rw-r--r--test/built-ins/Atomics/and/nonshared-int-views.js5
-rw-r--r--test/built-ins/Atomics/compareExchange/bad-range.js7
-rw-r--r--test/built-ins/Atomics/compareExchange/nonshared-int-views.js5
-rw-r--r--test/built-ins/Atomics/exchange/bad-range.js7
-rw-r--r--test/built-ins/Atomics/exchange/nonshared-int-views.js5
-rw-r--r--test/built-ins/Atomics/load/bad-range.js7
-rw-r--r--test/built-ins/Atomics/load/nonshared-int-views.js5
-rw-r--r--test/built-ins/Atomics/or/bad-range.js7
-rw-r--r--test/built-ins/Atomics/or/nonshared-int-views.js5
-rw-r--r--test/built-ins/Atomics/store/bad-range.js7
-rw-r--r--test/built-ins/Atomics/store/nonshared-int-views.js5
-rw-r--r--test/built-ins/Atomics/sub/bad-range.js7
-rw-r--r--test/built-ins/Atomics/sub/nonshared-int-views.js5
-rw-r--r--test/built-ins/Atomics/wait/bad-range.js19
-rw-r--r--test/built-ins/Atomics/wait/nonshared-int-views.js5
-rw-r--r--test/built-ins/Atomics/wake/bad-range.js19
-rw-r--r--test/built-ins/Atomics/wake/nonshared-int-views.js5
-rw-r--r--test/built-ins/Atomics/xor/bad-range.js7
-rw-r--r--test/built-ins/Atomics/xor/nonshared-int-views.js5
22 files changed, 135 insertions, 21 deletions
diff --git a/test/built-ins/Atomics/add/bad-range.js b/test/built-ins/Atomics/add/bad-range.js
index a887c3548..2139e57c2 100644
--- a/test/built-ins/Atomics/add/bad-range.js
+++ b/test/built-ins/Atomics/add/bad-range.js
@@ -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) {
diff --git a/test/built-ins/Atomics/add/nonshared-int-views.js b/test/built-ins/Atomics/add/nonshared-int-views.js
index eb7b682fe..1528abd3a 100644
--- a/test/built-ins/Atomics/add/nonshared-int-views.js
+++ b/test/built-ins/Atomics/add/nonshared-int-views.js
@@ -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);
diff --git a/test/built-ins/Atomics/and/bad-range.js b/test/built-ins/Atomics/and/bad-range.js
index 6215a6c47..fe91ae801 100644
--- a/test/built-ins/Atomics/and/bad-range.js
+++ b/test/built-ins/Atomics/and/bad-range.js
@@ -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) {
diff --git a/test/built-ins/Atomics/and/nonshared-int-views.js b/test/built-ins/Atomics/and/nonshared-int-views.js
index 20e75cd53..7184954bf 100644
--- a/test/built-ins/Atomics/and/nonshared-int-views.js
+++ b/test/built-ins/Atomics/and/nonshared-int-views.js
@@ -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);
diff --git a/test/built-ins/Atomics/compareExchange/bad-range.js b/test/built-ins/Atomics/compareExchange/bad-range.js
index ddf0b61dc..11824fc57 100644
--- a/test/built-ins/Atomics/compareExchange/bad-range.js
+++ b/test/built-ins/Atomics/compareExchange/bad-range.js
@@ -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) {
diff --git a/test/built-ins/Atomics/compareExchange/nonshared-int-views.js b/test/built-ins/Atomics/compareExchange/nonshared-int-views.js
index ea5b99078..c3a95b239 100644
--- a/test/built-ins/Atomics/compareExchange/nonshared-int-views.js
+++ b/test/built-ins/Atomics/compareExchange/nonshared-int-views.js
@@ -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);
diff --git a/test/built-ins/Atomics/exchange/bad-range.js b/test/built-ins/Atomics/exchange/bad-range.js
index cbafaecef..4392c1d78 100644
--- a/test/built-ins/Atomics/exchange/bad-range.js
+++ b/test/built-ins/Atomics/exchange/bad-range.js
@@ -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) {
diff --git a/test/built-ins/Atomics/exchange/nonshared-int-views.js b/test/built-ins/Atomics/exchange/nonshared-int-views.js
index 7e71daf75..30b7617d1 100644
--- a/test/built-ins/Atomics/exchange/nonshared-int-views.js
+++ b/test/built-ins/Atomics/exchange/nonshared-int-views.js
@@ -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);
diff --git a/test/built-ins/Atomics/load/bad-range.js b/test/built-ins/Atomics/load/bad-range.js
index f09217eac..d13ef4b5e 100644
--- a/test/built-ins/Atomics/load/bad-range.js
+++ b/test/built-ins/Atomics/load/bad-range.js
@@ -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) {
diff --git a/test/built-ins/Atomics/load/nonshared-int-views.js b/test/built-ins/Atomics/load/nonshared-int-views.js
index 2beec220a..05eff959c 100644
--- a/test/built-ins/Atomics/load/nonshared-int-views.js
+++ b/test/built-ins/Atomics/load/nonshared-int-views.js
@@ -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);
diff --git a/test/built-ins/Atomics/or/bad-range.js b/test/built-ins/Atomics/or/bad-range.js
index 0c17b9eb9..a9fab884a 100644
--- a/test/built-ins/Atomics/or/bad-range.js
+++ b/test/built-ins/Atomics/or/bad-range.js
@@ -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) {
diff --git a/test/built-ins/Atomics/or/nonshared-int-views.js b/test/built-ins/Atomics/or/nonshared-int-views.js
index 1560e5766..033174fcf 100644
--- a/test/built-ins/Atomics/or/nonshared-int-views.js
+++ b/test/built-ins/Atomics/or/nonshared-int-views.js
@@ -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);
diff --git a/test/built-ins/Atomics/store/bad-range.js b/test/built-ins/Atomics/store/bad-range.js
index ebc42e894..69a402646 100644
--- a/test/built-ins/Atomics/store/bad-range.js
+++ b/test/built-ins/Atomics/store/bad-range.js
@@ -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) {
diff --git a/test/built-ins/Atomics/store/nonshared-int-views.js b/test/built-ins/Atomics/store/nonshared-int-views.js
index bb9bdc51b..0153ed2fc 100644
--- a/test/built-ins/Atomics/store/nonshared-int-views.js
+++ b/test/built-ins/Atomics/store/nonshared-int-views.js
@@ -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);
diff --git a/test/built-ins/Atomics/sub/bad-range.js b/test/built-ins/Atomics/sub/bad-range.js
index d390e5a7e..dabd7789e 100644
--- a/test/built-ins/Atomics/sub/bad-range.js
+++ b/test/built-ins/Atomics/sub/bad-range.js
@@ -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) {
diff --git a/test/built-ins/Atomics/sub/nonshared-int-views.js b/test/built-ins/Atomics/sub/nonshared-int-views.js
index 7961f0faa..7383307f7 100644
--- a/test/built-ins/Atomics/sub/nonshared-int-views.js
+++ b/test/built-ins/Atomics/sub/nonshared-int-views.js
@@ -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);
diff --git a/test/built-ins/Atomics/wait/bad-range.js b/test/built-ins/Atomics/wait/bad-range.js
index 9e0cdfffd..680caf7ba 100644
--- a/test/built-ins/Atomics/wait/bad-range.js
+++ b/test/built-ins/Atomics/wait/bad-range.js
@@ -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);
diff --git a/test/built-ins/Atomics/wait/nonshared-int-views.js b/test/built-ins/Atomics/wait/nonshared-int-views.js
index 400192829..c4a5fb4b0 100644
--- a/test/built-ins/Atomics/wait/nonshared-int-views.js
+++ b/test/built-ins/Atomics/wait/nonshared-int-views.js
@@ -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);
diff --git a/test/built-ins/Atomics/wake/bad-range.js b/test/built-ins/Atomics/wake/bad-range.js
index bdd5d282a..248501b53 100644
--- a/test/built-ins/Atomics/wake/bad-range.js
+++ b/test/built-ins/Atomics/wake/bad-range.js
@@ -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);
diff --git a/test/built-ins/Atomics/wake/nonshared-int-views.js b/test/built-ins/Atomics/wake/nonshared-int-views.js
index d4e197846..8e86e2385 100644
--- a/test/built-ins/Atomics/wake/nonshared-int-views.js
+++ b/test/built-ins/Atomics/wake/nonshared-int-views.js
@@ -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);
diff --git a/test/built-ins/Atomics/xor/bad-range.js b/test/built-ins/Atomics/xor/bad-range.js
index 643b8138d..151986926 100644
--- a/test/built-ins/Atomics/xor/bad-range.js
+++ b/test/built-ins/Atomics/xor/bad-range.js
@@ -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) {
diff --git a/test/built-ins/Atomics/xor/nonshared-int-views.js b/test/built-ins/Atomics/xor/nonshared-int-views.js
index 0c1dca77b..0ab8b408e 100644
--- a/test/built-ins/Atomics/xor/nonshared-int-views.js
+++ b/test/built-ins/Atomics/xor/nonshared-int-views.js
@@ -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);