summaryrefslogtreecommitdiff
path: root/test/int_ops.post.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2015-10-31 22:16:08 -0700
committerAlon Zakai <alonzakai@gmail.com>2015-10-31 22:16:08 -0700
commit3e87906af10d70e158a5ce34aac72baf35ace9d6 (patch)
tree884b469d4be1d9be9631fc7ee016928f4901e6a2 /test/int_ops.post.js
parent70e280d07d9bdc54d299daf85dfcf0cefd614232 (diff)
downloadbinaryen-3e87906af10d70e158a5ce34aac72baf35ace9d6.tar.gz
binaryen-3e87906af10d70e158a5ce34aac72baf35ace9d6.tar.bz2
binaryen-3e87906af10d70e158a5ce34aac72baf35ace9d6.zip
test improvement
Diffstat (limited to 'test/int_ops.post.js')
-rw-r--r--test/int_ops.post.js25
1 files changed, 14 insertions, 11 deletions
diff --git a/test/int_ops.post.js b/test/int_ops.post.js
index 4ac57fa39..995358b2a 100644
--- a/test/int_ops.post.js
+++ b/test/int_ops.post.js
@@ -8,17 +8,20 @@ Module.print(Module._clz(8));
// binary
function testBinary(name) {
Module.print(name);
- Module.print(Module['_' + name](0, 0));
- Module.print(Module['_' + name](0, 1));
- Module.print(Module['_' + name](1, 0));
- Module.print(Module['_' + name](1, 1));
- Module.print(Module['_' + name](5, 6));
- Module.print(Module['_' + name](6, 5));
- Module.print(Module['_' + name](101, -12));
- Module.print(Module['_' + name](-12, 101));
- Module.print(Module['_' + name](-1, 5));
- Module.print(Module['_' + name](5, -1));
- Module.print(Module['_' + name](-1, -1));
+ function doTest(x, y) {
+ Module.print(' ' + [x, y] + ' ==> ' + Module['_' + name](x, y));
+ }
+ doTest(0, 0);
+ doTest(0, 1);
+ doTest(1, 0);
+ doTest(1, 1);
+ doTest(5, 6);
+ doTest(6, 5);
+ doTest(101, -12);
+ doTest(-12, 101);
+ doTest(-1, 5);
+ doTest(5, -1);
+ doTest(-1, -1);
}
testBinary('add');
testBinary('sub');