(mode)
| 351 | }); |
| 352 | |
| 353 | function outputGraphicalCube(mode) { |
| 354 | const gpu = new GPU({ mode }); |
| 355 | const mockContext = { |
| 356 | getExtension: () => {} |
| 357 | }; |
| 358 | const mockCanvas = { |
| 359 | getContext: () => mockContext |
| 360 | }; |
| 361 | assert.throws(() => { |
| 362 | const kernel = gpu.createKernel(function(input) { |
| 363 | return input[this.thread.x]; |
| 364 | }, { |
| 365 | canvas: mockCanvas, |
| 366 | output: [5,5,5], |
| 367 | graphical: true |
| 368 | }); |
| 369 | kernel([1]); |
| 370 | }, new Error('Output must have 2 dimensions on graphical mode')); |
| 371 | gpu.destroy(); |
| 372 | } |
| 373 | |
| 374 | test('graphical output array auto', () => { |
| 375 | outputGraphicalCube(); |
no test coverage detected
searching dependent graphs…