MCPcopy Create free account
hub / github.com/nodejs/node / testElementType

Function testElementType

deps/v8/test/mjsunit/asm/atomics-add.js:69–81  ·  view source on GitHub ↗
(taConstr, f, offset)

Source from the content-addressed store, hash-verified

67}
68
69function testElementType(taConstr, f, offset) {
70 clearArray();
71
72 var ta = new taConstr(sab, offset);
73 var name = Object.prototype.toString.call(ta);
74 assertEquals(0, f(0, 10), name);
75 assertEquals(10, ta[0]);
76 assertEquals(10, f(0, 10), name);
77 assertEquals(20, ta[0]);
78 // out of bounds
79 assertThrows(function() { f(-1, 0); });
80 assertThrows(function() { f(ta.length, 0); });
81}
82
83function testElement(m, offset) {
84 testElementType(Int8Array, m.addi8, offset);

Callers 1

testElementFunction · 0.70

Calls 5

clearArrayFunction · 0.70
fFunction · 0.70
assertEqualsFunction · 0.50
assertThrowsFunction · 0.50
callMethod · 0.45

Tested by

no test coverage detected