add more cases
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7686 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
5af71f22b3
commit
98d98784ae
6 changed files with 136 additions and 56 deletions
|
|
@ -1,16 +1,16 @@
|
|||
import director_basic
|
||||
|
||||
class MyFoo(director_basic.Foo):
|
||||
class PyFoo(director_basic.Foo):
|
||||
def ping(self):
|
||||
return "MyFoo::ping()"
|
||||
return "PyFoo::ping()"
|
||||
|
||||
|
||||
a = MyFoo()
|
||||
a = PyFoo()
|
||||
|
||||
if a.ping() != "MyFoo::ping()":
|
||||
if a.ping() != "PyFoo::ping()":
|
||||
raise RuntimeError, a.ping()
|
||||
|
||||
if a.pong() != "Foo::pong();MyFoo::ping()":
|
||||
if a.pong() != "Foo::pong();PyFoo::ping()":
|
||||
raise RuntimeError, a.pong()
|
||||
|
||||
b = director_basic.Foo()
|
||||
|
|
@ -26,3 +26,28 @@ a = director_basic.A1(1)
|
|||
if a.rg(2) != 2:
|
||||
raise RuntimeError
|
||||
|
||||
|
||||
|
||||
class PyClass(director_basic.MyClass):
|
||||
def vmethod(self, b):
|
||||
b.x += 31
|
||||
return b
|
||||
|
||||
|
||||
b = director_basic.Bar(3)
|
||||
d = director_basic.MyClass()
|
||||
c = PyClass()
|
||||
|
||||
cc = PyClass.get_self(c)
|
||||
dd = PyClass.get_self(d)
|
||||
|
||||
bc = cc.cmethod(b)
|
||||
bd = dd.cmethod(b)
|
||||
|
||||
if bc.x != 34:
|
||||
raise RuntimeError
|
||||
|
||||
|
||||
if bd.x != 16:
|
||||
raise RuntimeError
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue