import source from 1.3.40
[external/swig.git] / Examples / test-suite / octave / template_typedef_runme.m
1 template_typedef
2
3 d = make_Identity_float();
4 c = make_Identity_reald();
5
6
7 try
8   a = swig_this(d);
9   a = swig_this(c);
10 catch
11   error
12 end_try_catch
13
14 try
15   e = make_Multiplies_float_float_float_float(d, d);
16   a = swig_this(e);
17 catch
18   e
19   error("is not an instance")
20 end_try_catch
21
22 try
23   f = make_Multiplies_reald_reald_reald_reald(c, c);
24   a = swig_this(f);
25 catch
26   f
27   error("is not an instance");
28 end_try_catch
29
30 try
31   g = make_Multiplies_float_float_reald_reald(d, c);
32   a = swig_this(g);
33 catch
34   error(g, "is not an instance")
35 end_try_catch
36
37
38 # the old large format
39 if (strcmp("<unknown>",swig_typequery("vfncs::ArithUnaryFunction<vfncs::arith_traits<float,double>::argument_type,vfncs::arith_traits<float,double >::result_type > *")))
40   error
41 endif
42
43 # the reduced format
44 if (strcmp("<unknown>",swig_typequery("vfncs::ArithUnaryFunction<double,double> *")))
45   error
46 endif
47
48 # this is a bad name
49 if (!strcmp("<unknown>",swig_typequery("vfncs::ArithUnaryFunction<double,doublex> *")))
50   error
51 endif