diff options
Diffstat (limited to 'Examples/test-suite/python/director_pass_by_value_runme.py')
-rw-r--r-- | Examples/test-suite/python/director_pass_by_value_runme.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Examples/test-suite/python/director_pass_by_value_runme.py b/Examples/test-suite/python/director_pass_by_value_runme.py new file mode 100644 index 000000000..7744db962 --- /dev/null +++ b/Examples/test-suite/python/director_pass_by_value_runme.py @@ -0,0 +1,13 @@ +import director_pass_by_value + +passByVal = None +class director_pass_by_value_Derived(director_pass_by_value.DirectorPassByValueAbstractBase): + def virtualMethod(self, b): + global passByVal + passByVal = b + +# bug was the passByVal global object was destroyed after the call to virtualMethod had finished. +director_pass_by_value.Caller().call_virtualMethod(director_pass_by_value_Derived()) +ret = passByVal.getVal(); +if ret != 0x12345678: + raise RuntimeError("Bad return value, got " + hex(ret)) |