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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 97864 - (show annotations)
Wed Aug 19 23:49:44 2015 UTC (4 years, 1 month ago) by manus
File size: 1300 byte(s)
Fixed obsolete calls to `attempt' which is now called `attempted'.

1 class TEST
2 create
3 make
4
5 feature
6
7 test: TUPLE [ b: BOOLEAN; i: ANY ]
8
9 make
10 local
11 a: ANY
12 l: LIST [STRING_32]
13 do
14 test := [False, a]
15 last_original := [0, l]
16 last_translated := [0, l]
17
18 test.b := False -- Works
19 test.i := ({ANY}).attempted (7) -- Works
20 test.i := 7 -- Segmentation violation; Operating system signal
21 test.i := True -- Segmentation violation; Operating system signal
22
23 get_original_entries (2)
24 get_translated_entries (4)
25 end
26
27 last_original: TUPLE [i:INTEGER; list: LIST[STRING_32]]
28 last_translated: TUPLE [i:INTEGER; list: LIST[STRING_32]]
29
30 get_original_entries (i_th: INTEGER) is
31 -- get `i_th' original entry in the file
32 do
33 if (last_original.i /= i_th) then
34 last_original.i := i_th
35 last_original.list := extract_string (1, 3).split('%U')
36 end
37 ensure
38 last_original.list = Void or last_original.list /= Void
39 end
40
41 get_translated_entries (i_th: INTEGER) is
42 -- What's the `i-th' translated entry?
43 do
44 if (last_translated.i /= i_th) then
45 last_translated.i := i_th
46 last_translated.list := extract_string (1, 3).split('%U')
47 end
48 ensure
49 last_translated.list = Void or last_translated.list /= Void
50 end
51
52 extract_string (a_offset, a_number: INTEGER): STRING_32 is
53 do
54 create Result.make (10)
55 end
56
57 end

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23