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 WHEN A VARIABLE OR CONSTANT HAVING AN ENUMERATION,
27 -- INTEGER, FLOAT OR FIXED TYPE IS DECLARED WITH AN INITIAL STATIC
28 -- VALUE, CONSTRAINT_ERROR IS RAISED IF THE INITIAL VALUE LIES
29 -- OUTSIDE THE RANGE OF THE SUBTYPE.
32 -- JET 08/04/87 CREATED ORIGINAL TEST BASED ON C32111A BY RJW
33 -- BUT WITH STATIC VALUES INSTEAD OF DYNAMIC
36 WITH REPORT
; USE REPORT
;
40 TYPE WEEKDAY
IS (MON
, TUES
, WED
, THURS
, FRI
);
41 SUBTYPE MIDWEEK
IS WEEKDAY
RANGE WED
.. WED
;
43 SUBTYPE DIGIT
IS CHARACTER RANGE '0' .. '9';
45 SUBTYPE SHORT
IS INTEGER RANGE -100 .. 100;
47 TYPE INT
IS RANGE -10 .. 10;
48 SUBTYPE PINT
IS INT
RANGE 1 .. 10;
50 TYPE FLT
IS DIGITS 3 RANGE -5.0 .. 5.0;
51 SUBTYPE SFLT
IS FLT
RANGE -5.0 .. 0.0;
53 TYPE FIXED
IS DELTA 0.5 RANGE -5.0 .. 5.0;
54 SUBTYPE SFIXED
IS FIXED
RANGE 0.0 .. 5.0;
57 TEST
("C32111B", "CHECK THAT WHEN A VARIABLE OR CONSTANT " &
58 "HAVING AN ENUMERATION, INTEGER, FLOAT OR " &
59 "FIXED TYPE IS DECLARED WITH AN INITIAL STATIC " &
60 "VALUE, CONSTRAINT_ERROR IS RAISED IF THE " &
61 "INITIAL VALUE LIES OUTSIDE THE RANGE OF THE " &
66 D
: MIDWEEK
:= WEEKDAY
'VAL (1);
68 FAILED
( "NO EXCEPTION RAISED FOR INITIALIZATION " &
71 COMMENT
("VARIABLE 'D' INITIALIZED");
75 WHEN CONSTRAINT_ERROR
=>
78 FAILED
( "WRONG EXCEPTION RAISED FOR INITIALIZATION " &
84 D
: CONSTANT WEEKDAY
RANGE WED
.. WED
:=
87 FAILED
( "NO EXCEPTION RAISED FOR INITIALIZATION " &
90 COMMENT
("INITIALIZE VARIABLE 'D'");
94 WHEN CONSTRAINT_ERROR
=>
97 FAILED
( "WRONG EXCEPTION RAISED FOR INITIALIZATION " &
103 P
: CONSTANT DIGIT
:= '/';
105 FAILED
( "NO EXCEPTION RAISED FOR INITIALIZATION " &
108 COMMENT
("VARIABLE 'P' INITIALIZED");
112 WHEN CONSTRAINT_ERROR
=>
115 FAILED
( "WRONG EXCEPTION RAISED FOR INITIALIZATION " &
121 Q
: CHARACTER RANGE 'A' .. 'E' := 'F';
123 FAILED
( "NO EXCEPTION RAISED FOR INITIALIZATION " &
126 COMMENT
("VARIABLE 'Q' INITIALIZED");
130 WHEN CONSTRAINT_ERROR
=>
133 FAILED
( "WRONG EXCEPTION RAISED FOR INITIALIZATION " &
141 FAILED
( "NO EXCEPTION RAISED FOR INITIALIZATION " &
144 COMMENT
("VARIABLE 'I' INITIALIZED");
148 WHEN CONSTRAINT_ERROR
=>
151 FAILED
( "WRONG EXCEPTION RAISED FOR INITIALIZATION " &
157 J
: CONSTANT INTEGER RANGE 0 .. 100 := 101;
159 FAILED
( "NO EXCEPTION RAISED FOR INITIALIZATION " &
162 COMMENT
("VARIABLE 'J' INITIALIZED");
166 WHEN CONSTRAINT_ERROR
=>
169 FAILED
( "WRONG EXCEPTION RAISED FOR INITIALIZATION " &
175 K
: INT
RANGE 0 .. 1 := 2;
177 FAILED
( "NO EXCEPTION RAISED FOR INITIALIZATION " &
180 COMMENT
("VARIABLE 'K' INITIALIZED");
184 WHEN CONSTRAINT_ERROR
=>
187 FAILED
( "WRONG EXCEPTION RAISED FOR INITIALIZATION " &
193 L
: CONSTANT PINT
:= 0;
195 FAILED
( "NO EXCEPTION RAISED FOR INITIALIZATION " &
198 COMMENT
("VARIABLE 'L' INITIALIZED");
202 WHEN CONSTRAINT_ERROR
=>
205 FAILED
( "WRONG EXCEPTION RAISED FOR INITIALIZATION " &
213 FAILED
( "NO EXCEPTION RAISED FOR INITIALIZATION " &
214 "OF VARIABLE 'FL'" );
216 COMMENT
("VARIABLE 'FL' INITIALIZED");
220 WHEN CONSTRAINT_ERROR
=>
223 FAILED
( "WRONG EXCEPTION RAISED FOR INITIALIZATION " &
224 "OF VARIABLE 'FL'" );
229 FL1
: CONSTANT FLT
RANGE 0.0 .. 0.0 := -1.0;
231 FAILED
( "NO EXCEPTION RAISED FOR INITIALIZATION " &
232 "OF CONSTANT 'FL1'" );
234 COMMENT
("VARIABLE 'FL1' INITIALIZED");
238 WHEN CONSTRAINT_ERROR
=>
241 FAILED
( "WRONG EXCEPTION RAISED FOR INITIALIZATION " &
242 "OF CONSTANT 'FL1'" );
247 FI
: FIXED
RANGE 0.0 .. 0.0 := 0.5;
249 FAILED
( "NO EXCEPTION RAISED FOR INITIALIZATION " &
250 "OF VARIABLE 'FI'" );
252 COMMENT
("VARIABLE 'FI' INITIALIZED");
256 WHEN CONSTRAINT_ERROR
=>
259 FAILED
( "WRONG EXCEPTION RAISED FOR INITIALIZATION " &
260 "OF VARIABLE 'FI'" );
265 FI1
: CONSTANT SFIXED
:= -0.5;
267 FAILED
( "NO EXCEPTION RAISED FOR INITIALIZATION " &
268 "OF CONSTANT 'FI1'" );
270 COMMENT
("VARIABLE 'FI1' INITIALIZED");
274 WHEN CONSTRAINT_ERROR
=>
277 FAILED
( "WRONG EXCEPTION RAISED FOR INITIALIZATION " &
278 "OF CONSTANT 'FI1'" );