From 22d2a0fcd2729d9c0c8d53e59471432ddf206b6a Mon Sep 17 00:00:00 2001 From: Nikolay Vorobyov Date: Wed, 18 Jun 2014 16:44:03 +0300 Subject: Added embind support for std::unique_ptr --- tests/embind/embind.test.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests/embind/embind.test.js') diff --git a/tests/embind/embind.test.js b/tests/embind/embind.test.js index 432202ff..f1de1a12 100644 --- a/tests/embind/embind.test.js +++ b/tests/embind/embind.test.js @@ -604,6 +604,18 @@ module({ c.delete(); }); + test("can pass unique_ptr", function() { + var p = cm.embind_test_return_unique_ptr(42); + var m = cm.embind_test_accept_unique_ptr(p); + assert.equal(42, m); + }); + + test("can pass unique_ptr to constructor", function() { + var c = new cm.embind_test_construct_class_with_unique_ptr(42); + assert.equal(42, c.getValue()); + c.delete(); + }); + test("can get member classes then call its member functions", function() { var p = new cm.ParentClass(); var c = p.getBigClass(); -- cgit v1.2.3-18-g5258