PageRenderTime 43ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

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

#
Python | 82 lines | 56 code | 26 blank | 0 comment | 26 complexity | 6865fe266523db98a8e3e10cbc910fa9 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. from namespace_typemap import *
  2. if stest1("hello") != "hello":
  3. raise RuntimeError
  4. if stest2("hello") != "hello":
  5. raise RuntimeError
  6. if stest3("hello") != "hello":
  7. raise RuntimeError
  8. if stest4("hello") != "hello":
  9. raise RuntimeError
  10. if stest5("hello") != "hello":
  11. raise RuntimeError
  12. if stest6("hello") != "hello":
  13. raise RuntimeError
  14. if stest7("hello") != "hello":
  15. raise RuntimeError
  16. if stest8("hello") != "hello":
  17. raise RuntimeError
  18. if stest9("hello") != "hello":
  19. raise RuntimeError
  20. if stest10("hello") != "hello":
  21. raise RuntimeError
  22. if stest11("hello") != "hello":
  23. raise RuntimeError
  24. if stest12("hello") != "hello":
  25. raise RuntimeError
  26. c = complex(2,3)
  27. r = c.real
  28. if ctest1(c) != r:
  29. raise RuntimeError
  30. if ctest2(c) != r:
  31. raise RuntimeError
  32. if ctest3(c) != r:
  33. raise RuntimeError
  34. if ctest4(c) != r:
  35. raise RuntimeError
  36. if ctest5(c) != r:
  37. raise RuntimeError
  38. if ctest6(c) != r:
  39. raise RuntimeError
  40. if ctest7(c) != r:
  41. raise RuntimeError
  42. if ctest8(c) != r:
  43. raise RuntimeError
  44. if ctest9(c) != r:
  45. raise RuntimeError
  46. if ctest10(c) != r:
  47. raise RuntimeError
  48. if ctest11(c) != r:
  49. raise RuntimeError
  50. if ctest12(c) != r:
  51. raise RuntimeError
  52. try:
  53. ttest1(-14)
  54. raise RuntimeError
  55. except ValueError:
  56. pass