PageRenderTime 10ms CodeModel.GetById 2ms app.highlight 6ms RepoModel.GetById 1ms 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
 1#!/usr/bin/env ruby
 2#
 3# Put description here
 4#
 5# 
 6# 
 7# 
 8#
 9
10require 'swig_assert'
11
12require 'li_carrays'
13
14include Li_carrays
15
16#
17# Testing for %array_functions(int,intArray)
18#
19ary = new_intArray(2)
20intArray_setitem(ary, 0, 0)
21intArray_setitem(ary, 1, 1)
22intArray_getitem(ary, 0)
23intArray_getitem(ary, 1)
24delete_intArray(ary)
25
26#
27# Testing for %array_class(double, doubleArray)
28#
29ary = DoubleArray.new(2)
30ary[0] = 0.0
31ary[1] = 1.0
32ary[0]
33ary[1]
34ptr = ary.cast
35ary2 = DoubleArray.frompointer(ptr)
36