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.
25 -- CHECK THAT CONSTRAINT_ERROR IS RAISED FOR A GENERIC IN PARAMETER
26 -- HAVING A FIXED POINT TYPE IF AND ONLY IF THE VALUE OF THE ACTUAL
27 -- PARAMETER LIES OUTSIDE THE RANGE OF THE FORMAL PARAMETER.
31 WITH REPORT
; USE REPORT
;
34 TYPE FIXED
IS DELTA 0.125 RANGE -10.0 .. 10.0;
35 SUBTYPE FIX
IS FIXED
RANGE -5.0 .. 5.0;
37 FUNCTION IDENT_FIX
(X
: FIXED
) RETURN FIXED
IS
46 TEST
("CC3125D", "CHECK THAT CONSTRAINT_ERROR IS RAISED FOR A " &
47 "GENERIC IN PARAMETER HAVING A FIXED POINT " &
48 "TYPE IF AND ONLY IF THE VALUE OF THE ACTUAL " &
49 "PARAMETER LIES OUTSIDE THE RANGE OF THE " &
55 PAC_FIX
: FIXED
:= GEN_FIX
;
60 PACKAGE P1
IS NEW P
(IDENT_FIX
(-5.0));
62 IF P1
.PAC_FIX
/= IDENT_FIX
(-5.0) THEN
63 FAILED
("INCORRECT VALUE PASSED - 1");
68 FAILED
("EXCEPTION RAISED - 1");
73 PACKAGE P2
IS NEW P
(IDENT_FIX
(-5.2));
75 FAILED
("NO EXCEPTION RAISED - 2");
78 WHEN CONSTRAINT_ERROR
=>
81 FAILED
("UNEXPECTED EXCEPTION RAISED - 2");
86 PACKAGE P3
IS NEW P
(IDENT_FIX
(5.2));
88 FAILED
("NO EXCEPTION RAISED - 3");
91 WHEN CONSTRAINT_ERROR
=>
94 FAILED
("UNEXPECTED EXCEPTION RAISED - 3");
97 -------------------------------------------------------------------
101 TYPE GEN_TYP
IS DELTA <>;
102 GEN_FIX
: IN GEN_TYP
;
104 PAC_FIX
: GEN_TYP
:= GEN_FIX
;
109 PACKAGE Q1
IS NEW Q
(FIX
, IDENT_FIX
(5.0));
111 IF Q1
.PAC_FIX
/= IDENT_FIX
(5.0) THEN
112 FAILED
("INCORRECT VALUE PASSED - 4");
117 FAILED
("EXCEPTION RAISED - 4");
122 PACKAGE Q2
IS NEW Q
(FIX
, IDENT_FIX
(-5.2));
124 FAILED
("NO EXCEPTION RAISED - 5");
127 WHEN CONSTRAINT_ERROR
=>
130 FAILED
("UNEXPECTED EXCEPTION RAISED - 5");
135 PACKAGE Q3
IS NEW Q
(FIX
, IDENT_FIX
(5.2));
137 FAILED
("NO EXCEPTION RAISED - 6");
140 WHEN CONSTRAINT_ERROR
=>
143 FAILED
("UNEXPECTED EXCEPTION RAISED - 6");