Added some runtime tests for ruby.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9693 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Gonzalo Garramuno 2007-04-28 15:52:50 +00:00
commit 5be075f16f
7 changed files with 255 additions and 0 deletions

View file

@ -0,0 +1,45 @@
#!/usr/bin/env ruby
#
# Put script description here.
#
# Author:: gga
# Copyright:: 2007
# License:: Ruby
#
require 'swig_assert'
require 'apply_signed_char'
include Apply_signed_char
['CharValFunction', 'CCharValFunction', 'CCharRefFunction'].each do |m|
[ 3, -3 ].each do |v|
val = send( m, v )
swig_assert( v == val, "for #{m} #{val} == #{v} ")
end
end
{ 'globalchar' => -109,
'globalconstchar' => -110,
}.each do |k,v|
val = Apply_signed_char.send( k )
swig_assert( v == val, "for #{k} #{val} == #{v} ")
end
a = DirectorTest.new
['CharValFunction', 'CCharValFunction', 'CCharRefFunction'].each do |m|
[ 3, -3 ].each do |v|
val = a.send( m, v )
swig_assert( v == val, "for DirectorTest.#{m} #{val} == #{v} ")
end
end
{ 'memberchar' => -111,
'memberconstchar' => -112,
}.each do |k,v|
val = a.send( k )
swig_assert( v == val, "for #{k} #{val} == #{v} ")
end