PageRenderTime 28ms CodeModel.GetById 16ms app.highlight 9ms RepoModel.GetById 1ms app.codeStats 1ms

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

#
Ruby | 36 lines | 19 code | 9 blank | 8 comment | 2 complexity | 934935c6e6fc32f4390952c28bf8c718 MD5 | raw file
 1#!/usr/bin/env ruby
 2#
 3# Put description here
 4#
 5# 
 6# 
 7# 
 8#
 9
10require 'swig_assert'
11
12require 'array_member'
13
14include Array_member
15
16f = Foo.new
17f.data = Array_member.global_data
18
190.upto(7) { |i|
20  unless get_value(f.data, i) == get_value(Array_member.global_data, i)
21    raise RuntimeError, "Bad array assignment"
22  end
23}
24
250.upto(7) { |i|
26  set_value(f.data, i, -i)
27}
28
29Array_member.global_data = f.data
30
310.upto(7) { |i|
32  unless get_value(f.data, i) == get_value(Array_member.global_data, i)
33    raise RuntimeError, "Bad array assignment"
34  end
35}
36