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

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

#
Ruby | 36 lines | 16 code | 6 blank | 14 comment | 0 complexity | c8d9cdd202edc2437eca00055c8e5d44 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_carrays'
  11. include Li_carrays
  12. #
  13. # Testing for %array_functions(int,intArray)
  14. #
  15. ary = new_intArray(2)
  16. intArray_setitem(ary, 0, 0)
  17. intArray_setitem(ary, 1, 1)
  18. intArray_getitem(ary, 0)
  19. intArray_getitem(ary, 1)
  20. delete_intArray(ary)
  21. #
  22. # Testing for %array_class(double, doubleArray)
  23. #
  24. ary = DoubleArray.new(2)
  25. ary[0] = 0.0
  26. ary[1] = 1.0
  27. ary[0]
  28. ary[1]
  29. ptr = ary.cast
  30. ary2 = DoubleArray.frompointer(ptr)