PageRenderTime 9ms CodeModel.GetById 1ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 1ms

/test/language/gc/test_native_array_collector02.e

http://github.com/tybor/Liberty
Specman e | 66 lines | 35 code | 9 blank | 22 comment | 2 complexity | 0a2e4c9c358e0dfa935b105b3a635840 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_COLLECTOR02
 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 -- This is evil, eh?
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         m.full_collect
46      end
47
48end -- class TEST_NATIVE_ARRAY_COLLECTOR02
49--
50-- ------------------------------------------------------------------------------------------------------------------------------
51-- Copyright notice below. Please read.
52--
53-- SmartEiffel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License,
54-- as published by the Free Software Foundation; either version 2, or (at your option) any later version.
55-- SmartEiffel is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty
56-- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have
57-- received a copy of the GNU General Public License along with SmartEiffel; see the file COPYING. If not, write to the Free
58-- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
59--
60-- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P.       - University of Nancy 1 - FRANCE
61-- Copyright(C) 2003-2006: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
62--
63-- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
64--
65-- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
66-- ------------------------------------------------------------------------------------------------------------------------------