summaryrefslogtreecommitdiff
path: root/harness
diff options
context:
space:
mode:
authorLeo Balter <leonardo.balter@gmail.com>2018-02-27 14:58:56 -0500
committerGitHub <noreply@github.com>2018-02-27 14:58:56 -0500
commit27128070275f467aa62f74b515ec111ca902f997 (patch)
treec348f2bd4b4c826e74e1f64cdde45af1d971c1a0 /harness
parent173e98e00b14db854d293108d559b79071dfaab2 (diff)
downloadqtdeclarative-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 'harness')
-rw-r--r--harness/testBigIntTypedArray.js53
1 files changed, 9 insertions, 44 deletions
diff --git a/harness/testBigIntTypedArray.js b/harness/testBigIntTypedArray.js
index dc6d50f93..f071e5515 100644
--- a/harness/testBigIntTypedArray.js
+++ b/harness/testBigIntTypedArray.js
@@ -6,33 +6,25 @@ description: |
---*/
/**
- * Array containing every typed array constructor.
- */
-var BigIntTypedArrayConstructors = [
- BigInt64Array,
- BigUint64Array
-];
-
-/**
* The %TypedArray% intrinsic constructor function.
*/
var TypedArray = Object.getPrototypeOf(Int8Array);
/**
- * Callback for testing a typed array constructor.
- *
- * @callback typedArrayConstructorCallback
- * @param {Function} Constructor the constructor object to test with.
- */
-
-/**
* Calls the provided function for every typed array constructor.
*
* @param {typedArrayConstructorCallback} f - the function to call for each typed array constructor.
* @param {Array} selected - An optional Array with filtered typed arrays
*/
-function testWithBigIntTypedArrayConstructors(f, selected) {
- var constructors = selected || BigIntTypedArrayConstructors;
+function testWithBigIntTypedArrayConstructors(f) {
+ /**
+ * Array containing every BigInt typed array constructor.
+ */
+ var constructors = [
+ BigInt64Array,
+ BigUint64Array
+ ];
+
for (var i = 0; i < constructors.length; ++i) {
var constructor = constructors[i];
try {
@@ -43,30 +35,3 @@ function testWithBigIntTypedArrayConstructors(f, selected) {
}
}
}
-
-/**
- * Helper for conversion operations on TypedArrays, the expected values
- * properties are indexed in order to match the respective value for each
- * TypedArray constructor
- * @param {Function} fn - the function to call for each constructor and value.
- * will be called with the constructor, value, expected
- * value, and a initial value that can be used to avoid
- * a false positive with an equivalent expected value.
- */
-function testBigIntTypedArrayConversions(byteConversionValues, fn) {
- var values = byteConversionValues.values;
- var expected = byteConversionValues.expected;
-
- testWithBigIntTypedArrayConstructors(function(TA) {
- var name = TA.name.slice(0, -5);
-
- return values.forEach(function(value, index) {
- var exp = expected[name][index];
- var initial = 0;
- if (exp === 0) {
- initial = 1;
- }
- fn(TA, value, exp, initial);
- });
- });
-}