/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
- #!/usr/bin/env ruby
- #
- # Put description here
- #
- #
- #
- #
- #
- require 'swig_assert'
- require 'li_carrays'
- include Li_carrays
- #
- # Testing for %array_functions(int,intArray)
- #
- ary = new_intArray(2)
- intArray_setitem(ary, 0, 0)
- intArray_setitem(ary, 1, 1)
- intArray_getitem(ary, 0)
- intArray_getitem(ary, 1)
- delete_intArray(ary)
- #
- # Testing for %array_class(double, doubleArray)
- #
- ary = DoubleArray.new(2)
- ary[0] = 0.0
- ary[1] = 1.0
- ary[0]
- ary[1]
- ptr = ary.cast
- ary2 = DoubleArray.frompointer(ptr)