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