/test/language/unclassified/test_fa4.e

http://github.com/tybor/Liberty · Specman e · 87 lines · 57 code · 5 blank · 25 comment · 1 complexity · 90e7fa2bcee053dfd80b38b9b705a4d0 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_FA4
  5. --
  6. -- From a bug report of Franck ARNAUD
  7. --
  8. create {}
  9. make
  10. feature {ANY}
  11. make
  12. local
  13. r1: AUX_FA4R1; r1b: AUX_FA4R1B; r2: AUX_FA4R2; b1: AUX_FA4B1; b2: AUX_FA4B2
  14. do
  15. create r1
  16. r1.init_ref
  17. assert(r1.ref.value1.is_equal("ref"))
  18. assert(r1.get_ref.is_equal("ref"))
  19. b1 := r1
  20. b1.init_ref
  21. assert(b1.ref.value1.is_equal("ref"))
  22. assert(b1.get_ref.is_equal("ref"))
  23. assert(r1.ref.value1.is_equal("ref"))
  24. assert(r1.get_ref.is_equal("ref"))
  25. create r1b
  26. r1b.init_ref
  27. assert(r1b.ref.value1.is_equal("ref"))
  28. assert(r1b.get_ref.is_equal("ref"))
  29. b1 := r1b
  30. b1.init_ref
  31. assert(b1.ref.value1.is_equal("ref"))
  32. assert(b1.get_ref.is_equal("ref"))
  33. assert(r1b.ref.value1.is_equal("ref"))
  34. assert(r1b.get_ref.is_equal("ref"))
  35. create r2
  36. r2.init_ref
  37. assert(r2.ref.value1.is_equal("ref"))
  38. assert(r2.get_ref.is_equal("ref"))
  39. r2.init_autre
  40. assert(r2.autre.is_equal("autre"))
  41. b1 := r2
  42. b1.init_ref
  43. assert(b1.ref.value1.is_equal("ref"))
  44. assert(b1.get_ref.is_equal("ref"))
  45. b2 := r2
  46. b2.init_autre
  47. assert(b2.autre.is_equal("autre"))
  48. assert(r2.ref.value1.is_equal("ref"))
  49. assert(r2.get_ref.is_equal("ref"))
  50. assert(r2.autre.is_equal("autre"))
  51. end
  52. assert (bool: BOOLEAN)
  53. do
  54. cpt := cpt + 1
  55. if not bool then
  56. std_output.put_string("TEST_FA4: ERROR Test # ")
  57. std_output.put_integer(cpt)
  58. std_output.put_string("%N")
  59. else
  60. -- std_output.put_string("Yes%N");
  61. end
  62. end
  63. cpt: INTEGER
  64. end -- class TEST_FA4
  65. --
  66. -- ------------------------------------------------------------------------------------------------------------------------------
  67. -- Copyright notice below. Please read.
  68. --
  69. -- SmartEiffel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License,
  70. -- as published by the Free Software Foundation; either version 2, or (at your option) any later version.
  71. -- SmartEiffel is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty
  72. -- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have
  73. -- received a copy of the GNU General Public License along with SmartEiffel; see the file COPYING. If not, write to the Free
  74. -- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
  75. --
  76. -- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P. - University of Nancy 1 - FRANCE
  77. -- Copyright(C) 2003-2006: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
  78. --
  79. -- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
  80. --
  81. -- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
  82. -- ------------------------------------------------------------------------------------------------------------------------------