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

/tags/rel-1-3-25/SWIG/Examples/test-suite/ruby/constover_runme.rb

#
Ruby | 44 lines | 34 code | 10 blank | 0 comment | 12 complexity | 3795e3afaf7d513e0c53ffa8723812a6 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. require 'constover'
  2. error = 0
  3. p = Constover.test("test")
  4. if p != "test"
  5. puts "test failed!"
  6. error = 1
  7. end
  8. p = Constover.test_pconst("test")
  9. if p != "test_pconst"
  10. puts "test_pconst failed!"
  11. error = 1
  12. end
  13. f = Constover::Foo.new
  14. p = f.test("test")
  15. if p != "test"
  16. print "member-test failed!"
  17. error = 1
  18. end
  19. p = f.test_pconst("test")
  20. if p != "test_pconst"
  21. print "member-test_pconst failed!"
  22. error = 1
  23. end
  24. p = f.test_constm("test")
  25. if p != "test_constmethod"
  26. print "member-test_constm failed!"
  27. error = 1
  28. end
  29. p = f.test_pconstm("test")
  30. if p != "test_pconstmethod"
  31. print "member-test_pconstm failed!"
  32. error = 1
  33. end
  34. exit(error)