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.
26 -- CHECK THAT FOR ENTRIES OF TASKS, DEFAULT VALUES OF ALL TYPES CAN
27 -- BE GIVEN FOR A FORMAL PARAMETER.
30 -- DHH 03/22/88 CREATED ORIGINAL TEST.
32 WITH REPORT
; USE REPORT
;
35 SUBTYPE INT
IS INTEGER RANGE 1 ..10;
37 TYPE FIX
IS DELTA 0.125 RANGE 0.0 .. 10.0;
38 TYPE ENUM
IS (RED
, BLUE
, YELLOW
);
39 SUBTYPE CHAR
IS CHARACTER RANGE 'A' .. 'F';
40 TYPE ARR
IS ARRAY(1 .. 3) OF INTEGER;
48 FUNCTION IDENT_FLT
(E
: FLT
) RETURN FLT
IS
57 FUNCTION IDENT_FIX
(E
: FIX
) RETURN FIX
IS
66 FUNCTION IDENT_ENUM
(E
: ENUM
) RETURN ENUM
IS
75 FUNCTION IDENT_CHAR
(E
: CHAR
) RETURN CHAR
IS
84 FUNCTION IDENT_ARR
(E
: ARR
) RETURN ARR
IS
94 FUNCTION IDENT_REC
(E
: REC
) RETURN REC
IS
95 Z
: REC
:= (10, YELLOW
, 'F');
104 TASK TEST_DEFAULTS
IS
105 ENTRY BOOL
(G
: BOOLEAN := TRUE);
106 ENTRY INTEGR
(X
: IN INT
:= 5);
107 ENTRY FLOAT(Y
: IN FLT
:= 1.25);
108 ENTRY FIXED
(Z
: IN FIX
:= 1.0);
109 ENTRY ENUMERAT
(A
: IN ENUM
:= RED
);
110 ENTRY CHARACTR
(B
: IN CHAR
:= 'A');
111 ENTRY ARRY
(C
: IN ARR
:= (1, 2, 3));
112 ENTRY RECD
(D
: IN REC
:= (5, RED
, 'A'));
115 TASK BODY TEST_DEFAULTS
IS
118 ACCEPT BOOL
(G
: BOOLEAN := TRUE) DO
119 IF G
/= IDENT_BOOL
(TRUE) THEN
120 FAILED
("BOOLEAN DEFAULT FAILED");
124 ACCEPT INTEGR
(X
: IN INT
:= 5) DO
125 IF X
/= IDENT_INT
(5) THEN
126 FAILED
("INTEGER DEFAULT FAILED");
130 ACCEPT FLOAT(Y
: IN FLT
:= 1.25) DO
131 IF Y
/= IDENT_FLT
(1.25) THEN
132 FAILED
("FLOAT DEFAULT FAILED");
136 ACCEPT FIXED
(Z
: IN FIX
:= 1.0) DO
137 IF Z
/= IDENT_FIX
(1.0) THEN
138 FAILED
("FIXED DEFAULT FAILED");
142 ACCEPT ENUMERAT
(A
: IN ENUM
:= RED
) DO
143 IF A
/= IDENT_ENUM
(RED
) THEN
144 FAILED
("ENUMERATION DEFAULT FAILED");
148 ACCEPT CHARACTR
(B
: IN CHAR
:= 'A') DO
149 IF B
/= IDENT_CHAR
('A') THEN
150 FAILED
("CHARACTER DEFAULT FAILED");
154 ACCEPT ARRY
(C
: IN ARR
:= (1, 2, 3)) DO
156 IF C
(I
) /= IDENT_INT
(I
) THEN
157 FAILED
("ARRAY " & INTEGER'IMAGE(I
) &
163 ACCEPT RECD
(D
: IN REC
:= (5, RED
, 'A')) DO
164 IF D
.A
/= IDENT_INT
(5) THEN
165 FAILED
("RECORD INTEGER DEFAULT FAILED");
167 IF D
.B
/= IDENT_ENUM
(RED
) THEN
168 FAILED
("RECORD ENUMERATION DEFAULT FAILED");
170 IF D
.C
/= IDENT_CHAR
('A') THEN
171 FAILED
("RECORD CHARACTER DEFAULT FAILED");
179 TEST
("C95092A", "CHECK THAT FOR ENTRIES OF TASKS, DEFAULT " &
180 "VALUES OF ALL TYPES CAN BE GIVEN FOR A FORMAL " &
184 TEST_DEFAULTS
.INTEGR
;
187 TEST_DEFAULTS
.ENUMERAT
;
188 TEST_DEFAULTS
.CHARACTR
;