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 -- FOR DERIVED FIXED POINT TYPES:
28 -- CHECK THAT ALL VALUES OF THE PARENT (BASE) TYPE ARE PRESENT FOR
29 -- THE DERIVED (BASE) TYPE WHEN THE DERIVED TYPE DEFINITION IS
32 -- CHECK THAT ANY CONSTRAINT IMPOSED ON THE PARENT SUBTYPE IS ALSO
33 -- IMPOSED ON THE DERIVED SUBTYPE.
37 -- JLH 09/25/87 REFORMATTED HEADER.
38 -- JRL 03/13/92 MODIFIED TO DEFEAT OPTIMIZATION WHEN ATTEMPTING TO
39 -- RAISE CONSTRAINT_ERROR.
40 -- JRL 03/30/93 REMOVED NUMERIC_ERROR FROM TEST.
41 -- DTN 11/30/95 REMOVED NON ADA95 ATTRIBUTES.
43 WITH SYSTEM
; USE SYSTEM
;
44 WITH REPORT
; USE REPORT
;
48 TYPE PARENT
IS DELTA 0.01 RANGE -100.0 .. 100.0;
50 TYPE T
IS NEW PARENT
DELTA 0.1 RANGE
51 IDENT_INT
(1) * (-30.0) ..
52 IDENT_INT
(1) * ( 30.0);
54 SUBTYPE SUBPARENT
IS PARENT
DELTA 0.1 RANGE -30.0 .. 30.0;
56 TYPE S
IS NEW SUBPARENT
;
62 FUNCTION OUT_OF_BOUNDS
( VAR1
, VAR2
: T
) RETURN BOOLEAN IS
64 IF ( VAR1
+ VAR2
) IN T
THEN
70 WHEN CONSTRAINT_ERROR
=>
75 FUNCTION OUT_OF_BOUNDS
( VAR1
, VAR2
: S
) RETURN BOOLEAN IS
77 IF ( VAR1
+ VAR2
) IN S
THEN
83 WHEN CONSTRAINT_ERROR
=>
89 TEST
("C34004C", "CHECK THAT ALL VALUES OF THE PARENT (BASE) " &
90 "TYPE ARE PRESENT FOR THE DERIVED (BASE) TYPE " &
91 "WHEN THE DERIVED TYPE DEFINITION IS " &
92 "CONSTRAINED. ALSO CHECK THAT ANY CONSTRAINT " &
93 "IMPOSED ON THE PARENT SUBTYPE IS ALSO IMPOSED " &
94 "ON THE DERIVED SUBTYPE. CHECK FOR DERIVED " &
97 -- CHECK THAT BASE TYPE VALUES NOT IN THE SUBTYPE ARE PRESENT.
100 TBD
: CONSTANT := BOOLEAN'POS (T
'BASE'DELTA <= 0.01);
101 SBD : CONSTANT := BOOLEAN'POS (S'BASE'DELTA <= 0.01);
103 IF TBD
= 0 OR SBD
= 0 THEN
104 FAILED
("INCORRECT 'BASE'DELTA");
110 N
: INTEGER := IDENT_INT
(8);
112 IF 98.0 + T
'(1.0) + N * 0.0078125 /= 99.0625 OR
113 98.0 + S'(1.0) + 8 * 0.0078125 /= 99.0625 OR
114 -98.0 - T
'(1.0) - N * 0.0078125 /= -99.0625 OR
115 -98.0 - S'(1.0) - 8 * 0.0078125 /= -99.0625 THEN
116 FAILED
("INCORRECT + OR -");
121 IF T
'FIRST /= -30.0 OR T
'LAST /= 30.0 OR
122 S
'FIRST /= -30.0 OR S
'LAST /= 30.0 THEN
123 FAILED
("INCORRECT 'FIRST OR 'LAST");
129 IF PARENT
(X
) /= PARENT
(Y
) THEN -- USE X AND Y.
130 FAILED
("INCORRECT CONVERSION TO PARENT - 1");
134 IF PARENT
(X
) /= PARENT
(Y
) THEN -- USE X AND Y.
135 FAILED
("INCORRECT CONVERSION TO PARENT - 2");
139 FAILED
("EXCEPTION RAISED BY OK ASSIGNMENT");
146 IF NOT OUT_OF_BOUNDS
( X
, XA
) THEN
147 FAILED
( "CONSTRAINT_ERROR NOT RAISED -- X := -30.0625" ) ;
151 FAILED
("WRONG EXCEPTION RAISED -- X := -30.0625");
158 IF NOT OUT_OF_BOUNDS
( X
, XA
) THEN
159 FAILED
( "CONSTRAINT_ERROR NOT RAISED -- X := 30.0625" ) ;
163 FAILED
("WRONG EXCEPTION RAISED -- X := 30.0625");
170 IF NOT OUT_OF_BOUNDS
( Y
, YA
) THEN
171 FAILED
( "CONSTRAINT_ERROR NOT RAISED -- Y := -30.0625" ) ;
175 FAILED
("WRONG EXCEPTION RAISED -- Y := -30.0625");
182 IF NOT OUT_OF_BOUNDS
( Y
, YA
) THEN
183 FAILED
( "CONSTRAINT_ERROR NOT RAISED -- Y := 30.0625" ) ;
187 FAILED
("WRONG EXCEPTION RAISED -- Y := 30.0625");