/test/language/agent/test_agent22.e

http://github.com/tybor/Liberty · Specman e · 69 lines · 34 code · 9 blank · 26 comment · 0 complexity · b30e665de155ace2ea4e2e1d9e8aa86e 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_AGENT22
  5. --
  6. -- From a bug report of Harald Erdbrügger <he@softpoint.de>
  7. --
  8. insert
  9. EIFFELTEST_TOOLS
  10. create {}
  11. make
  12. feature {ANY}
  13. callback_a (i: AUX_AGENT22A)
  14. do
  15. i.set_c(2)
  16. end
  17. callback_b (i: AUX_AGENT22B)
  18. do
  19. i.set_c(5)
  20. end
  21. make
  22. do
  23. doit
  24. end
  25. ca_agent: PROCEDURE[TUPLE[AUX_AGENT22A]]
  26. cb_agent: PROCEDURE[TUPLE[AUX_AGENT22B]]
  27. doit
  28. local
  29. aux_a: AUX_AGENT22A; aux_b: AUX_AGENT22B
  30. do
  31. create aux_a
  32. create aux_b
  33. ca_agent := agent callback_a(?)
  34. ca_agent.call([aux_a])
  35. assert(aux_a.c = 2)
  36. -- never called in beta5 and beta6, works in -74:
  37. -- agent call is missing in
  38. cb_agent := agent callback_b(?)
  39. cb_agent.call([aux_b])
  40. assert(aux_b.c = 5)
  41. end
  42. end -- class TEST_AGENT22
  43. --
  44. -- ------------------------------------------------------------------------------------------------------------------------------
  45. -- Copyright notice below. Please read.
  46. --
  47. -- SmartEiffel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License,
  48. -- as published by the Free Software Foundation; either version 2, or (at your option) any later version.
  49. -- SmartEiffel is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty
  50. -- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have
  51. -- received a copy of the GNU General Public License along with SmartEiffel; see the file COPYING. If not, write to the Free
  52. -- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
  53. --
  54. -- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P. - University of Nancy 1 - FRANCE
  55. -- Copyright(C) 2003-2006: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
  56. --
  57. -- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
  58. --
  59. -- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
  60. -- ------------------------------------------------------------------------------------------------------------------------------