[python] Fix inheriting from multiple director classes
Fix mishandling of a Python class inheriting from multiple SWIG-wrapped director classes. Fixes #422 Fixes https://sourceforge.net/p/swig/bugs/1379/
This commit is contained in:
parent
8a03c7d555
commit
e23d912b49
4 changed files with 112 additions and 0 deletions
|
|
@ -0,0 +1,36 @@
|
|||
import director_multiple_inheritance as st
|
||||
|
||||
class TestBCD(st.B, st.C, st.D):
|
||||
def __init__(self):
|
||||
st.B.__init__(self)
|
||||
st.C.__init__(self)
|
||||
st.D.__init__(self)
|
||||
|
||||
class TestBDC(st.B, st.C, st.D):
|
||||
def __init__(self):
|
||||
st.B.__init__(self)
|
||||
st.D.__init__(self)
|
||||
st.C.__init__(self)
|
||||
|
||||
class TestCBD(st.B, st.C, st.D):
|
||||
def __init__(self):
|
||||
st.C.__init__(self)
|
||||
st.B.__init__(self)
|
||||
st.D.__init__(self)
|
||||
|
||||
def dotest(test):
|
||||
e = st.E()
|
||||
if e.testE(test) != 5:
|
||||
raise RuntimeError(e.testE(test))
|
||||
|
||||
f = st.F()
|
||||
if f.testF(test) != 6:
|
||||
raise RuntimeError(f.testF(test))
|
||||
|
||||
t = st.T()
|
||||
if t.testT(test) != 20:
|
||||
raise RuntimeError(t.testT(test))
|
||||
|
||||
dotest(TestBCD())
|
||||
dotest(TestCBD())
|
||||
dotest(TestBDC())
|
||||
Loading…
Add table
Add a link
Reference in a new issue