/[eiffelstudio]/trunk/eweasel/tests/except001/a.e
ViewVC logotype

Contents of /trunk/eweasel/tests/except001/a.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 86304 - (show annotations)
Fri Apr 22 08:02:42 2011 UTC (8 years, 5 months ago) by alexk
File size: 756 byte(s)
Corrected test to take into account that an old expression should not be re-evaluated on retry and therefore once there is an exception in the old expression, it is raised all the time.
1 Class A
2
3 create
4 f
5
6 feature
7
8 f
9 local
10 retried: BOOLEAN
11 old_exception: OLD_VIOLATION
12 do -- Record an exception when `old g' is evaluated.
13 if not retried then
14 h := h + 1
15 end
16 ensure
17 -- 2. Raise an OLD_VIOLATION on first execution.
18 old_g: s /= Void or else h = old g - s.count
19 rescue
20 old_exception ?= (create {EXCEPTION_MANAGER_FACTORY}).exception_manager.last_exception
21 if old_exception /= Void then
22 print ("True%N")
23 print (old_exception.recipient_name + "%N")
24 print (old_exception.type_name + "%N")
25 else
26 print ("False%N")
27 end
28 s := ""
29 retried := True
30 retry
31 end
32
33 g: INTEGER
34 do
35 -- 1. Raise an exception when `s' is void.
36 Result := s.count + h
37 end
38
39 h: INTEGER
40
41 s: STRING
42
43 end

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23