/test/lib/storage/collection/aux_inherit_array1.e

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