/test/lib/storage/collection/test_fast_array1.e

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