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

/trunk/Examples/test-suite/ruby/apply_signed_char_runme.rb

#
Ruby | 45 lines | 28 code | 9 blank | 8 comment | 4 complexity | e4b8847dc34e8c94d6a715fc8531afee 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 script description here.
  4. #
  5. #
  6. #
  7. #
  8. #
  9. require 'swig_assert'
  10. require 'apply_signed_char'
  11. include Apply_signed_char
  12. ['CharValFunction', 'CCharValFunction', 'CCharRefFunction'].each do |m|
  13. [ 3, -3 ].each do |v|
  14. val = send( m, v )
  15. swig_assert( "v == val", binding, "for #{m}")
  16. end
  17. end
  18. { 'globalchar' => -109,
  19. 'globalconstchar' => -110,
  20. }.each do |k,v|
  21. val = Apply_signed_char.send( k )
  22. swig_assert( "v == val", binding, "for #{k}")
  23. end
  24. a = DirectorTest.new
  25. ['CharValFunction', 'CCharValFunction', 'CCharRefFunction'].each do |m|
  26. [ 3, -3 ].each do |v|
  27. val = a.send( m, v )
  28. swig_assert( "v == val", binding, "for DirectorTest.#{m}")
  29. end
  30. end
  31. { 'memberchar' => -111,
  32. 'memberconstchar' => -112,
  33. }.each do |k,v|
  34. val = a.send( k )
  35. swig_assert( "v == val", binding, "for #{k}")
  36. end