summaryrefslogtreecommitdiff
path: root/Examples/test-suite/python/cpp11_type_aliasing_runme.py
diff options
context:
space:
mode:
Diffstat (limited to 'Examples/test-suite/python/cpp11_type_aliasing_runme.py')
-rw-r--r--Examples/test-suite/python/cpp11_type_aliasing_runme.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/Examples/test-suite/python/cpp11_type_aliasing_runme.py b/Examples/test-suite/python/cpp11_type_aliasing_runme.py
new file mode 100644
index 000000000..52cc81d1c
--- /dev/null
+++ b/Examples/test-suite/python/cpp11_type_aliasing_runme.py
@@ -0,0 +1,32 @@
+from cpp11_type_aliasing import *
+
+if get_host_target().bits != 32:
+ raise RuntimeError("get_host_target().bits should return 32")
+
+if mult2(10) != 20:
+ raise RuntimeError("mult2(10) should return 20")
+
+int_ptr = allocate_int()
+inplace_mult2(int_ptr)
+if read_int(int_ptr) != 24:
+ raise RuntimeError("read_int should return 24")
+free_int(int_ptr)
+
+pair = PairSubclass(3, 4)
+if pair.first() != 3:
+ raise RuntimeError("pair.first() should return 3")
+
+if pair.second() != 4:
+ raise RuntimeError("pair.second() should return 4")
+
+if pair.a != 3:
+ raise RuntimeError("pair.a should be 3")
+
+if plus1(5) != 6:
+ raise RuntimeError("plus1(5) should return 6")
+
+if call(mult2_cb, 7) != 14:
+ raise RuntimeError("call(mult2_cb, 7) should return 14")
+
+if call(get_callback(), 7) != 14:
+ raise RuntimeError("call(get_callback(), 7) should return 14")