PageRenderTime 11ms CodeModel.GetById 1ms app.highlight 8ms RepoModel.GetById 1ms app.codeStats 0ms

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

#
Ruby | 45 lines | 28 code | 9 blank | 8 comment | 4 complexity | e4b8847dc34e8c94d6a715fc8531afee MD5 | raw file
 1#!/usr/bin/env ruby
 2#
 3# Put script description here.
 4#
 5# 
 6# 
 7# 
 8#
 9
10require 'swig_assert'
11require 'apply_signed_char'
12
13include Apply_signed_char
14
15
16['CharValFunction', 'CCharValFunction', 'CCharRefFunction'].each do |m|
17  [ 3, -3 ].each do |v|
18    val = send( m, v )
19    swig_assert( "v == val", binding, "for #{m}")
20  end
21end
22
23{ 'globalchar' => -109,
24  'globalconstchar' => -110,
25}.each do |k,v|
26  val = Apply_signed_char.send( k )
27  swig_assert( "v == val", binding, "for #{k}")
28end
29
30
31a = DirectorTest.new
32
33['CharValFunction', 'CCharValFunction', 'CCharRefFunction'].each do |m|
34  [ 3, -3 ].each do |v|
35    val = a.send( m, v )
36    swig_assert( "v == val", binding, "for DirectorTest.#{m}")
37  end
38end
39
40{ 'memberchar' => -111,
41  'memberconstchar' => -112,
42}.each do |k,v|
43  val = a.send( k )
44  swig_assert( "v == val", binding, "for #{k}")
45end