/test/language/exceptions/test_exceptions04.e

http://github.com/tybor/Liberty · Specman e · 68 lines · 39 code · 8 blank · 21 comment · 2 complexity · 3c931cfabf6d999a097b1d779691c2c5 MD5 · raw file

  1. -- This file is part of SmartEiffel The GNU Eiffel Compiler Tools and Libraries.
  2. -- See the Copyright notice at the end of this file.
  3. --
  4. class TEST_EXCEPTIONS04
  5. insert
  6. EXCEPTIONS
  7. create {}
  8. make
  9. feature {ANY}
  10. require_check_mode: BOOLEAN
  11. make
  12. require
  13. set_require_check_mode
  14. local
  15. s: STRING
  16. do
  17. s.extend('o')
  18. is_true(("foo").is_equal(s))
  19. rescue
  20. if require_check_mode then
  21. is_true(Void_call_target = exception)
  22. end
  23. s := "fo"
  24. retry
  25. end
  26. set_require_check_mode: BOOLEAN
  27. do
  28. require_check_mode := True
  29. Result := True
  30. end
  31. feature {}
  32. is_true (b: BOOLEAN)
  33. do
  34. cpt := cpt + 1
  35. if not b then
  36. std_output.put_string("TEST_EXCEPTION04: ERROR Test # ")
  37. std_output.put_integer(cpt)
  38. std_output.put_string("%N")
  39. end
  40. end
  41. cpt: INTEGER
  42. end -- class TEST_EXCEPTIONS04
  43. --
  44. -- ------------------------------------------------------------------------------------------------------------------------------
  45. -- Copyright notice below. Please read.
  46. --
  47. -- SmartEiffel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License,
  48. -- as published by the Free Software Foundation; either version 2, or (at your option) any later version.
  49. -- SmartEiffel is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty
  50. -- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have
  51. -- received a copy of the GNU General Public License along with SmartEiffel; see the file COPYING. If not, write to the Free
  52. -- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
  53. --
  54. -- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P. - University of Nancy 1 - FRANCE
  55. -- Copyright(C) 2003-2006: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
  56. --
  57. -- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
  58. --
  59. -- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
  60. -- ------------------------------------------------------------------------------------------------------------------------------