diff options
author | Leo Balter <leonardo.balter@gmail.com> | 2018-02-27 14:58:56 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-27 14:58:56 -0500 |
commit | 27128070275f467aa62f74b515ec111ca902f997 (patch) | |
tree | c348f2bd4b4c826e74e1f64cdde45af1d971c1a0 /test/built-ins/TypedArray/prototype/slice/BigInt | |
parent | 173e98e00b14db854d293108d559b79071dfaab2 (diff) | |
download | qtdeclarative-testsuites-27128070275f467aa62f74b515ec111ca902f997.tar.gz |
Fix errors recently introduced. (#1448)
* Fix bad references on tests for BigInt TypedArrays
* Remove bad conversions for BigInt TypedArray
* Cleanup the BigInt TypedArray harness file
Remove non used code (testBigIntTypedArrayConversions)
Move the constructors list to inside the exposed function, this prevents early implementations to fail before the function is called.
* Fix bad references in TypedArrays.of (BigInt)
* Remove BigInt tests from typedarray harness test
* Use BigInt for BigInt typedArrays
* Apply last fixings on BigInt TypedArray tests
* Apply fixes to last revision from @anba
Diffstat (limited to 'test/built-ins/TypedArray/prototype/slice/BigInt')
4 files changed, 4 insertions, 43 deletions
diff --git a/test/built-ins/TypedArray/prototype/slice/BigInt/bit-precision.js b/test/built-ins/TypedArray/prototype/slice/BigInt/bit-precision.js deleted file mode 100644 index e27565331..000000000 --- a/test/built-ins/TypedArray/prototype/slice/BigInt/bit-precision.js +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (C) 2016 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -esid: sec-%typedarray%.prototype.slice -description: Preservation of bit-level encoding -info: | - [...] - 15. Else if count > 0, then - [...] - e. NOTE: If srcType and targetType are the same, the transfer must be - performed in a manner that preserves the bit-level encoding of the - source data. - f. Let srcByteOffet be the value of O's [[ByteOffset]] internal slot. - g. Let targetByteIndex be A's [[ByteOffset]] internal slot. - h. Let srcByteIndex be (k × elementSize) + srcByteOffet. - i. Let limit be targetByteIndex + count × elementSize. - j. Repeat, while targetByteIndex < limit - i. Let value be GetValueFromBuffer(srcBuffer, srcByteIndex, "Uint8"). - ii. Perform SetValueInBuffer(targetBuffer, targetByteIndex, "Uint8", - value). - iii. Increase srcByteIndex by 1. - iv. Increase targetByteIndex by 1. -includes: [nans.js, compareArray.js, testBigIntTypedArray.js] -features: [BigInt, TypedArray] ----*/ - -function body(FloatArray) { - var subject = new FloatArray(distinctNaNs); - var sliced, subjectBytes, slicedBytes; - - sliced = subject.slice(); - - subjectBytes = new Uint8Array(subject.buffer); - slicedBytes = new Uint8Array(sliced.buffer); - - assert(compareArray(subjectBytes, slicedBytes)); -} - -testWithBigIntTypedArrayConstructors(body, [Float32Array, Float64Array]); diff --git a/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-custom-ctor-other-targettype.js b/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-custom-ctor-other-targettype.js index 5dee0faf7..c81ad9ab8 100644 --- a/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-custom-ctor-other-targettype.js +++ b/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-custom-ctor-other-targettype.js @@ -27,7 +27,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { sample.constructor = {}; sample.constructor[Symbol.species] = function(count) { - var other = TA === Int8Array ? Int16Array : Int8Array; + var other = TA === BigInt64Array ? BigUint64Array : BigInt64Array; $DETACHBUFFER(sample.buffer); return new other(count); }; diff --git a/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-zero-count-custom-ctor-other-targettype.js b/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-zero-count-custom-ctor-other-targettype.js index adcd18b71..851468f93 100644 --- a/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-zero-count-custom-ctor-other-targettype.js +++ b/test/built-ins/TypedArray/prototype/slice/BigInt/detached-buffer-zero-count-custom-ctor-other-targettype.js @@ -27,7 +27,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { var sample, result, other; var ctor = {}; ctor[Symbol.species] = function(count) { - other = TA === Int8Array ? Int16Array : Int8Array; + other = TA === BigInt64Array ? BigUint64Array : BigInt64Array; $DETACHBUFFER(sample.buffer); return new other(count); }; diff --git a/test/built-ins/TypedArray/prototype/slice/BigInt/speciesctor-get-species-custom-ctor-returns-another-instance.js b/test/built-ins/TypedArray/prototype/slice/BigInt/speciesctor-get-species-custom-ctor-returns-another-instance.js index 81be8cd76..bfd0fff4f 100644 --- a/test/built-ins/TypedArray/prototype/slice/BigInt/speciesctor-get-species-custom-ctor-returns-another-instance.js +++ b/test/built-ins/TypedArray/prototype/slice/BigInt/speciesctor-get-species-custom-ctor-returns-another-instance.js @@ -38,7 +38,7 @@ features: [BigInt, Symbol.species, TypedArray] testWithBigIntTypedArrayConstructors(function(TA) { var sample = new TA([40n]); - var other = new Int8Array([1, 0, 1]); + var other = new BigInt64Array([1n, 0n, 1n]); var result; sample.constructor = {}; @@ -49,5 +49,5 @@ testWithBigIntTypedArrayConstructors(function(TA) { result = sample.slice(0, 0); assert.sameValue(result, other, "returned another typedarray"); - assert(compareArray(result, [1, 0, 1]), "the returned object is preserved"); + assert(compareArray(result, [1n, 0n, 1n]), "the returned object is preserved"); }); |