3 -- Grant of Unlimited Rights
5 -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
6 -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
7 -- unlimited rights in the software and documentation contained herein.
8 -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
9 -- this public release, the Government intends to confer upon all
10 -- recipients unlimited rights equal to those held by the Government.
11 -- These rights include rights to use, duplicate, release or disclose the
12 -- released technical data and computer software in whole or in part, in
13 -- any manner and for any purpose whatsoever, and to have or permit others
18 -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
19 -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
20 -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
21 -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
22 -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
23 -- PARTICULAR PURPOSE OF SAID MATERIAL.
27 -- Check that if the original entry call was a conditional entry call,
28 -- the call is cancelled if a requeue-with-abort of the call is not
29 -- selected immediately.
30 -- Check that if the original entry call was a timed entry call, the
31 -- expiration time for a requeue-with-abort is the original expiration
35 -- This test declares two tasks: Launch_Control and Mission_Control.
36 -- Mission_Control instructs Launch_Control to start its countdown
37 -- and then requeues (with abort) to the Launch_Control.Launch
38 -- entry. This call to Launch will be accepted at the end of the
39 -- countdown (if the task is still waiting).
40 -- The main task does an unconditional, conditional, and timed
41 -- entry call to Mission_Control and checks to see if the launch
46 -- 18 OCT 95 SAIC ACVC 2.1
47 -- 10 JUL 96 SAIC Incorporated reviewer's comments.
51 with Calendar
; use type Calendar
.Time
;
55 Verbose
: constant Boolean := False;
56 Countdown_Amount
: constant Duration := 2.0 * Impdef
.One_Long_Second
;
57 Plenty_Of_Time
: constant Duration :=
58 Countdown_Amount
+ ImpDef
.Clear_Ready_Queue
+ 1.0 * Impdef
.One_Long_Second
;
59 Not_Enough_Time
: constant Duration :=
60 Countdown_Amount
- 0.5 * Impdef
.One_Long_Second
;
62 Report
.Test
("C954025",
63 "Check that if the original entry" &
64 " call was a conditional or timed entry call, the" &
65 " expiration time for a requeue with abort is the" &
66 " original expiration time");
68 -- note that the following object is a shared object and its use
69 -- governed by the rules of 9.10(3,4,8);6.0
70 Launch_Accepted
: Boolean := False;
72 task Launch_Control
is
73 entry Enable_Launch_Control
;
74 entry Start_Countdown
(How_Long
: Duration);
75 -- Launch will be accepted if a call is waiting when the countdown
80 task body Launch_Control
is
81 Wait_Amount
: Duration := 0.0;
85 accept Enable_Launch_Control
do
86 Launch_Accepted
:= False;
87 end Enable_Launch_Control
;
92 accept Start_Countdown
(How_Long
: Duration) do
93 Wait_Amount
:= How_Long
;
100 Launch_Accepted
:= True;
104 -- note that Launch_Accepted is False here
109 task Mission_Control
is
110 -- launch will occur if we are given enough time to complete
111 -- a standard countdown. We will not be rushed!
115 task body Mission_Control
is
120 Launch_Control
.Start_Countdown
(Countdown_Amount
);
121 requeue Launch_Control
.Launch
with abort;
129 begin -- test encapsulation
130 -- unconditional entry call to check the simple case
131 Launch_Control
.Enable_Launch_Control
;
132 Mission_Control
.Do_Launch
;
133 if Launch_Accepted
then
135 Report
.Comment
("simple case passed");
138 Report
.Failed
("simple case");
142 -- timed but with plenty of time - delay relative
143 Launch_Control
.Enable_Launch_Control
;
145 Mission_Control
.Do_Launch
;
147 delay Plenty_Of_Time
;
148 if Launch_Accepted
then
149 Report
.Failed
("plenty of time timed out after accept (1)");
152 if Launch_Accepted
then
154 Report
.Comment
("plenty of time case passed (1)");
157 Report
.Failed
("plenty of time (1)");
161 -- timed but with plenty of time -- delay until
162 Launch_Control
.Enable_Launch_Control
;
164 Mission_Control
.Do_Launch
;
166 delay until Calendar
.Clock
+ Plenty_Of_Time
;
167 if Launch_Accepted
then
168 Report
.Failed
("plenty of time timed out after accept(2)");
171 if Launch_Accepted
then
173 Report
.Comment
("plenty of time case passed (2)");
176 Report
.Failed
("plenty of time (2)");
180 -- timed without enough time - delay relative
181 Launch_Control
.Enable_Launch_Control
;
183 Mission_Control
.Do_Launch
;
184 Report
.Failed
("not enough time completed accept (1)");
186 delay Not_Enough_Time
;
188 if Launch_Accepted
then
189 Report
.Failed
("not enough time (1)");
192 Report
.Comment
("not enough time case passed (1)");
197 -- timed without enough time - delay until
198 Launch_Control
.Enable_Launch_Control
;
200 Mission_Control
.Do_Launch
;
201 Report
.Failed
("not enough time completed accept (2)");
203 delay until Calendar
.Clock
+ Not_Enough_Time
;
205 if Launch_Accepted
then
206 Report
.Failed
("not enough time (2)");
209 Report
.Comment
("not enough time case passed (2)");
215 Launch_Control
.Enable_Launch_Control
;
216 -- make sure Mission_Control is ready to accept immediately
217 delay ImpDef
.Clear_Ready_Queue
;
219 Mission_Control
.Do_Launch
;
220 Report
.Failed
("no time completed accept");
223 Report
.Comment
("conditional case - else taken");
226 if Launch_Accepted
then
227 Report
.Failed
("no time");
230 Report
.Comment
("no time case passed");