/[eiffelstudio]/trunk/eweasel/tests/final132/test1.e
ViewVC logotype

Contents of /trunk/eweasel/tests/final132/test1.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 103153 - (show annotations)
Sun May 12 17:57:18 2019 UTC (4 months, 1 week ago) by alexk
File size: 1080 byte(s)
Added an example to test how removed classes are dealt with storable.
1 class
2 TEST
3
4 create
5 make
6
7 feature {NONE} -- Creation
8
9 make
10 local
11 a: A
12 b: B
13 do
14 if attached a then
15 a.do_nothing
16 end
17 if attached b then
18 b.do_nothing
19 end
20 (create {CELL [detachable A]}.put (Void)).do_nothing
21 test ("../general.dat")
22 test ("../independent.dat")
23 end
24
25 feature {NONE} -- Testing
26
27 test (n: READABLE_STRING_GENERAL)
28 -- Report results of retrieval from a file of name `n`.
29 local
30 f: RAW_FILE
31 is_retried: BOOLEAN
32 do
33 if not is_retried then
34 create f.make_open_read (n)
35 if not attached f.retrieved as x then
36 io.put_string ("Cannot retrieve an object.%N")
37 elseif attached {CELL [A]} x as y then
38 io.put_string ("Retrieved object successfully: " + y.item.generating_type.name + ".%N")
39 else
40 io.put_string ("Retrieved incompatible object: " + x.generating_type.name + ".%N")
41 end
42 f.close
43 end
44 rescue
45 io.put_string ("Aborted with exception: " + if attached {EXCEPTION_MANAGER}.last_exception as e then e.tag.as_string_8 else "" end + "%N")
46 is_retried := True
47 retry
48 end
49
50 end

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23