/[eiffelstudio]/trunk/eweasel/tests/exec096/test.e
ViewVC logotype

Contents of /trunk/eweasel/tests/exec096/test.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 72774 - (show annotations)
Tue Mar 18 05:56:14 2008 UTC (11 years, 10 months ago) by manus
File size: 1089 byte(s)
Removed creation of exception trace which is too large and does not let us test
  what the original test was supposed to test.

1
2 --| Copyright (c) 1993-2006 University of Southern California and contributors.
3 --| All rights reserved.
4 --| Your use of this work is governed under the terms of the GNU General
5 --| Public License version 2.
6
7 class TEST
8 inherit
9 EXCEPTIONS
10 MEM_CONST
11 creation
12 make
13 feature
14 make (args: ARRAY [STRING]) is
15 local
16 k, count: INTEGER;
17 do
18 no_message_on_failure
19 count := args.item (1).to_integer;
20 !!mem.make (Eiffel_memory);
21 from
22 k := 1;
23 until
24 k > count
25 loop
26 try (args.item (2).to_integer);
27 k := k + 1;
28 end
29 end
30
31 try (max: INTEGER) is
32 local
33 tried: BOOLEAN
34 count: INTEGER;
35 do
36 if count < max then
37 weasel;
38 end
39 rescue
40 count := count + 1;
41 retry;
42 end
43
44 weasel is
45 local
46 x: TEST1;
47 y: INTEGER;
48 do
49 y := x.wimp;
50 end
51
52 mem: MEM_INFO;
53
54 threshold: INTEGER is 4_000_000;
55
56 check_memory is
57 do
58 mem.update (C_memory);
59 if mem.used > threshold then
60 io.putstring ("C memory used is ");
61 io.putint (mem.used);
62 io.putstring (" bytes - probably have a memory leak%N")
63 die (0);
64 end
65 end
66
67 end

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.23