1 # Note: This example assumes that namespaces are flattened
4 n = cpp_namespace.fact(4)
6 raise RuntimeError("Bad return value!")
8 if cpp_namespace.cvar.Foo != 42:
9 raise RuntimeError("Bad variable value!")
11 t = cpp_namespace.Test()
12 if t.method() != "Test::method":
13 raise RuntimeError("Bad method return value!")
15 if cpp_namespace.do_method(t) != "Test::method":
16 raise RuntimeError("Bad return value!")
18 if cpp_namespace.do_method2(t) != "Test::method":
19 raise RuntimeError("Bad return value!")
21 cpp_namespace.weird("hello", 4)
25 t2 = cpp_namespace.Test2()
26 t3 = cpp_namespace.Test3()
27 t4 = cpp_namespace.Test4()
28 t5 = cpp_namespace.Test5()
30 if cpp_namespace.foo3(42) != 42:
31 raise RuntimeError("Bad return value!")
33 if cpp_namespace.do_method3(t2,40) != "Test2::method":
34 raise RuntimeError("Bad return value!")
36 if cpp_namespace.do_method3(t3,40) != "Test3::method":
37 raise RuntimeError("Bad return value!")
39 if cpp_namespace.do_method3(t4,40) != "Test4::method":
40 raise RuntimeError("Bad return value!")
42 if cpp_namespace.do_method3(t5,40) != "Test5::method":
43 raise RuntimeError("Bad return value!")