summaryrefslogtreecommitdiff
path: root/Examples/test-suite/python/template_typedef_cplx2_runme.py
blob: 23f19efb92029d053c5396b8aa7b337c4cfb84ed (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
from template_typedef_cplx2 import *

#
# double case
#

try:
    d = make_Identity_double()
    a = d.this
except:
    raise RuntimeError("{} is not an instance".format(d))

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

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

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


#
# complex case
#

try:
    c = make_Identity_complex()
    a = c.this
except:
    raise RuntimeError("{} is not an instance".format(c))

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

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

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

#
# Mix case
#

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

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


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

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

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