summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRick Waldron <waldron.rick@gmail.com>2018-03-01 15:10:10 -0500
committerLeo Balter <leonardo.balter@gmail.com>2018-03-01 15:10:10 -0500
commit0192e0d70e2295fb590f14865da42f0f9dfa64bd (patch)
tree26b1e45cfe4181e60a70f2aa51a17a06e35bb54f
parent1e1d503c1bf42d88fc244ea411abc062d6a38fef (diff)
downloadqtdeclarative-testsuites-0192e0d70e2295fb590f14865da42f0f9dfa64bd.tar.gz
TypedArrays with elementSize 1 cannot produce these range errors (#1465)
-rw-r--r--test/built-ins/TypedArrays/ctors/buffer-arg/buffer-arg-bufferbyteoffset-throws-from-modulo-element-size-sab.js9
-rw-r--r--test/built-ins/TypedArrays/ctors/buffer-arg/buffer-arg-byteoffset-throws-from-modulo-element-size-sab.js11
2 files changed, 16 insertions, 4 deletions
diff --git a/test/built-ins/TypedArrays/ctors/buffer-arg/buffer-arg-bufferbyteoffset-throws-from-modulo-element-size-sab.js b/test/built-ins/TypedArrays/ctors/buffer-arg/buffer-arg-bufferbyteoffset-throws-from-modulo-element-size-sab.js
index b07837b84..8baba4efa 100644
--- a/test/built-ins/TypedArrays/ctors/buffer-arg/buffer-arg-bufferbyteoffset-throws-from-modulo-element-size-sab.js
+++ b/test/built-ins/TypedArrays/ctors/buffer-arg/buffer-arg-bufferbyteoffset-throws-from-modulo-element-size-sab.js
@@ -12,10 +12,15 @@ info: |
least one argument and the Type of the first argument is Object and that
object has an [[ArrayBufferData]] internal slot.
+
+ Let elementSize be the Number value of the Element Size value in Table 56 for constructorName.*
...
- 13. If length is undefined, then
+ If length is either not present or undefined, then
a. If bufferByteLength modulo elementSize ≠ 0, throw a RangeError exception.
...
+
+ * Int8Array, Uint8Array, Uint8ClampedArray all have element size 1, so will never fail.
+
includes: [testTypedArray.js]
features: [SharedArrayBuffer, TypedArray]
---*/
@@ -30,4 +35,4 @@ testWithTypedArrayConstructors(function(TA) {
assert.throws(RangeError, function() {
new TA(buffer, 0, undefined);
});
-});
+}, [ Float64Array, Float32Array, Int32Array, Int16Array, Uint32Array, Uint16Array ]);
diff --git a/test/built-ins/TypedArrays/ctors/buffer-arg/buffer-arg-byteoffset-throws-from-modulo-element-size-sab.js b/test/built-ins/TypedArrays/ctors/buffer-arg/buffer-arg-byteoffset-throws-from-modulo-element-size-sab.js
index 645f259af..d67216a0c 100644
--- a/test/built-ins/TypedArrays/ctors/buffer-arg/buffer-arg-byteoffset-throws-from-modulo-element-size-sab.js
+++ b/test/built-ins/TypedArrays/ctors/buffer-arg/buffer-arg-byteoffset-throws-from-modulo-element-size-sab.js
@@ -12,9 +12,15 @@ info: |
least one argument and the Type of the first argument is Object and that
object has an [[ArrayBufferData]] internal slot.
+
+ Let elementSize be the Number value of the Element Size value in Table 56 for constructorName.*
+
...
- 10. If offset modulo elementSize ≠ 0, throw a RangeError exception.
+ If offset modulo elementSize ≠ 0, throw a RangeError exception.
...
+
+ * Int8Array, Uint8Array, Uint8ClampedArray all have element size 1, so will never fail.
+
includes: [testTypedArray.js]
features: [SharedArrayBuffer, TypedArray]
---*/
@@ -25,4 +31,5 @@ testWithTypedArrayConstructors(function(TA) {
assert.throws(RangeError, function() {
new TA(buffer, 7);
});
-});
+}, [ Float64Array, Float32Array, Int32Array, Int16Array, Uint32Array, Uint16Array ]);
+