/test/language/unclassified/test_inherit5.e

http://github.com/tybor/Liberty · Specman e · 71 lines · 41 code · 8 blank · 22 comment · 1 complexity · fed66b01810904e6ea79f2bd50367e51 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_INHERIT5
  5. inherit
  6. AUX_INHERIT5
  7. rename foo as aux_foo
  8. end
  9. insert
  10. AUX_INHERIT5
  11. redefine foo
  12. end
  13. create {}
  14. make
  15. feature {ANY}
  16. foo
  17. do
  18. aux_foo
  19. foo_count := foo_count + 1
  20. end
  21. make
  22. local
  23. aux: AUX_INHERIT5
  24. do
  25. assert(foo_count = 0)
  26. aux := Current
  27. aux.foo
  28. assert(foo_count = 1)
  29. foo
  30. assert(foo_count = 3)
  31. end
  32. feature {}
  33. assert (b: BOOLEAN)
  34. do
  35. cpt := cpt + 1
  36. if not b then
  37. std_output.put_string("TEST_INHERIT5: ERROR Test # ")
  38. std_output.put_integer(cpt)
  39. std_output.put_string("%N")
  40. else
  41. -- std_output.put_string("Yes%N");
  42. end
  43. end
  44. cpt: INTEGER
  45. end -- class TEST_INHERIT5
  46. --
  47. -- ------------------------------------------------------------------------------------------------------------------------------
  48. -- Copyright notice below. Please read.
  49. --
  50. -- SmartEiffel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License,
  51. -- as published by the Free Software Foundation; either version 2, or (at your option) any later version.
  52. -- SmartEiffel is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty
  53. -- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have
  54. -- received a copy of the GNU General Public License along with SmartEiffel; see the file COPYING. If not, write to the Free
  55. -- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
  56. --
  57. -- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P. - University of Nancy 1 - FRANCE
  58. -- Copyright(C) 2003-2006: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
  59. --
  60. -- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
  61. --
  62. -- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
  63. -- ------------------------------------------------------------------------------------------------------------------------------