/[eiffelstudio]/trunk/eweasel/tests/scoop045/searcher.e
ViewVC logotype

Contents of /trunk/eweasel/tests/scoop045/searcher.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 96579 - (show annotations)
Wed Feb 4 10:06:26 2015 UTC (4 years, 11 months ago) by romanschmocker
File size: 656 byte(s)
Eweasel tests for SCOOP exception handling.

The tests are written against the new semantics
by Benjamin Morandi, and currently they all fail.
Initially the tests were part of a naster thesis 
at ETH by Florian Besser.

The patch also includes a test for a bug
(test#scoop041) where the behaviour in molten
and frozen code differs when evaluating a
precondition on a controlled object.



1 note
2 description: "Mock class for a search algorithm."
3 author: "Florian Besser, Roman Schmocker"
4 date: "$Date$"
5 revision: "$Revision$"
6
7 class
8 SEARCHER
9
10 feature
11
12 solution: INTEGER
13
14 has_solution: BOOLEAN
15
16 search (input: INTEGER)
17 -- Stub feature for search algorithm.
18 -- If input < 0, throws an exception.
19 -- If input = 0, no solution found.
20 -- If input > 0, solution found.
21 local
22 l_exception: DEVELOPER_EXCEPTION
23 do
24 if input > 0 then
25 solution := input
26 has_solution := True
27 else
28 solution := 0
29 has_solution := False
30 end
31
32 if input < 0 then
33 create l_exception
34 l_exception.raise
35 end
36 end
37
38 end

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23