1 |
294 |
jeremybenn |
-- C45262B.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 |
|
|
-- CHECK THAT ORDERING COMPARISONS YIELD CORRECT RESULTS FOR
|
26 |
|
|
-- ONE-DIMENSIONAL DISCRETE ARRAY TYPES. THIS TEST CHECKS STRING TYPES.
|
27 |
|
|
|
28 |
|
|
-- JWC 9/9/85
|
29 |
|
|
-- JRK 6/24/86 FIXED SPELLING IN FAILURE MESSAGE.
|
30 |
|
|
|
31 |
|
|
WITH REPORT; USE REPORT;
|
32 |
|
|
|
33 |
|
|
PROCEDURE C45262B IS
|
34 |
|
|
BEGIN
|
35 |
|
|
TEST ("C45262B", "ORDERING COMPARISONS OF ONE-DIMENSIONAL " &
|
36 |
|
|
"DISCRETE ARRAY TYPES - TYPE STRING");
|
37 |
|
|
|
38 |
|
|
DECLARE
|
39 |
|
|
|
40 |
|
|
STRING1 : STRING(2 .. IDENT_INT(1));
|
41 |
|
|
STRING2 : STRING(3 .. IDENT_INT(1));
|
42 |
|
|
STRING3 : STRING(2 .. IDENT_INT(2)) := (IDENT_INT(2) => 'A');
|
43 |
|
|
STRING4 : STRING(1 .. IDENT_INT(1)) := (IDENT_INT(1) => 'A');
|
44 |
|
|
STRING5 : STRING(1 .. IDENT_INT(1)) := (IDENT_INT(1) => 'B');
|
45 |
|
|
STRING6 : STRING(2 .. IDENT_INT(6)) :=
|
46 |
|
|
(2 .. IDENT_INT(6) => 'A');
|
47 |
|
|
STRING7 : STRING(1 .. 5) := (1 .. 4 => 'A', 5 => 'B');
|
48 |
|
|
STRING8 : STRING(1 .. IDENT_INT(5)) :=
|
49 |
|
|
(1 .. IDENT_INT(5) => 'A');
|
50 |
|
|
STRING9 : STRING(1 .. IDENT_INT(4)) :=
|
51 |
|
|
(1 .. IDENT_INT(4) => 'A');
|
52 |
|
|
STRINGA : STRING(1 .. IDENT_INT(4)) :=
|
53 |
|
|
(1 .. IDENT_INT(4) => 'B');
|
54 |
|
|
|
55 |
|
|
BEGIN
|
56 |
|
|
IF STRING1 < STRING2 THEN
|
57 |
|
|
FAILED ("NULL ARRAYS STRING1 AND STRING2 NOT EQUAL - <");
|
58 |
|
|
END IF;
|
59 |
|
|
|
60 |
|
|
IF NOT (STRING1 <= STRING2) THEN
|
61 |
|
|
FAILED ("NULL ARRAYS STRING1 AND STRING2 NOT EQUAL - " &
|
62 |
|
|
"<=");
|
63 |
|
|
END IF;
|
64 |
|
|
|
65 |
|
|
IF STRING1 > STRING2 THEN
|
66 |
|
|
FAILED ("NULL ARRAYS STRING1 AND STRING2 NOT EQUAL - >");
|
67 |
|
|
END IF;
|
68 |
|
|
|
69 |
|
|
IF NOT ( ">=" (STRING1, STRING2) ) THEN
|
70 |
|
|
FAILED ("NULL ARRAYS STRING1 AND STRING2 NOT EQUAL - " &
|
71 |
|
|
">=");
|
72 |
|
|
END IF;
|
73 |
|
|
|
74 |
|
|
IF STRING3 < STRING1 THEN
|
75 |
|
|
FAILED ("NON-NULL ARRAY STRING3 LESS THAN NULL STRING1");
|
76 |
|
|
END IF;
|
77 |
|
|
|
78 |
|
|
IF STRING3 <= STRING1 THEN
|
79 |
|
|
FAILED ("NON-NULL ARRAY STRING3 LESS THAN EQUAL NULL " &
|
80 |
|
|
"STRING1");
|
81 |
|
|
END IF;
|
82 |
|
|
|
83 |
|
|
IF NOT ( ">" (STRING3, STRING1) ) THEN
|
84 |
|
|
FAILED ("NON-NULL ARRAY STRING3 NOT GREATER THAN NULL " &
|
85 |
|
|
"STRING1");
|
86 |
|
|
END IF;
|
87 |
|
|
|
88 |
|
|
IF NOT (STRING3 >= STRING1) THEN
|
89 |
|
|
FAILED ("NON-NULL ARRAY STRING3 NOT GREATER THAN " &
|
90 |
|
|
"EQUAL NULL STRING1");
|
91 |
|
|
END IF;
|
92 |
|
|
|
93 |
|
|
IF STRING3 < STRING4 THEN
|
94 |
|
|
FAILED ("DIFFERENT BOUNDS, SAME NUMBER OF COMPONENTS, " &
|
95 |
|
|
"COMPONENTS EQUAL - <");
|
96 |
|
|
END IF;
|
97 |
|
|
|
98 |
|
|
IF NOT ( "<=" (STRING3, STRING4) ) THEN
|
99 |
|
|
FAILED ("DIFFERENT BOUNDS, SAME NUMBER OF COMPONENTS, " &
|
100 |
|
|
"COMPONENTS EQUAL - <=");
|
101 |
|
|
END IF;
|
102 |
|
|
|
103 |
|
|
IF STRING3 > STRING4 THEN
|
104 |
|
|
FAILED ("DIFFERENT BOUNDS, SAME NUMBER OF COMPONENTS, " &
|
105 |
|
|
"COMPONENTS EQUAL - >");
|
106 |
|
|
END IF;
|
107 |
|
|
|
108 |
|
|
IF NOT (STRING3 >= STRING4) THEN
|
109 |
|
|
FAILED ("DIFFERENT BOUNDS, SAME NUMBER OF COMPONENTS, " &
|
110 |
|
|
"COMPONENTS EQUAL - >=");
|
111 |
|
|
END IF;
|
112 |
|
|
|
113 |
|
|
IF NOT ( "<" (STRING3, STRING5) ) THEN
|
114 |
|
|
FAILED ("DIFFERENT BOUNDS, SAME NUMBER OF COMPONENTS, " &
|
115 |
|
|
"COMPONENTS NOT EQUAL - <");
|
116 |
|
|
END IF;
|
117 |
|
|
|
118 |
|
|
IF NOT (STRING3 <= STRING5) THEN
|
119 |
|
|
FAILED ("DIFFERENT BOUNDS, SAME NUMBER OF COMPONENTS, " &
|
120 |
|
|
"COMPONENTS NOT EQUAL - <=");
|
121 |
|
|
END IF;
|
122 |
|
|
|
123 |
|
|
IF STRING3 > STRING5 THEN
|
124 |
|
|
FAILED ("DIFFERENT BOUNDS, SAME NUMBER OF COMPONENTS, " &
|
125 |
|
|
"COMPONENTS NOT EQUAL - >");
|
126 |
|
|
END IF;
|
127 |
|
|
|
128 |
|
|
IF STRING3 >= STRING5 THEN
|
129 |
|
|
FAILED ("DIFFERENT BOUNDS, SAME NUMBER OF COMPONENTS, " &
|
130 |
|
|
"COMPONENTS NOT EQUAL - >=");
|
131 |
|
|
END IF;
|
132 |
|
|
|
133 |
|
|
IF NOT (STRING6 < STRING7) THEN
|
134 |
|
|
FAILED ("DIFFERENT BOUNDS, SAME NUMBER OF COMPONENTS, " &
|
135 |
|
|
"MULTIPLE COMPONENTS, COMPONENTS NOT EQUAL - <");
|
136 |
|
|
END IF;
|
137 |
|
|
|
138 |
|
|
IF NOT (STRING6 <= STRING7) THEN
|
139 |
|
|
FAILED ("DIFFERENT BOUNDS, SAME NUMBER OF COMPONENTS, " &
|
140 |
|
|
"MULTIPLE COMPONENTS, COMPONENTS NOT EQUAL - " &
|
141 |
|
|
"<=");
|
142 |
|
|
END IF;
|
143 |
|
|
|
144 |
|
|
IF STRING6 > STRING7 THEN
|
145 |
|
|
FAILED ("DIFFERENT BOUNDS, SAME NUMBER OF COMPONENTS, " &
|
146 |
|
|
"MULTIPLE COMPONENTS, COMPONENTS NOT EQUAL - >");
|
147 |
|
|
END IF;
|
148 |
|
|
|
149 |
|
|
IF ">=" (LEFT => STRING6, RIGHT => STRING7) THEN
|
150 |
|
|
FAILED ("DIFFERENT BOUNDS, SAME NUMBER OF COMPONENTS, " &
|
151 |
|
|
"MULTIPLE COMPONENTS, COMPONENTS NOT EQUAL - " &
|
152 |
|
|
">=");
|
153 |
|
|
END IF;
|
154 |
|
|
|
155 |
|
|
IF STRING6 < STRING8 THEN
|
156 |
|
|
FAILED ("DIFFERENT BOUNDS, SAME NUMBER OF COMPONENTS, " &
|
157 |
|
|
"MULTIPLE COMPONENTS, COMPONENTS EQUAL - <");
|
158 |
|
|
END IF;
|
159 |
|
|
|
160 |
|
|
IF NOT (STRING6 <= STRING8) THEN
|
161 |
|
|
FAILED ("DIFFERENT BOUNDS, SAME NUMBER OF COMPONENTS, " &
|
162 |
|
|
"MULTIPLE COMPONENTS, COMPONENTS EQUAL - <=");
|
163 |
|
|
END IF;
|
164 |
|
|
|
165 |
|
|
IF ">" (RIGHT => STRING8, LEFT => STRING6) THEN
|
166 |
|
|
FAILED ("DIFFERENT BOUNDS, SAME NUMBER OF COMPONENTS, " &
|
167 |
|
|
"MULTIPLE COMPONENTS, COMPONENTS EQUAL - >");
|
168 |
|
|
END IF;
|
169 |
|
|
|
170 |
|
|
IF NOT (STRING6 >= STRING8) THEN
|
171 |
|
|
FAILED ("DIFFERENT BOUNDS, SAME NUMBER OF COMPONENTS, " &
|
172 |
|
|
"MULTIPLE COMPONENTS, COMPONENTS EQUAL - >=");
|
173 |
|
|
END IF;
|
174 |
|
|
|
175 |
|
|
IF STRING8 < STRING9 THEN
|
176 |
|
|
FAILED ("DIFFERENT NUMBER OF COMPONENTS, " &
|
177 |
|
|
"COMPONENTS EQUAL - <");
|
178 |
|
|
END IF;
|
179 |
|
|
|
180 |
|
|
IF STRING8 <= STRING9 THEN
|
181 |
|
|
FAILED ("DIFFERENT NUMBER OF COMPONENTS, " &
|
182 |
|
|
"COMPONENTS EQUAL - <=");
|
183 |
|
|
END IF;
|
184 |
|
|
|
185 |
|
|
IF NOT (STRING8 > STRING9) THEN
|
186 |
|
|
FAILED ("DIFFERENT NUMBER OF COMPONENTS, " &
|
187 |
|
|
"COMPONENTS EQUAL - >");
|
188 |
|
|
END IF;
|
189 |
|
|
|
190 |
|
|
IF NOT (STRING8 >= STRING9) THEN
|
191 |
|
|
FAILED ("DIFFERENT NUMBER OF COMPONENTS, " &
|
192 |
|
|
"COMPONENTS EQUAL - >=");
|
193 |
|
|
END IF;
|
194 |
|
|
|
195 |
|
|
IF NOT (STRING8 < STRINGA) THEN
|
196 |
|
|
FAILED ("DIFFERENT NUMBER OF COMPONENTS, " &
|
197 |
|
|
"COMPONENTS NOT EQUAL - <");
|
198 |
|
|
END IF;
|
199 |
|
|
|
200 |
|
|
IF NOT (STRING8 <= STRINGA) THEN
|
201 |
|
|
FAILED ("DIFFERENT NUMBER OF COMPONENTS, " &
|
202 |
|
|
"COMPONENTS NOT EQUAL - <=");
|
203 |
|
|
END IF;
|
204 |
|
|
|
205 |
|
|
IF STRING8 > STRINGA THEN
|
206 |
|
|
FAILED ("DIFFERENT NUMBER OF COMPONENTS, " &
|
207 |
|
|
"COMPONENTS NOT EQUAL - >");
|
208 |
|
|
END IF;
|
209 |
|
|
|
210 |
|
|
IF STRING8 >= STRINGA THEN
|
211 |
|
|
FAILED ("DIFFERENT NUMBER OF COMPONENTS, " &
|
212 |
|
|
"COMPONENTS NOT EQUAL - >=");
|
213 |
|
|
END IF;
|
214 |
|
|
|
215 |
|
|
END;
|
216 |
|
|
|
217 |
|
|
RESULT;
|
218 |
|
|
|
219 |
|
|
END C45262B;
|