PageRenderTime 47ms CodeModel.GetById 26ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/rel-1.3.35/Examples/test-suite/ruby/bools_runme.rb

#
Ruby | 82 lines | 54 code | 17 blank | 11 comment | 26 complexity | dfae08d1ca447e9951051c0c2aa130c6 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. #!/usr/bin/env ruby
  2. #
  3. # Put description here
  4. #
  5. #
  6. #
  7. #
  8. #
  9. require 'swig_assert'
  10. require 'bools'
  11. # bool constant check
  12. if (Bools::Constbool != false)
  13. print "Runtime test 1 failed\n"
  14. exit 1
  15. end
  16. # bool variables check
  17. if (Bools.bool1 != true)
  18. print "Runtime test 2 failed\n"
  19. exit 1
  20. end
  21. if (Bools.bool2 != false)
  22. print "Runtime test 3 failed\n"
  23. exit 1
  24. end
  25. if (Bools.value(Bools.pbool) != Bools.bool1)
  26. print "Runtime test 4 failed\n"
  27. exit 1
  28. end
  29. if (Bools.value(Bools.rbool) != Bools.bool2)
  30. print "Runtime test 5 failed\n"
  31. exit 1
  32. end
  33. if (Bools.value(Bools.const_pbool) != Bools.bool1)
  34. print "Runtime test 6 failed\n"
  35. exit 1
  36. end
  37. if (Bools.const_rbool != Bools.bool2)
  38. print "Runtime test 7 failed\n"
  39. exit 1
  40. end
  41. # bool functions check
  42. if (Bools.bo(false) != false)
  43. print "Runtime test 8 failed\n"
  44. exit 1
  45. end
  46. if (Bools.bo(true) != true)
  47. print "Runtime test 9 failed\n"
  48. exit 1
  49. end
  50. if (Bools.value(Bools.rbo(Bools.rbool)) != Bools.value(Bools.rbool))
  51. print "Runtime test 10 failed\n"
  52. exit 1
  53. end
  54. if (Bools.value(Bools.pbo(Bools.pbool)) != Bools.value(Bools.pbool))
  55. print "Runtime test 11 failed\n"
  56. exit 1
  57. end
  58. if (Bools.const_rbo(Bools.const_rbool) != Bools.const_rbool)
  59. print "Runtime test 12 failed\n"
  60. exit 1
  61. end
  62. if (Bools.value(Bools.const_pbo(Bools.const_pbool)) != Bools.value(Bools.const_pbool))
  63. print "Runtime test 13 failed\n"
  64. exit 1
  65. end