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

# · MATLAB · 42 lines · 35 code · 7 blank · 0 comment · 6 complexity · b8a6ca707114e7f78d5ffc7fd95a68b3 MD5 · raw file

  1. smart_pointer_not
  2. f = Foo();
  3. b = Bar(f);
  4. s = Spam(f);
  5. g = Grok(f);
  6. try
  7. x = b.x;
  8. error("Error! b.x")
  9. catch
  10. end_try_catch
  11. try
  12. x = s.x;
  13. error("Error! s.x")
  14. catch
  15. end_try_catch
  16. try
  17. x = g.x;
  18. error("Error! g.x")
  19. catch
  20. end_try_catch
  21. try
  22. x = b.getx();
  23. error("Error! b.getx()")
  24. catch
  25. end_try_catch
  26. try
  27. x = s.getx();
  28. error("Error! s.getx()")
  29. catch
  30. end_try_catch
  31. try
  32. x = g.getx();
  33. error("Error! g.getx()")
  34. catch
  35. end_try_catch