diff --git a/test/harness/testTypedArray-conversions.js b/test/harness/testTypedArray-conversions.js index d0d27fe5fe..4449bb464c 100644 --- a/test/harness/testTypedArray-conversions.js +++ b/test/harness/testTypedArray-conversions.js @@ -36,6 +36,9 @@ var bcv = { Uint32: [ 127, ], + Float16: [ + 127, + ], Float32: [ 127, ], diff --git a/test/harness/testTypedArray.js b/test/harness/testTypedArray.js index 1d4111b233..796ec7a989 100644 --- a/test/harness/testTypedArray.js +++ b/test/harness/testTypedArray.js @@ -17,16 +17,23 @@ features: [TypedArray] assert(typeof TypedArray === "function"); assert.sameValue(TypedArray, Object.getPrototypeOf(Uint8Array)); +var hasFloat16Array = typeof Float16Array !== 'undefined'; + var callCount = 0; testWithTypedArrayConstructors(() => callCount++); -assert.sameValue(callCount, 9); +assert.sameValue(callCount, 9 + hasFloat16Array); -assert.sameValue(typedArrayConstructors[0], Float64Array); -assert.sameValue(typedArrayConstructors[1], Float32Array); -assert.sameValue(typedArrayConstructors[2], Int32Array); -assert.sameValue(typedArrayConstructors[3], Int16Array); -assert.sameValue(typedArrayConstructors[4], Int8Array); -assert.sameValue(typedArrayConstructors[5], Uint32Array); -assert.sameValue(typedArrayConstructors[6], Uint16Array); -assert.sameValue(typedArrayConstructors[7], Uint8Array); -assert.sameValue(typedArrayConstructors[8], Uint8ClampedArray); +var index = 0; + +assert.sameValue(typedArrayConstructors[index++], Float64Array); +assert.sameValue(typedArrayConstructors[index++], Float32Array); +if (hasFloat16Array) { + assert.sameValue(typedArrayConstructors[index++], Float16Array); +} +assert.sameValue(typedArrayConstructors[index++], Int32Array); +assert.sameValue(typedArrayConstructors[index++], Int16Array); +assert.sameValue(typedArrayConstructors[index++], Int8Array); +assert.sameValue(typedArrayConstructors[index++], Uint32Array); +assert.sameValue(typedArrayConstructors[index++], Uint16Array); +assert.sameValue(typedArrayConstructors[index++], Uint8Array); +assert.sameValue(typedArrayConstructors[index++], Uint8ClampedArray);