fix director + abstract + constructors, reported by Brian Kelley
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6478 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
f7ae968d6b
commit
df9fa977a8
9 changed files with 258 additions and 38 deletions
|
|
@ -16,15 +16,47 @@ if a.pong() != "Foo::pong();MyFoo::ping()":
|
|||
raise RuntimeError, a.pong()
|
||||
|
||||
|
||||
class MyExample(director_abstract.Example1):
|
||||
def __init__(self):
|
||||
director_abstract.Example1.__init__(self)
|
||||
pass
|
||||
|
||||
class MyExample1(director_abstract.Example1):
|
||||
def Color(self, r, g, b):
|
||||
return r
|
||||
|
||||
me = MyExample()
|
||||
class MyExample2(director_abstract.Example2):
|
||||
def Color(self, r, g, b):
|
||||
return g
|
||||
|
||||
print me.Color(1,2,3)
|
||||
class MyExample3(director_abstract.Example3_i):
|
||||
def Color(self, r, g, b):
|
||||
return b
|
||||
|
||||
me1 = MyExample1()
|
||||
if MyExample1.get_color(me1, 1,2,3) != 1:
|
||||
raise RuntimeError
|
||||
|
||||
me2 = MyExample2(1,2)
|
||||
if MyExample2.get_color(me2, 1,2,3) != 2:
|
||||
raise RuntimeError
|
||||
|
||||
me3 = MyExample3()
|
||||
if MyExample3.get_color(me3, 1,2,3) != 3:
|
||||
raise RuntimeError
|
||||
|
||||
error = 1
|
||||
try:
|
||||
me1 = director_abstract.Example1()
|
||||
except:
|
||||
error = 0
|
||||
if (error): raise RuntimeError
|
||||
|
||||
error = 1
|
||||
try:
|
||||
me2 = director_abstract.Example2()
|
||||
except:
|
||||
error = 0
|
||||
if (error): raise RuntimeError
|
||||
|
||||
error = 1
|
||||
try:
|
||||
me3 = director_abstract.Example3_i()
|
||||
except:
|
||||
error = 0
|
||||
if (error): raise RuntimeError
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue