PageRenderTime 48ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

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

#
Python | 46 lines | 32 code | 11 blank | 3 comment | 7 complexity | 8507ffef6846deba9c44e536f9260d64 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. from template_typedef import *
  2. d = make_Identity_float()
  3. c = make_Identity_reald()
  4. try:
  5. a = d.this
  6. a = c.this
  7. except:
  8. raise RuntimeError
  9. try:
  10. e = make_Multiplies_float_float_float_float(d, d)
  11. a = e.this
  12. except:
  13. print e, "is not an instance"
  14. raise RuntimeError
  15. try:
  16. f = make_Multiplies_reald_reald_reald_reald(c, c)
  17. a = f.this
  18. except:
  19. print f, "is not an instance"
  20. raise RuntimeError
  21. try:
  22. g = make_Multiplies_float_float_reald_reald(d, c)
  23. a = g.this
  24. except:
  25. print g, "is not an instance"
  26. raise RuntimeError
  27. # the old large format
  28. if not SWIG_TypeQuery("vfncs::ArithUnaryFunction<vfncs::arith_traits<float,double>::argument_type,vfncs::arith_traits<float,double >::result_type > *"):
  29. raise RuntimeError
  30. # the reduced format
  31. if not SWIG_TypeQuery("vfncs::ArithUnaryFunction<double,double> *"):
  32. raise RuntimeError
  33. # this is a bad name
  34. if SWIG_TypeQuery("vfncs::ArithUnaryFunction<double,doublex> *"):
  35. raise RuntimeError