(self, extra)
| 15533 | 'strict': ('"use strict";',), |
| 15534 | }) |
| 15535 | def test_binary_encode(self, extra): |
| 15536 | # Encode values 0 .. 65535 into test data |
| 15537 | test_data = bytearray(struct.pack('<' + 'H' * 65536, *range(65536))) |
| 15538 | write_binary('data.tmp', test_data) |
| 15539 | binary_encoded = binary_encode('data.tmp') |
| 15540 | test_js = extra + ''' |
| 15541 | var u16 = new Uint16Array(binaryDecode(src).buffer); |
| 15542 | for(var i = 0; i < 65536; ++i) |
| 15543 | if (u16[i] != i) throw i; |
| 15544 | console.log('OK');''' |
| 15545 | write_file('test.js', read_file(path_from_root('src/binaryDecode.js')) + '\nvar src = ' + binary_encoded + ';\n' + test_js) |
| 15546 | self.assertContained('OK', self.run_js('test.js')) |
| 15547 | |
| 15548 | @crossplatform |
| 15549 | def test_executable_output_default(self): |
nothing calls this directly
no test coverage detected