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

/test/language/gc/test_native_array_collector03.e

http://github.com/tybor/Liberty
Specman e | 81 lines | 49 code | 10 blank | 22 comment | 2 complexity | 07d8ee1d5d4d391c0c2e1d601f29e20f 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_NATIVE_ARRAY_COLLECTOR03
 5
 6insert
 7   EIFFELTEST_TOOLS
 8   NATIVE_ARRAY_COLLECTOR[STRING]
 9
10create {}
11   make
12
13feature {ANY}
14   make
15      do
16         capacity := 1
17         honeypot := honeypot.calloc(capacity)
18         full_collect
19         assert(flag)
20         assert(not reentering)
21      end
22
23   mark_native_arrays
24      do
25         reentering := reentering or else in_mark
26         if not in_mark then
27            -- To avoid screwing up the test suite
28            in_mark := True
29            full_collect -- Don't do this at home kids
30            flag := True
31            in_mark := False
32         end
33      end
34
35   flag, reentering, in_mark: BOOLEAN
36
37   capacity: INTEGER
38
39   honeypot: NATIVE_ARRAY[STRING]
40
41   full_collect
42      local
43         m: MEMORY
44      do
45         generate_garbage
46         m.full_collect
47      end
48
49   generate_garbage
50      local
51         i: INTEGER; s: STRING
52      do
53         from
54            i := 1
55         until
56            i = 10000
57         loop
58            create s.make_from_string("quark           ends here")
59            i := i + 1
60         end
61      end
62
63end -- class TEST_NATIVE_ARRAY_COLLECTOR03
64--
65-- ------------------------------------------------------------------------------------------------------------------------------
66-- Copyright notice below. Please read.
67--
68-- SmartEiffel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License,
69-- as published by the Free Software Foundation; either version 2, or (at your option) any later version.
70-- SmartEiffel is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty
71-- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have
72-- received a copy of the GNU General Public License along with SmartEiffel; see the file COPYING. If not, write to the Free
73-- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
74--
75-- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P.       - University of Nancy 1 - FRANCE
76-- Copyright(C) 2003-2006: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
77--
78-- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
79--
80-- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
81-- ------------------------------------------------------------------------------------------------------------------------------