*** empty log message ***
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4516 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
71f87c15af
commit
d5f12d8002
3 changed files with 83 additions and 37 deletions
35
Examples/test-suite/ruby/template_typedef_cplx3_runme.rb
Normal file
35
Examples/test-suite/ruby/template_typedef_cplx3_runme.rb
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
require 'template_typedef_cplx3'
|
||||||
|
|
||||||
|
include Template_typedef_cplx3
|
||||||
|
|
||||||
|
#
|
||||||
|
# this is OK
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
s = Sin.new
|
||||||
|
s.get_base_value()
|
||||||
|
s.get_value()
|
||||||
|
s.get_arith_value()
|
||||||
|
my_func_r(s)
|
||||||
|
make_Multiplies_double_double_double_double(s,s)
|
||||||
|
|
||||||
|
z = CSin.new
|
||||||
|
z.get_base_value()
|
||||||
|
z.get_value()
|
||||||
|
z.get_arith_value()
|
||||||
|
my_func_c(z)
|
||||||
|
make_Multiplies_complex_complex_complex_complex(z,z)
|
||||||
|
|
||||||
|
#
|
||||||
|
# Here we fail
|
||||||
|
#
|
||||||
|
d = make_Identity_double()
|
||||||
|
my_func_r(d)
|
||||||
|
|
||||||
|
c = make_Identity_complex()
|
||||||
|
my_func_c(c)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
35
Examples/test-suite/ruby/template_typedef_cplx4_runme.rb
Normal file
35
Examples/test-suite/ruby/template_typedef_cplx4_runme.rb
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
require 'template_typedef_cplx4'
|
||||||
|
|
||||||
|
include Template_typedef_cplx4
|
||||||
|
|
||||||
|
#
|
||||||
|
# this is OK
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
s = Sin.new
|
||||||
|
s.get_base_value()
|
||||||
|
s.get_value()
|
||||||
|
s.get_arith_value()
|
||||||
|
my_func_r(s)
|
||||||
|
make_Multiplies_double_double_double_double(s,s)
|
||||||
|
|
||||||
|
z = CSin.new
|
||||||
|
z.get_base_value()
|
||||||
|
z.get_value()
|
||||||
|
z.get_arith_value()
|
||||||
|
my_func_c(z)
|
||||||
|
make_Multiplies_complex_complex_complex_complex(z,z)
|
||||||
|
|
||||||
|
#
|
||||||
|
# Here we fail
|
||||||
|
#
|
||||||
|
d = make_Identity_double()
|
||||||
|
my_func_r(d)
|
||||||
|
|
||||||
|
c = make_Identity_complex()
|
||||||
|
my_func_c(c)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -6,24 +6,17 @@ include Template_typedef_cplx
|
||||||
# double case
|
# double case
|
||||||
#
|
#
|
||||||
|
|
||||||
begin
|
|
||||||
d = make_Identity_double()
|
d = make_Identity_double()
|
||||||
# a = d.this
|
raise RuntimeError, "#{d} is not an instance" if d.is_a? SWIG::Pointer
|
||||||
rescue
|
|
||||||
raise RuntimeError, "#{d} is not an instance"
|
|
||||||
end
|
|
||||||
|
|
||||||
classname = d.class.name.split(/::/).last
|
classname = d.class.name.split(/::/).last
|
||||||
unless classname =~ /ArithUnaryFunction/
|
unless classname =~ /ArithUnaryFunction/
|
||||||
raise RuntimeError, "#{d} is not an ArithUnaryFunction"
|
raise RuntimeError, "#{d} is not an ArithUnaryFunction"
|
||||||
end
|
end
|
||||||
|
|
||||||
begin
|
|
||||||
e = make_Multiplies_double_double_double_double(d, d)
|
e = make_Multiplies_double_double_double_double(d, d)
|
||||||
# a = e.this
|
raise RuntimeError, "#{e} is not an instance" if e.is_a? SWIG::Pointer
|
||||||
rescue
|
|
||||||
raise RuntimeError, "#{e} is not an instance"
|
|
||||||
end
|
|
||||||
|
|
||||||
classname = e.class.name.split(/::/).last
|
classname = e.class.name.split(/::/).last
|
||||||
unless classname =~ /ArithUnaryFunction/
|
unless classname =~ /ArithUnaryFunction/
|
||||||
|
|
@ -35,24 +28,16 @@ end
|
||||||
# complex case
|
# complex case
|
||||||
#
|
#
|
||||||
|
|
||||||
begin
|
|
||||||
c = make_Identity_complex()
|
c = make_Identity_complex()
|
||||||
# a = c.this
|
raise RuntimeError, "#{c}is not an instance" if c.is_a? SWIG::Pointer
|
||||||
rescue
|
|
||||||
raise RuntimeError, "#{c}is not an instance"
|
|
||||||
end
|
|
||||||
|
|
||||||
classname = c.class.name.split(/::/).last
|
classname = c.class.name.split(/::/).last
|
||||||
unless classname =~ /ArithUnaryFunction/
|
unless classname =~ /ArithUnaryFunction/
|
||||||
raise RuntimeError, "#{c} is not an ArithUnaryFunction"
|
raise RuntimeError, "#{c} is not an ArithUnaryFunction"
|
||||||
end
|
end
|
||||||
|
|
||||||
begin
|
|
||||||
f = make_Multiplies_complex_complex_complex_complex(c, c)
|
f = make_Multiplies_complex_complex_complex_complex(c, c)
|
||||||
# a = f.this
|
raise RuntimeError, "{f} is not an instance" if f.is_a? SWIG::Pointer
|
||||||
rescue
|
|
||||||
raise RuntimeError, "{f} is not an instance"
|
|
||||||
end
|
|
||||||
|
|
||||||
classname = f.class.name.split(/::/).last
|
classname = f.class.name.split(/::/).last
|
||||||
unless classname =~ /ArithUnaryFunction/
|
unless classname =~ /ArithUnaryFunction/
|
||||||
|
|
@ -63,25 +48,16 @@ end
|
||||||
# Mix case
|
# Mix case
|
||||||
#
|
#
|
||||||
|
|
||||||
begin
|
|
||||||
g = make_Multiplies_double_double_complex_complex(d, c)
|
g = make_Multiplies_double_double_complex_complex(d, c)
|
||||||
# a = g.this
|
raise RuntimeError, "#{g} is not an instance" if g.is_a? SWIG::Pointer
|
||||||
rescue
|
|
||||||
raise RuntimeError, "#{g} is not an instance"
|
|
||||||
end
|
|
||||||
|
|
||||||
classname = g.class.name.split(/::/).last
|
classname = g.class.name.split(/::/).last
|
||||||
unless classname =~ /ArithUnaryFunction/
|
unless classname =~ /ArithUnaryFunction/
|
||||||
raise RuntimeError, "#{g} is not an ArithUnaryFunction"
|
raise RuntimeError, "#{g} is not an ArithUnaryFunction"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
begin
|
|
||||||
h = make_Multiplies_complex_complex_double_double(c, d)
|
h = make_Multiplies_complex_complex_double_double(c, d)
|
||||||
# a = h.this
|
raise RuntimeError, "#{h} is not an instance" if h.is_a? SWIG::Pointer
|
||||||
rescue
|
|
||||||
raise RuntimeError, "#{h} is not an instance"
|
|
||||||
end
|
|
||||||
|
|
||||||
classname = h.class.name.split(/::/).last
|
classname = h.class.name.split(/::/).last
|
||||||
unless classname =~ /ArithUnaryFunction/
|
unless classname =~ /ArithUnaryFunction/
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue