aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChad Austin <chad@imvu.com>2013-05-09 12:39:22 -0700
committerChad Austin <chad@imvu.com>2013-05-17 12:58:29 -0700
commit17ab8d9f57f0cb31d2d83555ae898b32b99600f8 (patch)
tree9962bf393588bc1a45cb71938ae0a5bfc5c6b8a0 /tests
parent0074368080bee713232e0b152dc0cae790ec34d3 (diff)
Allow implicit conversion from booleans to ints/floats (for WebGL)
Diffstat (limited to 'tests')
-rw-r--r--tests/embind/embind.test.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/embind/embind.test.js b/tests/embind/embind.test.js
index 8d6dd044..23d50fe1 100644
--- a/tests/embind/embind.test.js
+++ b/tests/embind/embind.test.js
@@ -493,6 +493,15 @@ module({
assert.equal(true, cm.emval_test_not(false));
});
+ test("can pass booleans as integers", function() {
+ assert.equal(1, cm.emval_test_as_unsigned(true));
+ assert.equal(0, cm.emval_test_as_unsigned(false));
+ });
+
+ test("can pass booleans as floats", function() {
+ assert.equal(2, cm.const_ref_adder(true, true));
+ });
+
test("convert double to unsigned", function() {
var rv = cm.emval_test_as_unsigned(1.5);
assert.equal('number', typeof rv);