/[eiffelstudio]/branches/eth/eve/eweasel/tests/array010/test.e
ViewVC logotype

Contents of /branches/eth/eve/eweasel/tests/array010/test.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 89221 - (show annotations)
Fri Jul 27 13:54:06 2012 UTC (7 years, 5 months ago) by jasonw
File size: 712 byte(s)
<<Merged from trunk#89220.>>

1 class TEST
2
3 create
4 make
5
6 feature {NONE} -- Creation
7
8 make
9 -- Run tests.
10 local
11 a: SORTABLE_ARRAY [INTEGER]
12 i: INTEGER_32
13 l_lower, l_upper: INTEGER
14 do
15 l_lower := {INTEGER_32}.max_value - 5
16 l_upper := {INTEGER_32}.max_value - 1
17 -- {INTEGER_32}.max_value will cause overflow, so we use {INTEGER_32}.max_value - 1
18 create a.make_filled (1, l_lower, l_upper)
19 from
20 i := l_lower
21 until
22 i > l_upper
23 loop
24 a.put (i, i)
25 i := i + 1
26 end
27 -- Put some values to make it unsorted.
28 a.put (100, l_lower + 1)
29 a.put (30, l_lower + 2)
30
31 a.sort
32
33 a.binary_search (100)
34
35 if a.found_index /= l_lower + 1 then
36 print ("Binary search failed%N")
37 end
38 end
39
40 end

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23