/test/language/unclassified/jb/test_jb01.e

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