1 |
294 |
jeremybenn |
-- C45252A.ADA
|
2 |
|
|
|
3 |
|
|
-- Grant of Unlimited Rights
|
4 |
|
|
--
|
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
|
14 |
|
|
-- to do so.
|
15 |
|
|
--
|
16 |
|
|
-- DISCLAIMER
|
17 |
|
|
--
|
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.
|
24 |
|
|
--*
|
25 |
|
|
-- FOR FIXED POINT TYPES, CHECK THAT
|
26 |
|
|
-- CONSTRAINT_ERROR IS RAISED WHEN A LITERAL USED IN A COMPARISON OR
|
27 |
|
|
-- MEMBERSHIP OPERATION (AS THE FIRST OPERAND) DOES NOT BELONG TO THE
|
28 |
|
|
-- BASE TYPE.
|
29 |
|
|
--
|
30 |
|
|
-- CHECK THAT NO EXCEPTION IS RAISED FOR A FIXED POINT RELATIONAL OR
|
31 |
|
|
-- MEMBERSHIP OPERATION IF LITERAL VALUES BELONG TO THE BASE TYPE.
|
32 |
|
|
|
33 |
|
|
-- CASE A: BASIC TYPES THAT FIT THE CHARACTERISTICS OF DURATION'BASE.
|
34 |
|
|
|
35 |
|
|
-- *** NOTE: This test has been modified since ACVC version 1.11 to -- 9X
|
36 |
|
|
-- *** remove incompatibilities associated with the transition -- 9X
|
37 |
|
|
-- *** to Ada 9X. -- 9X
|
38 |
|
|
|
39 |
|
|
-- WRG 9/10/86
|
40 |
|
|
-- JRL 03/30/93 REMOVED NUMERIC_ERROR FROM TEST.
|
41 |
|
|
|
42 |
|
|
WITH REPORT; USE REPORT;
|
43 |
|
|
PROCEDURE C45252A IS
|
44 |
|
|
|
45 |
|
|
-- THE NAME OF EACH TYPE OR SUBTYPE ENDS WITH THAT TYPE'S
|
46 |
|
|
-- 'MANTISSA VALUE.
|
47 |
|
|
|
48 |
|
|
TYPE MIDDLE_M3 IS DELTA 0.5 RANGE 0.0 .. 2.5;
|
49 |
|
|
TYPE LIKE_DURATION_M23 IS DELTA 0.020 RANGE -86_400.0 .. 86_400.0;
|
50 |
|
|
|
51 |
|
|
BEGIN
|
52 |
|
|
|
53 |
|
|
TEST ("C45252A", "CHECK RAISING OF EXCEPTIONS BY RELATIONAL " &
|
54 |
|
|
"OPERATIONS FOR FIXED POINT TYPES - BASIC TYPES");
|
55 |
|
|
|
56 |
|
|
-------------------------------------------------------------------
|
57 |
|
|
|
58 |
|
|
BEGIN
|
59 |
|
|
-- 2.0 ** 31 < 2.9E9 < 2.0 ** 32.
|
60 |
|
|
IF 2.9E9 <= LIKE_DURATION_M23'LAST THEN
|
61 |
|
|
FAILED ("2.9E9 <= LIKE_DURATION_M23'LAST");
|
62 |
|
|
END IF;
|
63 |
|
|
EXCEPTION
|
64 |
|
|
WHEN CONSTRAINT_ERROR =>
|
65 |
|
|
COMMENT ("CONSTRAINT_ERROR RAISED BY COMPARISON " &
|
66 |
|
|
"""2.9E9 <= LIKE_DURATION_M23'LAST""");
|
67 |
|
|
WHEN OTHERS =>
|
68 |
|
|
FAILED ("WRONG EXCEPTION RAISED BY COMPARISON " &
|
69 |
|
|
"""2.9E9 <= LIKE_DURATION_M23'LAST""");
|
70 |
|
|
END;
|
71 |
|
|
|
72 |
|
|
-------------------------------------------------------------------
|
73 |
|
|
|
74 |
|
|
BEGIN
|
75 |
|
|
-- 2.0 ** 63 < 1.0E19 < 2.0 ** 64.
|
76 |
|
|
IF 1.0E19 IN LIKE_DURATION_M23 THEN
|
77 |
|
|
FAILED ("1.0E19 IN LIKE_DURATION_M23");
|
78 |
|
|
END IF;
|
79 |
|
|
EXCEPTION
|
80 |
|
|
WHEN CONSTRAINT_ERROR =>
|
81 |
|
|
COMMENT ("CONSTRAINT_ERROR RAISED BY MEMBERSHIP TEST " &
|
82 |
|
|
"""1.0E19 IN LIKE_DURATION_M23""");
|
83 |
|
|
WHEN OTHERS =>
|
84 |
|
|
FAILED ("WRONG EXCEPTION RAISED BY MEMBERSHIP TEST " &
|
85 |
|
|
"""1.0E19 IN LIKE_DURATION_M23""");
|
86 |
|
|
END;
|
87 |
|
|
|
88 |
|
|
-------------------------------------------------------------------
|
89 |
|
|
|
90 |
|
|
BEGIN
|
91 |
|
|
-- 2.0 ** 63 < 1.0E19 < 2.0 ** 64.
|
92 |
|
|
IF 1.0E19 <= MIDDLE_M3'LAST THEN
|
93 |
|
|
FAILED ("1.0E19 <= MIDDLE_M3'LAST");
|
94 |
|
|
END IF;
|
95 |
|
|
EXCEPTION
|
96 |
|
|
WHEN CONSTRAINT_ERROR =>
|
97 |
|
|
COMMENT ("CONSTRAINT_ERROR RAISED BY COMPARISON " &
|
98 |
|
|
"""1.0E19 <= MIDDLE_M3'LAST""");
|
99 |
|
|
WHEN OTHERS =>
|
100 |
|
|
FAILED ("WRONG EXCEPTION RAISED BY COMPARISON " &
|
101 |
|
|
"""1.0E19 <= MIDDLE_M3'LAST""");
|
102 |
|
|
END;
|
103 |
|
|
|
104 |
|
|
-------------------------------------------------------------------
|
105 |
|
|
|
106 |
|
|
BEGIN
|
107 |
|
|
-- 2.0 ** 31 < 2.9E9 < 2.0 ** 32.
|
108 |
|
|
IF 2.9E9 IN MIDDLE_M3 THEN
|
109 |
|
|
FAILED ("2.9E9 IN MIDDLE_M3");
|
110 |
|
|
END IF;
|
111 |
|
|
EXCEPTION
|
112 |
|
|
WHEN CONSTRAINT_ERROR =>
|
113 |
|
|
COMMENT ("CONSTRAINT_ERROR RAISED BY MEMBERSHIP TEST " &
|
114 |
|
|
"""2.9E9 IN MIDDLE_M3""");
|
115 |
|
|
WHEN OTHERS =>
|
116 |
|
|
FAILED ("WRONG EXCEPTION RAISED BY MEMBERSHIP TEST " &
|
117 |
|
|
"""2.9E9 IN MIDDLE_M3""");
|
118 |
|
|
END;
|
119 |
|
|
|
120 |
|
|
-------------------------------------------------------------------
|
121 |
|
|
|
122 |
|
|
BEGIN
|
123 |
|
|
-- 3.5 IS A MODEL NUMBER OF THE TYPE MIDDLE_M3.
|
124 |
|
|
IF 3.5 <= MIDDLE_M3'LAST THEN
|
125 |
|
|
FAILED ("3.5 <= MIDDLE_M3'LAST");
|
126 |
|
|
END IF;
|
127 |
|
|
EXCEPTION
|
128 |
|
|
WHEN CONSTRAINT_ERROR =>
|
129 |
|
|
FAILED ("CONSTRAINT_ERROR RAISED BY COMPARISON " &
|
130 |
|
|
"""3.5 <= MIDDLE_M3'LAST""");
|
131 |
|
|
WHEN OTHERS =>
|
132 |
|
|
FAILED ("SOME EXCEPTION RAISED BY COMPARISON " &
|
133 |
|
|
"""3.5 <= MIDDLE_M3'LAST""");
|
134 |
|
|
END;
|
135 |
|
|
|
136 |
|
|
-------------------------------------------------------------------
|
137 |
|
|
|
138 |
|
|
BEGIN
|
139 |
|
|
IF 3.0 IN MIDDLE_M3 THEN
|
140 |
|
|
FAILED ("3.0 IN MIDDLE_M3");
|
141 |
|
|
END IF;
|
142 |
|
|
EXCEPTION
|
143 |
|
|
WHEN CONSTRAINT_ERROR =>
|
144 |
|
|
FAILED ("CONSTRAINT_ERROR RAISED BY MEMBERSHIP TEST " &
|
145 |
|
|
"""3.0 IN MIDDLE_M3""");
|
146 |
|
|
WHEN OTHERS =>
|
147 |
|
|
FAILED ("SOME EXCEPTION RAISED BY MEMBERSHIP TEST " &
|
148 |
|
|
"""3.0 IN MIDDLE_M3""");
|
149 |
|
|
END;
|
150 |
|
|
|
151 |
|
|
-------------------------------------------------------------------
|
152 |
|
|
|
153 |
|
|
BEGIN
|
154 |
|
|
IF 86_450.0 <= LIKE_DURATION_M23'LAST THEN
|
155 |
|
|
FAILED ("86_450.0 <= LIKE_DURATION_M23'LAST");
|
156 |
|
|
END IF;
|
157 |
|
|
EXCEPTION
|
158 |
|
|
WHEN CONSTRAINT_ERROR =>
|
159 |
|
|
FAILED ("CONSTRAINT_ERROR RAISED BY COMPARISON " &
|
160 |
|
|
"""86_450.0 <= LIKE_DURATION_M23'LAST""");
|
161 |
|
|
WHEN OTHERS =>
|
162 |
|
|
FAILED ("SOME EXCEPTION RAISED BY COMPARISON " &
|
163 |
|
|
"""86_450.0 <= LIKE_DURATION_M23'LAST""");
|
164 |
|
|
END;
|
165 |
|
|
|
166 |
|
|
-------------------------------------------------------------------
|
167 |
|
|
|
168 |
|
|
BEGIN
|
169 |
|
|
IF 86_500.0 IN LIKE_DURATION_M23 THEN
|
170 |
|
|
FAILED ("86_500.0 IN LIKE_DURATION_M23");
|
171 |
|
|
END IF;
|
172 |
|
|
EXCEPTION
|
173 |
|
|
WHEN CONSTRAINT_ERROR =>
|
174 |
|
|
FAILED ("CONSTRAINT_ERROR RAISED BY MEMBERSHIP TEST " &
|
175 |
|
|
"""86_500.0 IN LIKE_DURATION_M23""");
|
176 |
|
|
WHEN OTHERS =>
|
177 |
|
|
FAILED ("SOME EXCEPTION RAISED BY MEMBERSHIP TEST " &
|
178 |
|
|
"""86_500.0 IN LIKE_DURATION_M23""");
|
179 |
|
|
END;
|
180 |
|
|
|
181 |
|
|
-------------------------------------------------------------------
|
182 |
|
|
|
183 |
|
|
BEGIN
|
184 |
|
|
IF -86_450.0 IN LIKE_DURATION_M23 THEN
|
185 |
|
|
FAILED ("-86_450.0 IN LIKE_DURATION_M23");
|
186 |
|
|
END IF;
|
187 |
|
|
EXCEPTION
|
188 |
|
|
WHEN CONSTRAINT_ERROR =>
|
189 |
|
|
FAILED ("CONSTRAINT_ERROR RAISED BY MEMBERSHIP TEST " &
|
190 |
|
|
"""-86_450.0 IN LIKE_DURATION_M23""");
|
191 |
|
|
WHEN OTHERS =>
|
192 |
|
|
FAILED ("SOME EXCEPTION RAISED BY MEMBERSHIP TEST " &
|
193 |
|
|
"""-86_450.0 IN LIKE_DURATION_M23""");
|
194 |
|
|
END;
|
195 |
|
|
|
196 |
|
|
-------------------------------------------------------------------
|
197 |
|
|
|
198 |
|
|
RESULT;
|
199 |
|
|
|
200 |
|
|
END C45252A;
|