diff options
-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); |