diff options
author | Shu-yu Guo <shu@rfrn.org> | 2017-02-07 08:17:31 -0800 |
---|---|---|
committer | Leo Balter <leonardo.balter@gmail.com> | 2017-02-07 11:17:31 -0500 |
commit | a72ee6d91275aa6524e84a9b7070103411ef2689 (patch) | |
tree | a1d9c9ce58036edff2e278b716d7947bcf43e416 /test/built-ins/Atomics/xor/bad-range.js | |
parent | 204266794c93dc917008c9db68e34cb9f94db1d2 (diff) | |
download | qtdeclarative-testsuites-a72ee6d91275aa6524e84a9b7070103411ef2689.tar.gz |
SharedArrayBuffer and Atomics tests (#839)
Diffstat (limited to 'test/built-ins/Atomics/xor/bad-range.js')
-rw-r--r-- | test/built-ins/Atomics/xor/bad-range.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/built-ins/Atomics/xor/bad-range.js b/test/built-ins/Atomics/xor/bad-range.js new file mode 100644 index 000000000..ed19315b9 --- /dev/null +++ b/test/built-ins/Atomics/xor/bad-range.js @@ -0,0 +1,19 @@ +// Copyright (C) 2017 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + Test range checking of Atomics.xor on arrays that allow atomic operations +includes: [testAtomics.js, testTypedArray.js] +---*/ + +var sab = new SharedArrayBuffer(4); +var views = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array]; + +testWithTypedArrayConstructors(function(View) { + let view = new View(sab); + testWithAtomicsOutOfBoundsIndices(function(IdxGen) { + let Idx = IdxGen(view); + assert.throws(RangeError, () => Atomics.xor(view, Idx, 0)); + }); +}, views); |