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

/test/language/agent/test_agent55.e

http://github.com/tybor/Liberty
Specman e | 73 lines | 38 code | 10 blank | 25 comment | 0 complexity | 4becb57995bb02d092fc827456543d4e 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_AGENT55
 5   --
 6   -- From a bug report of Wolfgang Jansen on our mailing list.
 7   -- SZ:490:
 8   --
 9
10insert
11   EIFFELTEST_TOOLS
12
13create {}
14   make
15
16feature {ANY}
17   make
18      local
19         v: INTEGER
20      do
21         n_memory := 3
22         func := agent func_run(n)
23         assert(n_memory = 4)
24         v := func.item([])
25         assert(v = 3)
26         assert(n_memory = 4)
27         proc := agent proc_run(n)
28         assert(n_memory = 5)
29         proc.call([])
30         assert(n_memory = 4)
31      end
32
33   n_memory: INTEGER
34
35   n: INTEGER
36      do
37         Result := n_memory
38         n_memory := n_memory + 1
39      end
40
41   func: FUNCTION[TUPLE, INTEGER]
42
43   func_run (i: INTEGER): INTEGER
44      do
45         Result := i
46      end
47
48   proc: PROCEDURE[TUPLE]
49
50   proc_run (i: INTEGER)
51      do
52         n_memory := i
53      end
54
55end -- class TEST_AGENT55
56--
57-- ------------------------------------------------------------------------------------------------------------------------------
58-- Copyright notice below. Please read.
59--
60-- SmartEiffel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License,
61-- as published by the Free Software Foundation; either version 2, or (at your option) any later version.
62-- SmartEiffel is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty
63-- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have
64-- received a copy of the GNU General Public License along with SmartEiffel; see the file COPYING. If not, write to the Free
65-- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
66--
67-- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P.       - University of Nancy 1 - FRANCE
68-- Copyright(C) 2003-2006: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
69--
70-- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
71--
72-- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
73-- ------------------------------------------------------------------------------------------------------------------------------