Skip to content

Commit 6ebdbcd

Browse files
committed
Fixed issue gpujs#17 invalid test case
1 parent 198f094 commit 6ebdbcd

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

test/src/features/if_else.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
/*
21
function booleanBranch( mode ) {
3-
var f = GPU(function() {
2+
var gpu = new GPU();
3+
var f = gpu.createKernel(function() {
44
var ret = 0.0;
55
if(true) {
66
ret = 4.0;
@@ -9,13 +9,12 @@ function booleanBranch( mode ) {
99
}
1010
return ret;
1111
}, {
12-
thread : [1],
13-
block : [1],
12+
dimensions : [1],
1413
mode : mode
1514
});
16-
15+
1716
QUnit.ok( f !== null, "function generated test");
18-
QUnit.close(f(), 42.0, 0.01, "basic return function test");
17+
QUnit.close(f(), 4, 0.01, "basic return function test");
1918
}
2019

2120
QUnit.test( "booleanBranch (auto)", function() {
@@ -29,7 +28,7 @@ QUnit.test( "booleanBranch (GPU)", function() {
2928
QUnit.test( "booleanBranch (CPU)", function() {
3029
booleanBranch("cpu");
3130
});
32-
*/
31+
3332

3433
function if_else( mode ) {
3534
var gpu = new GPU();
@@ -43,7 +42,7 @@ function if_else( mode ) {
4342
dimensions : [4],
4443
mode : mode
4544
});
46-
45+
4746
QUnit.ok( f !== null, "function generated test");
4847
QUnit.deepEqual(f([1, 1, 0, 0]), [0, 0, 1, 1], "basic return function test");
4948
}

0 commit comments

Comments
 (0)