(taConstr, f, offset)
| 61 | } |
| 62 | |
| 63 | function testElementType(taConstr, f, offset) { |
| 64 | clearArray(); |
| 65 | |
| 66 | var ta = new taConstr(sab, offset); |
| 67 | var name = Object.prototype.toString.call(ta); |
| 68 | ta[0] = 10; |
| 69 | assertEquals(10, f(0), name); |
| 70 | assertEquals(0, f(1), name); |
| 71 | // out of bounds |
| 72 | assertThrows(function() { f(-1); }); |
| 73 | assertThrows(function() { f(ta.length); }); |
| 74 | } |
| 75 | |
| 76 | function testElement(m, offset) { |
| 77 | testElementType(Int8Array, m.loadi8, offset); |
no test coverage detected