PageRenderTime 17ms CodeModel.GetById 2ms app.highlight 12ms RepoModel.GetById 2ms app.codeStats 0ms

/trunk/Examples/test-suite/octave/template_typedef_cplx2_runme.m

#
Objective C | 103 lines | 84 code | 19 blank | 0 comment | 12 complexity | b15ea9e0cb807a8498ada79339681ff3 MD5 | raw file
  1template_typedef_cplx2
  2
  3#
  4# double case
  5#
  6
  7try
  8  d = make_Identity_double();
  9  a = swig_this(d);
 10catch
 11  d
 12  error("is not an instance")
 13end_try_catch
 14
 15if (findstr('ArithUnaryFunction',swig_type(d)) != 1)
 16  d
 17  error("is not an ArithUnaryFunction")
 18  error
 19endif
 20
 21try
 22  e = make_Multiplies_double_double_double_double(d, d);
 23  a = swig_this(e);
 24catch
 25  e
 26  error("is not an instance")
 27end_try_catch
 28
 29if (findstr('ArithUnaryFunction',swig_type(e)) != 1)
 30  e
 31  error("is not an ArithUnaryFunction")
 32endif
 33
 34
 35#
 36# complex case
 37#
 38
 39try
 40  c = make_Identity_complex();
 41  a = swig_this(c);
 42catch
 43  c
 44  error("is not an instance")
 45end_try_catch
 46
 47if (findstr('ArithUnaryFunction',swig_type(c)) != 1)
 48  c
 49  error("is not an ArithUnaryFunction")
 50endif
 51
 52try
 53  f = make_Multiplies_complex_complex_complex_complex(c, c);
 54  a = swig_this(f);
 55catch
 56  f
 57  error("is not an instance")
 58end_try_catch
 59
 60if (findstr('ArithUnaryFunction',swig_type(f)) != 1)
 61  f
 62  error("is not an ArithUnaryFunction")
 63endif
 64
 65#
 66# Mix case
 67#
 68
 69try
 70  g = make_Multiplies_double_double_complex_complex(d, c);
 71  a = swig_this(g);
 72catch
 73  g
 74  error("is not an instance")
 75end_try_catch
 76
 77if (findstr('ArithUnaryFunction',swig_type(g)) != 1)
 78  g
 79  error("is not an ArithUnaryFunction")
 80  error
 81endif
 82
 83
 84try
 85  h = make_Multiplies_complex_complex_double_double(c, d);
 86  a = swig_this(h);
 87catch
 88  h
 89  error("is not an instance")
 90end_try_catch
 91
 92if (findstr('ArithUnaryFunction',swig_type(h)) == -1)
 93  h
 94  error("is not an ArithUnaryFunction")
 95endif
 96
 97try
 98  a = g.get_value();
 99catch
100  error(g, "has not get_value() method")
101  error
102end_try_catch
103