Added support for li_factory test to Ruby.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@8983 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
93a911c85b
commit
7453210c6d
2 changed files with 29 additions and 1 deletions
|
|
@ -21,7 +21,8 @@ CPP_TEST_CASES = \
|
||||||
li_cdata \
|
li_cdata \
|
||||||
li_cstring \
|
li_cstring \
|
||||||
naming \
|
naming \
|
||||||
keywords
|
keywords \
|
||||||
|
li_factory
|
||||||
|
|
||||||
C_TEST_CASES += \
|
C_TEST_CASES += \
|
||||||
li_cdata \
|
li_cdata \
|
||||||
|
|
|
||||||
27
SWIG/Examples/test-suite/ruby/li_factory_runme.rb
Normal file
27
SWIG/Examples/test-suite/ruby/li_factory_runme.rb
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
require 'li_factory'
|
||||||
|
|
||||||
|
circle = Li_factory::Geometry.create(Li_factory::Geometry::CIRCLE)
|
||||||
|
r = circle.radius()
|
||||||
|
if (r != 1.5)
|
||||||
|
raise RuntimeError, "Invalid value for r"
|
||||||
|
end
|
||||||
|
|
||||||
|
new_circle = circle.clone()
|
||||||
|
r = new_circle.radius()
|
||||||
|
if (r != 1.5)
|
||||||
|
raise RuntimeError, "Invalid value for r"
|
||||||
|
end
|
||||||
|
|
||||||
|
point = Li_factory::Geometry.create(Li_factory::Geometry::POINT)
|
||||||
|
w = point.width()
|
||||||
|
|
||||||
|
if (w != 1.0)
|
||||||
|
raise RuntimeError, "Invalid value for w"
|
||||||
|
end
|
||||||
|
|
||||||
|
new_point = point.clone()
|
||||||
|
w = new_point.width()
|
||||||
|
|
||||||
|
if (w != 1.0)
|
||||||
|
raise RuntimeError, "Invalid value for w"
|
||||||
|
end
|
||||||
Loading…
Add table
Add a link
Reference in a new issue