Debian Codegraph @

js/src/tests/test262/harness/testTypedArray-conversions.js

raw
1 // Copyright (c) 2017 Rick Waldron. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3 /*---
4 description: >
5 Including testTypedArray.js will expose:
6
7 testTypedArrayConversions()
8
9 includes: [testTypedArray.js]
10 features: [TypedArray]
11 ---*/
12 var callCount = 0;
13 var bcv = {
14 values: [
15 127,
16 ],
17 expected: {
18 Int8: [
19 127,
20 ],
21 Uint8: [
22 127,
23 ],
24 Uint8Clamped: [
25 127,
26 ],
27 Int16: [
28 127,
29 ],
30 Uint16: [
31 127,
32 ],
33 Int32: [
34 127,
35 ],
36 Uint32: [
37 127,
38 ],
39 Float16: [
40 127,
41 ],
42 Float32: [
43 127,
44 ],
45 Float64: [
46 127,
47 ]
48 }
49 };
50
51 testTypedArrayConversions(bcv, function(TA, value, expected, initial) {
52 var sample = new TA([initial]);
53 sample.fill(value);
54 assert.sameValue(initial, 0);
55 assert.sameValue(sample[0], expected);
56 callCount++;
57 });
58
59
60 reportCompare(0, 0);