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

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

#
Ruby | 39 lines | 21 code | 10 blank | 8 comment | 9 complexity | f1ac7dd6f3b9fef326d63b3b013f23da 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 'ruby_track_objects_directors'
  11. class MyFoo < Ruby_track_objects_directors::Foo
  12. def ping
  13. "MyFoo::ping()"
  14. end
  15. end
  16. a = MyFoo.new
  17. raise RuntimeError if a.ping != "MyFoo::ping()"
  18. raise RuntimeError if a.pong != "Foo::pong();MyFoo::ping()"
  19. b = Ruby_track_objects_directors::Foo.new
  20. raise RuntimeError if b.ping != "Foo::ping()"
  21. raise RuntimeError if b.pong != "Foo::pong();Foo::ping()"
  22. container = Ruby_track_objects_directors::Container.new
  23. foo = MyFoo.new
  24. container.set_foo(foo)
  25. myFoo1 = container.get_foo
  26. myFoo2 = container.get_foo
  27. if not myFoo1.equal?(myFoo2)
  28. raise RuntimeError, "MyFoo's should be the same"
  29. end