summaryrefslogtreecommitdiff
path: root/Examples/test-suite/python/template_typedef_runme.py
blob: 16695bada4ed254f12f0373c419d7aa105882983 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
from template_typedef import *

d = make_Identity_float()
c = make_Identity_reald()


try:
    a = d.this
    a = c.this
except:
    raise RuntimeError

try:
    e = make_Multiplies_float_float_float_float(d, d)
    a = e.this
except:
    print e, "is not an instance"
    raise RuntimeError

try:
    f = make_Multiplies_reald_reald_reald_reald(c, c)
    a = f.this
except:
    print f, "is not an instance"
    raise RuntimeError

try:
    g = make_Multiplies_float_float_reald_reald(d, c)
    a = g.this
except:
    print g, "is not an instance"
    raise RuntimeError


# the old large format
if not SWIG_TypeQuery("vfncs::ArithUnaryFunction<vfncs::arith_traits<float,double>::argument_type,vfncs::arith_traits<float,double >::result_type > *"):
    raise RuntimeError


# the reduced format
if not SWIG_TypeQuery("vfncs::ArithUnaryFunction<double,double> *"):
    raise RuntimeError

# this is a bad name
if SWIG_TypeQuery("vfncs::ArithUnaryFunction<double,doublex> *"):
    raise RuntimeError