4 helloInt = template_default_arg.Hello_int();
5 helloInt.foo(template_default_arg.Hello_int_hi);
8 x = template_default_arg.X_int();
9 if (x.meth(20.0, 200) != 200)
10 error("X_int test 1 failed")
13 error("X_int test 2 failed")
16 error("X_int test 3 failed")
21 y = template_default_arg.Y_unsigned();
22 if (y.meth(20.0, 200) != 200)
23 error("Y_unsigned test 1 failed")
26 error("Y_unsigned test 2 failed")
29 error("Y_unsigned test 3 failed")
34 x = template_default_arg.X_longlong();
35 x = template_default_arg.X_longlong(20.0);
36 x = template_default_arg.X_longlong(20.0, 200);
39 x = template_default_arg.X_int();
40 x = template_default_arg.X_int(20.0);
41 x = template_default_arg.X_int(20.0, 200);
44 x = template_default_arg.X_hello_unsigned();
45 x = template_default_arg.X_hello_unsigned(20.0);
46 x = template_default_arg.X_hello_unsigned(20.0, template_default_arg.Hello_int());
49 y = template_default_arg.Y_hello_unsigned();
50 y.meth(20.0, template_default_arg.Hello_int());
51 y.meth(template_default_arg.Hello_int());
56 fz = template_default_arg.Foo_Z_8();
57 x = template_default_arg.X_Foo_Z_8();
63 # plain function: int ott(Foo<int>)
64 if (template_default_arg.ott(template_default_arg.Foo_int()) != 30)
65 error("ott test 1 failed")
68 # %template(ott) ott<int, int>
69 if (template_default_arg.ott() != 10)
70 error("ott test 2 failed")
72 if (template_default_arg.ott(1) != 10)
73 error("ott test 3 failed")
75 if (template_default_arg.ott(1, 1) != 10)
76 error("ott test 4 failed")
79 if (template_default_arg.ott("hi") != 20)
80 error("ott test 5 failed")
82 if (template_default_arg.ott("hi", 1) != 20)
83 error("ott test 6 failed")
85 if (template_default_arg.ott("hi", 1, 1) != 20)
86 error("ott test 7 failed")
89 # %template(ott) ott<const char *>
90 if (template_default_arg.ottstring(template_default_arg.Hello_int(), "hi") != 40)
91 error("ott test 8 failed")
94 if (template_default_arg.ottstring(template_default_arg.Hello_int()) != 40)
95 error("ott test 9 failed")
98 # %template(ott) ott<int>
99 if (template_default_arg.ottint(template_default_arg.Hello_int(), 1) != 50)
100 error("ott test 10 failed")
103 if (template_default_arg.ottint(template_default_arg.Hello_int()) != 50)
104 error("ott test 11 failed")
107 # %template(ott) ott<double>
108 if (template_default_arg.ott(template_default_arg.Hello_int(), 1.0) != 60)
109 error("ott test 12 failed")
112 if (template_default_arg.ott(template_default_arg.Hello_int()) != 60)
113 error("ott test 13 failed")