diff --git a/Examples/test-suite/python/template_typedef_cplx_runme.py b/Examples/test-suite/python/template_typedef_cplx_runme.py index baf9fad01..f63b8fba9 100644 --- a/Examples/test-suite/python/template_typedef_cplx_runme.py +++ b/Examples/test-suite/python/template_typedef_cplx_runme.py @@ -12,6 +12,7 @@ except: print d, "is not an instance" raise RuntimeError +print '%s' % d s = string.split('%s' % d)[1] if string.find(s, 'ArithUnaryFunction') == -1: print d, "is not an ArithUnaryFunction" @@ -82,7 +83,7 @@ except: print h, "is not an instance" raise RuntimeError -s = string.split('%s' % g)[1] +s = string.split('%s' % h)[1] if string.find(s, 'ArithUnaryFunction') == -1: - print g, "is not an ArithUnaryFunction" + print h, "is not an ArithUnaryFunction" raise RuntimeError diff --git a/Examples/test-suite/ruby/template_typedef_cplx_runme.rb b/Examples/test-suite/ruby/template_typedef_cplx_runme.rb new file mode 100644 index 000000000..19550f49e --- /dev/null +++ b/Examples/test-suite/ruby/template_typedef_cplx_runme.rb @@ -0,0 +1,90 @@ +require 'template_typedef_cplx' + +include Template_typedef_cplx + +# +# double case +# + +begin + d = make_Identity_double() +# a = d.this +rescue + raise RuntimeError, "#{d} is not an instance" +end + +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 + +classname = e.class.name.split(/::/).last +unless classname =~ /ArithUnaryFunction/ + raise RuntimeError, "#{e} is not an ArithUnaryFunction" +end + + +# +# complex case +# + +begin + c = make_Identity_complex() +# a = c.this +rescue + raise RuntimeError, "#{c}is not an instance" +end + +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 + +classname = f.class.name.split(/::/).last +unless classname =~ /ArithUnaryFunction/ + raise RuntimeError, "#{f} is not an ArithUnaryFunction" +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 + +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 + +classname = h.class.name.split(/::/).last +unless classname =~ /ArithUnaryFunction/ + raise RuntimeError, "#{h} is not an ArithUnaryFunction" +end +