summaryrefslogtreecommitdiff
path: root/Examples/test-suite/python/template_typedef_cplx2_runme.py
blob: 161bd51fc81d31ea97378ca9426a9dc97bd7015e (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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
from template_typedef_cplx2 import *

#
# double case
#

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

s = "%s" % d
if str.find(s, "ArithUnaryFunction") == -1:
    print d, "is not an ArithUnaryFunction"
    raise RuntimeError

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

s = "%s" % e
if str.find(s, "ArithUnaryFunction") == -1:
    print e, "is not an ArithUnaryFunction"
    raise RuntimeError


#
# complex case
#

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

s = "%s" % c
if str.find(s, "ArithUnaryFunction") == -1:
    print c, "is not an ArithUnaryFunction"
    raise RuntimeError

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

s = "%s" % f
if str.find(s, "ArithUnaryFunction") == -1:
    print f, "is not an ArithUnaryFunction"
    raise RuntimeError

#
# Mix case
#

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

s = "%s" % g
if str.find(s, "ArithUnaryFunction") == -1:
    print g, "is not an ArithUnaryFunction"
    raise RuntimeError


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

s = "%s" % h
if str.find(s, "ArithUnaryFunction") == -1:
    print h, "is not an ArithUnaryFunction"
    raise RuntimeError

try:
    a = g.get_value()
except:
    print g, "has not get_value() method"
    raise RuntimeError