diff --git a/Examples/test-suite/ruby/template_typedef_cplx3_runme.rb b/Examples/test-suite/ruby/template_typedef_cplx3_runme.rb new file mode 100644 index 000000000..60de638a4 --- /dev/null +++ b/Examples/test-suite/ruby/template_typedef_cplx3_runme.rb @@ -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) + + + + diff --git a/Examples/test-suite/ruby/template_typedef_cplx4_runme.rb b/Examples/test-suite/ruby/template_typedef_cplx4_runme.rb new file mode 100644 index 000000000..54ef07525 --- /dev/null +++ b/Examples/test-suite/ruby/template_typedef_cplx4_runme.rb @@ -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) + + + + diff --git a/Examples/test-suite/ruby/template_typedef_cplx_runme.rb b/Examples/test-suite/ruby/template_typedef_cplx_runme.rb index 19550f49e..cd4f25148 100644 --- a/Examples/test-suite/ruby/template_typedef_cplx_runme.rb +++ b/Examples/test-suite/ruby/template_typedef_cplx_runme.rb @@ -6,24 +6,17 @@ include Template_typedef_cplx # double case # -begin - d = make_Identity_double() -# a = d.this -rescue - raise RuntimeError, "#{d} is not an instance" -end + +d = make_Identity_double() +raise RuntimeError, "#{d} is not an instance" if d.is_a? SWIG::Pointer classname = d.class.name.split(/::/).last unless classname =~ /ArithUnaryFunction/ raise RuntimeError, "#{d} is not an ArithUnaryFunction" end -begin - e = make_Multiplies_double_double_double_double(d, d) -# a = e.this -rescue - raise RuntimeError, "#{e} is not an instance" -end +e = make_Multiplies_double_double_double_double(d, d) +raise RuntimeError, "#{e} is not an instance" if e.is_a? SWIG::Pointer classname = e.class.name.split(/::/).last unless classname =~ /ArithUnaryFunction/ @@ -35,24 +28,16 @@ end # complex case # -begin - c = make_Identity_complex() -# a = c.this -rescue - raise RuntimeError, "#{c}is not an instance" -end +c = make_Identity_complex() +raise RuntimeError, "#{c}is not an instance" if c.is_a? SWIG::Pointer classname = c.class.name.split(/::/).last unless classname =~ /ArithUnaryFunction/ raise RuntimeError, "#{c} is not an ArithUnaryFunction" end -begin - f = make_Multiplies_complex_complex_complex_complex(c, c) -# a = f.this -rescue - raise RuntimeError, "{f} is not an instance" -end +f = make_Multiplies_complex_complex_complex_complex(c, c) +raise RuntimeError, "{f} is not an instance" if f.is_a? SWIG::Pointer classname = f.class.name.split(/::/).last unless classname =~ /ArithUnaryFunction/ @@ -63,25 +48,16 @@ end # Mix case # -begin - g = make_Multiplies_double_double_complex_complex(d, c) -# a = g.this -rescue - raise RuntimeError, "#{g} is not an instance" -end +g = make_Multiplies_double_double_complex_complex(d, c) +raise RuntimeError, "#{g} is not an instance" if g.is_a? SWIG::Pointer classname = g.class.name.split(/::/).last unless classname =~ /ArithUnaryFunction/ raise RuntimeError, "#{g} is not an ArithUnaryFunction" end - -begin - h = make_Multiplies_complex_complex_double_double(c, d) -# a = h.this -rescue - raise RuntimeError, "#{h} is not an instance" -end +h = make_Multiplies_complex_complex_double_double(c, d) +raise RuntimeError, "#{h} is not an instance" if h.is_a? SWIG::Pointer classname = h.class.name.split(/::/).last unless classname =~ /ArithUnaryFunction/