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

Annotation of /trunk/eweasel/tests/attach124/test.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 99959 - (hide annotations)
Sat Mar 11 10:59:28 2017 UTC (2 years, 6 months ago) by alexk
File size: 913 byte(s)
Cosmetics: added comments and restricted export status.
1 alexk 99822 class TEST
2    
3     create
4     make,
5     make_uninitialized
6    
7     feature {NONE} -- Creation
8    
9     make
10     -- Run test.
11     do
12     set_a
13     io.put_string (f.a.out)
14     end
15    
16     make_uninitialized
17     -- Raise an exception after registering a new object in a once function
18     -- and before it is completely initialized.
19     do
20     check not attached f then end
21     a := Current
22     end
23    
24 alexk 99959 feature {NONE} -- Initialization
25 alexk 99822
26     set_a
27     -- Set attribute `a` with a side effect of initializing
28     -- a once function `f` with an incompleetely initialized object.
29     local
30     is_retried: BOOLEAN
31     do
32     if is_retried then
33     a := Current
34     else
35     create a.make_uninitialized
36     end
37     rescue
38     is_retried := True
39     retry
40     end
41    
42 alexk 99959 feature {TEST} -- Access
43 alexk 99822
44     a: TEST
45     -- An attribute to be initialized at creation.
46    
47 alexk 99959 feature {NONE} -- Access
48    
49 alexk 99822 f: TEST
50 alexk 99959 -- A once function returning an incompletely initialized object.
51 alexk 99822 once
52     Result := Current
53     end
54    
55     end

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23