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

Function testElementType

deps/v8/test/mjsunit/asm/atomics-compareexchange.js:75–89  ·  view source on GitHub ↗
(taConstr, f, oobValue, offset)

Source from the content-addressed store, hash-verified

73}
74
75function testElementType(taConstr, f, oobValue, offset) {
76 clearArray();
77
78 var ta = new taConstr(sab, offset);
79 var name = Object.prototype.toString.call(ta);
80 assertEquals(0, ta[0]);
81 assertEquals(0, f(0, 0, 50), name);
82 assertEquals(50, ta[0]);
83 // Value is not equal to 0, so compareExchange won't store 100
84 assertEquals(50, f(0, 0, 100), name);
85 assertEquals(50, ta[0]);
86 // out of bounds
87 assertThrows(function() { f(-1, 0, 0); });
88 assertThrows(function() { f(ta.length, 0, 0); });
89}
90
91function testElement(m, offset) {
92 testElementType(Int8Array, m.compareExchangei8, 0, 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