/test/lib/storage/collection/test_native_array8.e

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