/test/language/unclassified/test_inherit6.e

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