swig/Examples/test-suite/python/pointer_reference_runme.py
William S Fulton d4ffa46f41 Convert python tests using 2to3
These tests were converted using 2to3 and should be valid using
Python 2.7 and Python 3+.
2020-08-15 00:16:04 +01:00

16 lines
461 B
Python

import pointer_reference
s = pointer_reference.get()
if s.value != 10:
raise RuntimeError("get test failed")
ss = pointer_reference.Struct(20)
pointer_reference.set(ss)
if pointer_reference.cvar.Struct_instance.value != 20:
raise RuntimeError("set test failed")
if pointer_reference.overloading(1) != 111:
raise RuntimeError("overload test 1 failed")
if pointer_reference.overloading(ss) != 222:
raise RuntimeError("overload test 2 failed")