diff --git a/SWIG/Examples/test-suite/director_nested.i b/SWIG/Examples/test-suite/director_nested.i index 6aea9da4d..3293ee6b3 100644 --- a/SWIG/Examples/test-suite/director_nested.i +++ b/SWIG/Examples/test-suite/director_nested.i @@ -60,6 +60,17 @@ { public: virtual C get_value() const = 0; + + virtual const char * get_name() + { + return "FooBar::get_name"; + } + + static FooBar *get_self(FooBar *a) + { + return a; + } + }; } diff --git a/SWIG/Examples/test-suite/python/director_nested_runme.py b/SWIG/Examples/test-suite/python/director_nested_runme.py index 0a1b8c11b..47505f629 100644 --- a/SWIG/Examples/test-suite/python/director_nested_runme.py +++ b/SWIG/Examples/test-suite/python/director_nested_runme.py @@ -24,7 +24,7 @@ class B(FooBar_int): return "B::do_step;" def get_value(self): - return "B::get_value" + return 1 pass @@ -34,3 +34,28 @@ b = B() if b.step() != "Bar::step;Foo::advance;B::do_advance;B::do_step;": raise RuntimeError,"Bad B virtual resolution" + + +class C(FooBar_int): + def do_advance(self): + return "C::do_advance;" + FooBar_int.do_advance(self) + + def do_step(self): + return "C::do_step;" + + def get_value(self): + return 2 + + def get_name(self): + return FooBar_int.get_name(self) + " hello" + + + pass + +cc = C() + +c = C.get_self(cc) +c.advance() +if c.get_name() != "FooBar::get_name hello": + raise RuntimeError +