PageRenderTime 48ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

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

#
MATLAB | 43 lines | 31 code | 12 blank | 0 comment | 9 complexity | eec2b86d739001e9f7592dad8080449a MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. using_composition
  2. f = FooBar();
  3. if (f.blah(3) != 3)
  4. error("FooBar::blah(int)")
  5. endif
  6. if (f.blah(3.5) != 3.5)
  7. error("FooBar::blah(double)")
  8. endif
  9. if (!strcmp(f.blah("hello"),"hello"))
  10. error("FooBar::blah(char *)")
  11. endif
  12. f = FooBar2();
  13. if (f.blah(3) != 3)
  14. error("FooBar2::blah(int)")
  15. endif
  16. if (f.blah(3.5) != 3.5)
  17. error("FooBar2::blah(double)")
  18. endif
  19. if (!strcmp(f.blah("hello"),"hello"))
  20. error("FooBar2::blah(char *)")
  21. endif
  22. f = FooBar3();
  23. if (f.blah(3) != 3)
  24. error("FooBar3::blah(int)")
  25. endif
  26. if (f.blah(3.5) != 3.5)
  27. error("FooBar3::blah(double)")
  28. endif
  29. if (!strcmp(f.blah("hello"),"hello"))
  30. error("FooBar3::blah(char *)")
  31. endif