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:
parent
928f12bd44
commit
5be075f16f
7 changed files with 255 additions and 0 deletions
35
Examples/test-suite/ruby/anonymous_bitfield_runme.rb
Executable file
35
Examples/test-suite/ruby/anonymous_bitfield_runme.rb
Executable file
|
|
@ -0,0 +1,35 @@
|
|||
#!/usr/bin/env ruby
|
||||
#
|
||||
# Put script description here.
|
||||
#
|
||||
# Author:: gga
|
||||
# Copyright:: 2007
|
||||
# License:: Ruby
|
||||
#
|
||||
|
||||
require 'swig_assert'
|
||||
require 'anonymous_bitfield'
|
||||
|
||||
include Anonymous_bitfield
|
||||
|
||||
foo = Foo.new
|
||||
|
||||
{'x' => 4,
|
||||
'y' => 3,
|
||||
'f' => 1,
|
||||
'z' => 8,
|
||||
'seq' => 3 }.each do |m, v|
|
||||
foo.send("#{m}=", v)
|
||||
val = foo.send(m)
|
||||
swig_assert(val == v, " for foo.#{m} == #{v}, was #{val}")
|
||||
end
|
||||
|
||||
{'x' => (1 << 4),
|
||||
'y' => (1 << 4),
|
||||
'f' => (1 << 1),
|
||||
'z' => (1 << 16),
|
||||
'seq' => (1 << (4*8-6)) }.each do |m, v|
|
||||
foo.send("#{m}=", v)
|
||||
val = foo.send(m)
|
||||
swig_assert(val != v, " for foo.#{m} != #{v}, was #{val}")
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue