(taConstr, f, offset)
| 70 | } |
| 71 | |
| 72 | function testElementType(taConstr, f, offset) { |
| 73 | clearArray(); |
| 74 | |
| 75 | var ta = new taConstr(sab, offset); |
| 76 | var name = Object.prototype.toString.call(ta); |
| 77 | ta[0] = 0x7f; |
| 78 | assertEquals(0x7f, f(0, 0xf), name); |
| 79 | assertEquals(0xf, ta[0]); |
| 80 | // out of bounds |
| 81 | assertThrows(function() { f(-1, 0); }); |
| 82 | assertThrows(function() { f(ta.length, 0); }); |
| 83 | } |
| 84 | |
| 85 | function testElement(m, offset) { |
| 86 | testElementType(Int8Array, m.exchangei8, offset); |
no test coverage detected