PageRenderTime 22ms CodeModel.GetById 15ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Examples/test-suite/python/template_typedef_cplx_runme.py

#
Python | 87 lines | 61 code | 17 blank | 9 comment | 6 complexity | b24f3325e1d0350ff5b64077efcf3bfc MD5 | raw file
 1from template_typedef_cplx import *
 2
 3#
 4# double case
 5#
 6
 7try:
 8  d = make_Identity_double()
 9  a = d.this
10except:
11  print d, "is not an instance"
12  raise RuntimeError
13
14s = '%s' % d
15if str.find(s, 'ArithUnaryFunction') == -1:
16  print d, "is not an ArithUnaryFunction"
17  raise RuntimeError
18
19try:
20  e = make_Multiplies_double_double_double_double(d, d)
21  a = e.this
22except:
23  print e, "is not an instance"
24  raise RuntimeError
25
26s = '%s' % e
27if str.find(s, 'ArithUnaryFunction') == -1:
28  print e, "is not an ArithUnaryFunction"
29  raise RuntimeError
30
31
32#
33# complex case
34#
35
36try:
37  c = make_Identity_complex()
38  a = c.this
39except:
40  print c, "is not an instance"
41  raise RuntimeError
42
43s = '%s' % c
44if str.find(s, 'ArithUnaryFunction') == -1:
45  print c, "is not an ArithUnaryFunction"
46  raise RuntimeError
47
48try:
49  f = make_Multiplies_complex_complex_complex_complex(c, c)
50  a = f.this
51except:
52  print f, "is not an instance"
53  raise RuntimeError
54
55s = '%s' % f
56if str.find(s, 'ArithUnaryFunction') == -1:
57  print f, "is not an ArithUnaryFunction"
58  raise RuntimeError
59
60#
61# Mix case
62#
63
64try:
65  g = make_Multiplies_double_double_complex_complex(d, c)
66  a = g.this
67except:
68  print g, "is not an instance"
69  raise RuntimeError
70
71s = '%s' % g
72if str.find(s, 'ArithUnaryFunction') == -1:
73  print g, "is not an ArithUnaryFunction"
74  raise RuntimeError
75
76
77try:
78  h = make_Multiplies_complex_complex_double_double(c, d)
79  a = h.this
80except:
81  print h, "is not an instance"
82  raise RuntimeError
83
84s = '%s' % h
85if str.find(s, 'ArithUnaryFunction') == -1:
86  print h, "is not an ArithUnaryFunction"
87  raise RuntimeError