Even in the case of just creating a `DerivedClass` this test says: ``` swig/python detected a memory leak of type 'DerivedClass *', no destructor found. ``` even though the destructor is defined in the base class.
15 lines
332 B
Python
15 lines
332 B
Python
from abstract_basecast import *
|
|
|
|
def check(flag):
|
|
if not flag:
|
|
raise RuntimeError("Test failed")
|
|
|
|
derived = DerivedClass()
|
|
derived.g()
|
|
check(isinstance(derived, BaseClass))
|
|
check(isinstance(derived, DerivedClass))
|
|
|
|
base = derived.f()
|
|
base.g()
|
|
check(isinstance(base, BaseClass))
|
|
check(not isinstance(base, DerivedClass))
|