diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-04-29 15:29:48 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-04-29 15:29:48 -0700 |
commit | d3cf5d84ecfd5218b6f570860b0a92c7eb1be0eb (patch) | |
tree | bb26cbb538250aa6d65e9cedea447a9c731865f5 /tests/embind/embind.test.js | |
parent | d5cf59ac87b14eee47e229fe0543c8faa27a2ff4 (diff) | |
parent | 6c1b114fa5078dcac3f6617a6f890f0106fcf090 (diff) |
Merge pull request #2326 from polymeris/incoming
Bind std::basic_string<unsigned char> to js strings based on incoming
Diffstat (limited to 'tests/embind/embind.test.js')
-rw-r--r-- | tests/embind/embind.test.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/embind/embind.test.js b/tests/embind/embind.test.js index 6bba4de0..3ded811a 100644 --- a/tests/embind/embind.test.js +++ b/tests/embind/embind.test.js @@ -442,6 +442,21 @@ module({ var e = cm.emval_test_take_and_return_std_string((new Int8Array([65, 66, 67, 68])).buffer); assert.equal('ABCD', e); }); + + test("can pass Uint8Array to std::basic_string<unsigned char>", function() { + var e = cm.emval_test_take_and_return_std_basic_string_unsigned_char(new Uint8Array([65, 66, 67, 68])); + assert.equal('ABCD', e); + }); + + test("can pass Int8Array to std::basic_string<unsigned char>", function() { + var e = cm.emval_test_take_and_return_std_basic_string_unsigned_char(new Int8Array([65, 66, 67, 68])); + assert.equal('ABCD', e); + }); + + test("can pass ArrayBuffer to std::basic_string<unsigned char>", function() { + var e = cm.emval_test_take_and_return_std_basic_string_unsigned_char((new Int8Array([65, 66, 67, 68])).buffer); + assert.equal('ABCD', e); + }); test("non-ascii wstrings", function() { var expected = String.fromCharCode(10) + |