gpu.js/test/issues/401-cpu-canvas-check.js
Robert Plummer ee7baf70ba fix: Array handling (2,3,4) for webgl2 & webgl1 (headlessgl next)
fix: Float handling
feat: added `optimizeFloatMemory` to better exemplify what it does and replace `floatTextures` and its voodoo in webgl2
feat: end to end strong type detection
Note: added a bunch of TODO's this is just a good resting point.
2019-04-11 19:41:58 -04:00

36 lines
1.0 KiB
JavaScript

const { assert, skip, test, module: describe } = require('qunit');
const { GPU, CPUKernel } = require('../../src');
describe('issue #401');
test('Issue #401 - cpu no canvas graphical', function(assert) {
assert.throws(function() {
CPUKernel.prototype.build.apply({
setupConstants: function() {},
setupArguments: function() {},
validateSettings: function() {},
getKernelString: function() {},
translateSource: function() {},
graphical: true,
output: [1],
canvas: null
}, []);
},
new Error('no canvas available for using graphical output'),
'throws when canvas is not available and using graphical output');
});
test('Issue #401 - cpu no canvas', function(assert) {
CPUKernel.prototype.build.apply({
setupConstants: function() {},
setupArguments: function() {},
validateSettings: function() {},
getKernelString: function() {},
translateSource: function() {},
graphical: false,
output: [1],
canvas: null
}, []);
assert.equal(true, true, 'ok when canvas is not available and not using graphical output');
});