Fixes to support protected members with director, proper virtual member recognition and support of the nodirector feature
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5485 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
46d70e8e1f
commit
75c1713b2d
13 changed files with 380 additions and 37 deletions
54
SWIG/Examples/test-suite/python/director_protected_runme.py
Normal file
54
SWIG/Examples/test-suite/python/director_protected_runme.py
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
from director_protected import *
|
||||
|
||||
|
||||
|
||||
class FooBar(Bar):
|
||||
def ping(self):
|
||||
return "FooBar::ping();"
|
||||
|
||||
|
||||
b = Bar()
|
||||
f = b.create()
|
||||
fb = FooBar()
|
||||
|
||||
try:
|
||||
s1 = b.pong()
|
||||
if s1 != "Bar::pong();Foo::pong();Bar::ping();":
|
||||
raise RuntimeError
|
||||
pass
|
||||
except:
|
||||
raise RuntimeError, "bad Bar::pong"
|
||||
|
||||
try:
|
||||
s2 = f.pong()
|
||||
if s2 != "Bar::pong();Foo::pong();Bar::ping();":
|
||||
raise RuntimeError
|
||||
pass
|
||||
except:
|
||||
raise RuntimeError," bad Foo::pong"
|
||||
|
||||
try:
|
||||
s3 = fb.pong()
|
||||
if s3 != "Bar::pong();Foo::pong();FooBar::ping();":
|
||||
raise RuntimeError
|
||||
pass
|
||||
except:
|
||||
raise RuntimeError," bad FooBar::pong"
|
||||
|
||||
private=1
|
||||
try:
|
||||
b.ping()
|
||||
private=0
|
||||
except:
|
||||
pass
|
||||
if not private:
|
||||
raise RuntimeError,"Boo::ping is private"
|
||||
|
||||
private=1
|
||||
try:
|
||||
f.ping()
|
||||
private=0
|
||||
except:
|
||||
pass
|
||||
if not private:
|
||||
raise RuntimeError,"Foo::ping is private"
|
||||
Loading…
Add table
Add a link
Reference in a new issue