diff --git a/SWIG/Examples/test-suite/abstract_typedef2.i b/SWIG/Examples/test-suite/abstract_typedef2.i new file mode 100644 index 000000000..83a768842 --- /dev/null +++ b/SWIG/Examples/test-suite/abstract_typedef2.i @@ -0,0 +1,31 @@ +%module abstract_typedef2 + + /* + After the fix for abstract_typedef, this simpler + example got broken. + */ + +%inline %{ + + struct Engine + { + }; + + struct Object + { + virtual bool write(Engine& archive) const = 0; + }; + + + class A : public Object + { + A(int a = 0) + { + } + + bool write(Engine& archive) const + { + return true; + } + }; +%} diff --git a/SWIG/Examples/test-suite/common.mk b/SWIG/Examples/test-suite/common.mk index 7427beff7..c973b5921 100644 --- a/SWIG/Examples/test-suite/common.mk +++ b/SWIG/Examples/test-suite/common.mk @@ -42,6 +42,7 @@ DYNAMIC_LIB_PATH = $(RUNTIMEDIR):. # Broken C++ test cases. (Can be run individually using make testcase.cpptest.) CPP_TEST_BROKEN += \ + abstract_typedef2 \ cast_operator \ arrayref \ namespace_nested \ diff --git a/SWIG/Examples/test-suite/python/abstract_typedef2_runme.py b/SWIG/Examples/test-suite/python/abstract_typedef2_runme.py new file mode 100644 index 000000000..81ef27b50 --- /dev/null +++ b/SWIG/Examples/test-suite/python/abstract_typedef2_runme.py @@ -0,0 +1,11 @@ +from abstract_typedef2 import * +e = Engine() + +a = A() + + +if a.write(e) != 1: + raise RuntimeError + + +