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

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

#
Ruby | 38 lines | 22 code | 8 blank | 8 comment | 12 complexity | 7c40f425b98e3b072fee82a0c3064551 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 'li_factory'
  11. circle = Li_factory::Geometry.create(Li_factory::Geometry::CIRCLE)
  12. r = circle.radius()
  13. if (r != 1.5)
  14. raise RuntimeError, "Invalid value for r"
  15. end
  16. new_circle = circle.clone()
  17. r = new_circle.radius()
  18. if (r != 1.5)
  19. raise RuntimeError, "Invalid value for r"
  20. end
  21. point = Li_factory::Geometry.create(Li_factory::Geometry::POINT)
  22. w = point.width()
  23. if (w != 1.0)
  24. raise RuntimeError, "Invalid value for w"
  25. end
  26. new_point = point.clone()
  27. w = new_point.width()
  28. if (w != 1.0)
  29. raise RuntimeError, "Invalid value for w"
  30. end