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