PageRenderTime 46ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

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

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