PageRenderTime 5ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/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--
 4class TEST_AGENT22
 5   --
 6   -- From a bug report of Harald Erdbr�gger <he@softpoint.de>
 7   --
 8
 9insert
10   EIFFELTEST_TOOLS
11
12create {}
13   make
14
15feature {ANY}
16   callback_a (i: AUX_AGENT22A)
17      do
18         i.set_c(2)
19      end
20
21   callback_b (i: AUX_AGENT22B)
22      do
23         i.set_c(5)
24      end
25
26   make
27      do
28         doit
29      end
30
31   ca_agent: PROCEDURE[TUPLE[AUX_AGENT22A]]
32
33   cb_agent: PROCEDURE[TUPLE[AUX_AGENT22B]]
34
35   doit
36      local
37         aux_a: AUX_AGENT22A; aux_b: AUX_AGENT22B
38      do
39         create aux_a
40         create aux_b
41         ca_agent := agent callback_a(?)
42         ca_agent.call([aux_a])
43         assert(aux_a.c = 2)
44         -- never called in beta5 and beta6, works in -74:
45         -- agent call is missing in
46         cb_agent := agent callback_b(?)
47         cb_agent.call([aux_b])
48         assert(aux_b.c = 5)
49      end
50
51end -- class TEST_AGENT22
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-- ------------------------------------------------------------------------------------------------------------------------------