/trunk/Examples/test-suite/python/template_typedef_runme.py
Python | 46 lines | 32 code | 11 blank | 3 comment | 5 complexity | 8507ffef6846deba9c44e536f9260d64 MD5 | raw file
1from template_typedef import * 2 3d = make_Identity_float() 4c = make_Identity_reald() 5 6 7try: 8 a = d.this 9 a = c.this 10except: 11 raise RuntimeError 12 13try: 14 e = make_Multiplies_float_float_float_float(d, d) 15 a = e.this 16except: 17 print e, "is not an instance" 18 raise RuntimeError 19 20try: 21 f = make_Multiplies_reald_reald_reald_reald(c, c) 22 a = f.this 23except: 24 print f, "is not an instance" 25 raise RuntimeError 26 27try: 28 g = make_Multiplies_float_float_reald_reald(d, c) 29 a = g.this 30except: 31 print g, "is not an instance" 32 raise RuntimeError 33 34 35# the old large format 36if not SWIG_TypeQuery("vfncs::ArithUnaryFunction<vfncs::arith_traits<float,double>::argument_type,vfncs::arith_traits<float,double >::result_type > *"): 37 raise RuntimeError 38 39 40# the reduced format 41if not SWIG_TypeQuery("vfncs::ArithUnaryFunction<double,double> *"): 42 raise RuntimeError 43 44# this is a bad name 45if SWIG_TypeQuery("vfncs::ArithUnaryFunction<double,doublex> *"): 46 raise RuntimeError