/test/language/unclassified/aux_inherit_string1.e

http://github.com/tybor/Liberty · Specman e · 75 lines · 47 code · 6 blank · 22 comment · 1 complexity · e2de217dc80f516f4c6354fd57484e67 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_STRING1
  5. inherit
  6. STRING
  7. rename make as string_make
  8. end
  9. create {ANY}
  10. make, copy, string_make
  11. feature {ANY}
  12. make (init: STRING)
  13. local
  14. i: INTEGER
  15. do
  16. string_make(init.count)
  17. assert(capacity = init.count)
  18. assert(count = 0)
  19. from
  20. i := 1
  21. until
  22. i > init.count
  23. loop
  24. extend(init.item(i))
  25. i := i + 1
  26. end
  27. assert(not is_empty)
  28. assert(count = 3)
  29. assert(init.count = count)
  30. from
  31. i := count
  32. until
  33. i = 0
  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_STRING1: 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_STRING1
  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. -- ------------------------------------------------------------------------------------------------------------------------------