aboutsummaryrefslogtreecommitdiff
path: root/tests/embind
diff options
context:
space:
mode:
authorChad Austin <caustin@gmail.com>2014-03-23 15:48:44 -0700
committerChad Austin <chad@chadaustin.me>2014-03-28 23:56:41 -0700
commitbcb2da768ab5b559b1603b28e3f7b1a3e1b0b6fc (patch)
treea43712a76c2a0918ec9afa1d4dae93416a8b0130 /tests/embind
parentf9ef5a0002a3b2980d14f874514eeffa4f48dbbd (diff)
Fix passing memory_views in varargs
Diffstat (limited to 'tests/embind')
-rw-r--r--tests/embind/embind.test.js6
-rw-r--r--tests/embind/embind_test.cpp5
2 files changed, 9 insertions, 2 deletions
diff --git a/tests/embind/embind.test.js b/tests/embind/embind.test.js
index 2e74c133..4ac8fe52 100644
--- a/tests/embind/embind.test.js
+++ b/tests/embind/embind.test.js
@@ -1986,12 +1986,16 @@ module({
});
test("memory view", function() {
- function factory(view) {
+ function factory(before, view, after) {
+ this.before = before;
this.view = view;
+ this.after = after;
}
var instance = cm.construct_with_memory_view(factory);
+ assert.equal("before", instance.before);
assert.equal(10, instance.view.byteLength);
+ assert.equal("after", instance.after);
});
});
});
diff --git a/tests/embind/embind_test.cpp b/tests/embind/embind_test.cpp
index 2746e114..0b3f67e9 100644
--- a/tests/embind/embind_test.cpp
+++ b/tests/embind/embind_test.cpp
@@ -2345,7 +2345,10 @@ val construct_with_6(val factory) {
val construct_with_memory_view(val factory) {
static const char data[11] = "0123456789";
- return factory.new_(memory_view(10, data));
+ return factory.new_(
+ std::string("before"),
+ memory_view(10, data),
+ std::string("after"));
}
EMSCRIPTEN_BINDINGS(val_new_) {