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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 97465 - (show annotations)
Fri Jun 12 09:42:40 2015 UTC (4 years, 7 months ago) by romanschmocker
File size: 2322 byte(s)
Added two eweasel tests for some basic features of passive processors.

1 note
2 description: "Test some basic operations on passive processors."
3 author: "Roman Schmocker"
4 date: "$Date$"
5 revision: "$Revision$"
6
7 class
8 TEST
9
10 create
11 make
12
13 feature {NONE} -- Initialization
14
15 make
16 -- Run application.
17 local
18 l_shared: separate ANY
19 l_supplier: separate SUPPLIER
20 do
21 create l_shared
22 create <NONE> l_supplier.make (l_shared)
23
24
25 test_simple_query (l_supplier)
26 test_simple_command (l_supplier)
27 test_regular_lockpassing (l_supplier, l_shared)
28 test_passive_query_lockpassing (l_supplier, l_shared)
29 test_passive_command_lockpassing (l_supplier, l_shared)
30 test_separate_callback_query (l_supplier)
31 test_separate_callback_command (l_supplier)
32
33 print ("OK: No deadlock occurred.%N")
34 end
35
36 check_result (i: INTEGER)
37 do
38 if i /= 42 then
39 print ("Error: Result does not match.%N")
40 end
41 end
42
43 feature -- Basic operations
44
45 test_simple_query (supp: separate SUPPLIER)
46 do
47
48 check_result (supp.simple_query)
49 print ("Executed simple query.%N")
50 end
51
52 test_simple_command (supp: separate SUPPLIER)
53 do
54 supp.do_nothing
55 print ("Executed simple command.%N")
56 end
57
58 test_regular_lockpassing (supp: separate SUPPLIER; shared: separate ANY)
59 do
60 shared.out.do_nothing
61 check_result (supp.regular_lockpassing (shared))
62 print ("Executed regular lockpassing query.%N")
63 end
64
65 test_passive_query_lockpassing (supp: separate SUPPLIER; shared: separate ANY)
66 do
67 shared.out.do_nothing
68 check 42 = supp.passive_query_lockpassing end
69 print ("Executed passive lockpassing query.%N")
70 end
71
72 test_passive_command_lockpassing (supp: separate SUPPLIER; shared: separate ANY)
73 -- Check if lockpassing happens on a synchronous command to a passive processor.
74 -- If `supp' wouldn't be passive, this example would deadlock.
75 do
76 shared.out.do_nothing
77 supp.passive_command_lockpassing
78 -- Make sure that the test wasn't asynchronous.
79 supp.out.do_nothing
80 print ("Executed passive lockpassing command.%N")
81 end
82
83 test_separate_callback_query (supp: separate SUPPLIER)
84 do
85 check_result (supp.callback_query (Current))
86 print ("Executed separate callback query.%N")
87 end
88
89 test_separate_callback_command (supp: separate SUPPLIER)
90 do
91 supp.callback_command (Current)
92 print ("Executed separate callback command.%N")
93 end
94 end

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23