diff options
author | Chad Austin <chad@imvu.com> | 2014-05-02 15:21:22 -0700 |
---|---|---|
committer | Bruce Mitchener <bruce.mitchener@gmail.com> | 2014-05-21 22:56:20 +0700 |
commit | 6ce9851175ef56f894bd537fbf871c363f8bd402 (patch) | |
tree | c8e9403e98b2cfbe15be24682d281822b18a1889 /tests | |
parent | 755444d1a4ca561b53add3d4660864b465cd252d (diff) |
concrete methods are accessible externally. also rethink some other tests.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/embind/embind.test.js | 19 | ||||
-rw-r--r-- | tests/embind/embind_test.cpp | 5 |
2 files changed, 20 insertions, 4 deletions
diff --git a/tests/embind/embind.test.js b/tests/embind/embind.test.js index e9ccc673..d42e66d2 100644 --- a/tests/embind/embind.test.js +++ b/tests/embind/embind.test.js @@ -1686,9 +1686,23 @@ module({ assert.equal("xyz", result); }); + test("interface methods are externally visible", function() { + var instance = new Empty; + var result = instance.concreteMethod(); + instance.delete(); + assert.equal("concrete", result); + }); + /* ENABLE THESE AS THEY PASS - test("interface methods are externally visible", function() { + test("optional methods are externally visible", function() { + var instance = new Empty; + var result = instance.optionalMethod("_123"); + instance.delete(); + assert.equal("optional_123", result); + }); + + test("optional methods", function() { var instance = new Empty; var result = cm.callOptionalMethod(instance, "_123"); instance.delete(); @@ -1707,9 +1721,6 @@ module({ instance.delete(); assert.equal("optionaljs_optional_123", result); }); - - test("extend extended class", function() { - }); */ test("instanceof", function() { diff --git a/tests/embind/embind_test.cpp b/tests/embind/embind_test.cpp index 52103bbb..8152fab0 100644 --- a/tests/embind/embind_test.cpp +++ b/tests/embind/embind_test.cpp @@ -1090,6 +1090,10 @@ public: virtual std::shared_ptr<Derived> returnsSharedPtr() = 0; virtual void differentArguments(int i, double d, unsigned char f, double q, std::string) = 0; + + std::string concreteMethod() const { + return "concrete"; + } }; EMSCRIPTEN_SYMBOL(optionalMethod); @@ -1158,6 +1162,7 @@ EMSCRIPTEN_BINDINGS(interface_tests) { .allow_subclass<AbstractClassWrapper>("AbstractClassWrapper") .function("abstractMethod", &AbstractClass::abstractMethod) .function("optionalMethod", &AbstractClass::optionalMethod) + .function("concreteMethod", &AbstractClass::concreteMethod) ; function("getAbstractClass", &getAbstractClass); |