~ubuntu-branches/ubuntu/hoary/swig1.3/hoary

« back to all changes in this revision

Viewing changes to Examples/test-suite/python/template_typedef_cplx2_runme.py

  • Committer: Bazaar Package Importer
  • Author(s): Thom May
  • Date: 2004-08-02 15:57:10 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040802155710-bm292q1d6x6tw7gc
Tags: 1.3.21-5ubuntu1
Fix linking for ruby, python, perl and tcl bindings

Show diffs side-by-side

added added

removed removed

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