1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
|
-- REPBODY.ADA
--
-- Grant of Unlimited Rights
--
-- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
-- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
-- unlimited rights in the software and documentation contained herein.
-- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
-- this public release, the Government intends to confer upon all
-- recipients unlimited rights equal to those held by the Government.
-- These rights include rights to use, duplicate, release or disclose the
-- released technical data and computer software in whole or in part, in
-- any manner and for any purpose whatsoever, and to have or permit others
-- to do so.
--
-- DISCLAIMER
--
-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
-- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
-- PARTICULAR PURPOSE OF SAID MATERIAL.
--*
--
-- HISTORY:
-- DCB 04/27/80
-- JRK 6/10/80
-- JRK 11/12/80
-- JRK 8/6/81
-- JRK 10/27/82
-- JRK 6/1/84
-- JRK 11/18/85 ADDED PRAGMA ELABORATE.
-- PWB 07/29/87 ADDED STATUS ACTION_REQUIRED AND
-- PROCEDURE SPECIAL_ACTION.
-- TBN 08/20/87 ADDED FUNCTION LEGAL_FILE_NAME.
-- BCB 05/17/90 MODIFIED TO ALLOW OUTPUT TO DIRECT_IO FILE.
-- ADDED TIME-STAMP.
-- LDC 05/17/90 REMOVED OUTPUT TO DIRECT_IO FILE.
-- WMC 08/11/92 UPDATED ACVC VERSION STRING TO "9X BASIC".
-- DTN 07/05/92 UPDATED ACVC VERSION STRING TO
-- "ACVC 2.0 JULY 6 1993 DRAFT".
-- WMC 01/24/94 MODIFIED LEGAL_FILE_NAME TO ALLOW FIVE POSSIBLE
-- FILE NAMES (INCREASED RANGE OF TYPE FILE_NUM TO 1..5).
-- WMC 11/06/94 UPDATED ACVC VERSION STRING TO
-- "ACVC 2.0 NOVEMBER 6 1994 DRAFT".
-- DTN 12/04/94 UPDATED ACVC VERSION STRING TO
-- "ACVC 2.0".
-- KAS 06/19/95 ADDED FUNCTION IDENT_WIDE_CHAR.
-- KAS 06/19/95 ADDED FUNCTION IDENT_WIDE_STR.
-- DTN 11/21/95 UPDATED ACVC VERSION STRING TO
-- "ACVC 2.0.1".
-- DTN 12/14/95 UPDATED ACVC VERSION STRING TO
-- "ACVC 2.1".
-- EDS 12/17/97 UPDATED ACVC VERSION STRING TO
-- "2.2".
-- RLB 3/16/00 UPDATED ACATS VERSION STRING TO "2.3".
-- CHANGED VARIOUS STRINGS TO READ "ACATS".
-- RLB 3/22/01 UPDATED ACATS VERSION STRING TO "2.4".
-- RLB 3/29/01 UPDATED ACATS VERSION STRING TO "2.5".
WITH TEXT_IO, CALENDAR;
USE TEXT_IO, CALENDAR;
PRAGMA ELABORATE (TEXT_IO, CALENDAR);
PACKAGE BODY REPORT IS
TYPE STATUS IS (PASS, FAIL, DOES_NOT_APPLY, ACTION_REQUIRED,
UNKNOWN);
TYPE TIME_INTEGER IS RANGE 0 .. 86_400;
TEST_STATUS : STATUS := FAIL;
MAX_NAME_LEN : CONSTANT := 15; -- MAXIMUM TEST NAME LENGTH.
TEST_NAME : STRING (1..MAX_NAME_LEN);
NO_NAME : CONSTANT STRING (1..7) := "NO_NAME";
TEST_NAME_LEN : INTEGER RANGE 0..MAX_NAME_LEN := 0;
ACATS_VERSION : CONSTANT STRING := "2.5";
-- VERSION OF ACATS BEING RUN (X.XX).
PROCEDURE PUT_MSG (MSG : STRING) IS
-- WRITE MESSAGE. LONG MESSAGES ARE FOLDED (AND INDENTED).
MAX_LEN : CONSTANT INTEGER RANGE 50..150 := 72; -- MAXIMUM
-- OUTPUT LINE LENGTH.
INDENT : CONSTANT INTEGER := TEST_NAME_LEN + 9; -- AMOUNT TO
-- INDENT CONTINUATION LINES.
I : INTEGER := 0; -- CURRENT INDENTATION.
M : INTEGER := MSG'FIRST; -- START OF MESSAGE SLICE.
N : INTEGER; -- END OF MESSAGE SLICE.
BEGIN
LOOP
IF I + (MSG'LAST-M+1) > MAX_LEN THEN
N := M + (MAX_LEN-I) - 1;
IF MSG (N) /= ' ' THEN
WHILE N >= M AND THEN MSG (N+1) /= ' ' LOOP
N := N - 1;
END LOOP;
IF N < M THEN
N := M + (MAX_LEN-I) - 1;
END IF;
END IF;
ELSE N := MSG'LAST;
END IF;
SET_COL (STANDARD_OUTPUT, TEXT_IO.COUNT (I+1));
PUT_LINE (STANDARD_OUTPUT, MSG (M..N));
I := INDENT;
M := N + 1;
WHILE M <= MSG'LAST AND THEN MSG (M) = ' ' LOOP
M := M + 1;
END LOOP;
EXIT WHEN M > MSG'LAST;
END LOOP;
END PUT_MSG;
FUNCTION TIME_STAMP RETURN STRING IS
TIME_NOW : CALENDAR.TIME;
YEAR,
MONTH,
DAY,
HOUR,
MINUTE,
SECOND : TIME_INTEGER := 1;
FUNCTION CONVERT (NUMBER : TIME_INTEGER) RETURN STRING IS
STR : STRING (1..2) := (OTHERS => '0');
DEC_DIGIT : CONSTANT STRING := "0123456789";
NUM : TIME_INTEGER := NUMBER;
BEGIN
IF NUM = 0 THEN
RETURN STR;
ELSE
NUM := NUM MOD 100;
STR (2) := DEC_DIGIT (INTEGER (NUM MOD 10 + 1));
NUM := NUM / 10;
STR (1) := DEC_DIGIT (INTEGER (NUM + 1));
RETURN STR;
END IF;
END CONVERT;
BEGIN
TIME_NOW := CALENDAR.CLOCK;
SPLIT (TIME_NOW, YEAR_NUMBER (YEAR), MONTH_NUMBER (MONTH),
DAY_NUMBER (DAY), DAY_DURATION (SECOND));
HOUR := SECOND / 3600;
SECOND := SECOND MOD 3600;
MINUTE := SECOND / 60;
SECOND := SECOND MOD 60;
RETURN (CONVERT (TIME_INTEGER (YEAR)) & "-" &
CONVERT (TIME_INTEGER (MONTH)) & "-" &
CONVERT (TIME_INTEGER (DAY)) & " " &
CONVERT (TIME_INTEGER (HOUR)) & ":" &
CONVERT (TIME_INTEGER (MINUTE)) & ":" &
CONVERT (TIME_INTEGER (SECOND)));
END TIME_STAMP;
PROCEDURE TEST (NAME : STRING; DESCR : STRING) IS
BEGIN
TEST_STATUS := PASS;
IF NAME'LENGTH <= MAX_NAME_LEN THEN
TEST_NAME_LEN := NAME'LENGTH;
ELSE TEST_NAME_LEN := MAX_NAME_LEN;
END IF;
TEST_NAME (1..TEST_NAME_LEN) :=
NAME (NAME'FIRST .. NAME'FIRST+TEST_NAME_LEN-1);
PUT_MSG ("");
PUT_MSG (",.,. " & TEST_NAME (1..TEST_NAME_LEN) & " " &
"ACATS " & ACATS_VERSION & " " & TIME_STAMP);
PUT_MSG ("---- " & TEST_NAME (1..TEST_NAME_LEN) & " " &
DESCR & ".");
END TEST;
PROCEDURE COMMENT (DESCR : STRING) IS
BEGIN
PUT_MSG (" - " & TEST_NAME (1..TEST_NAME_LEN) & " " &
DESCR & ".");
END COMMENT;
PROCEDURE FAILED (DESCR : STRING) IS
BEGIN
TEST_STATUS := FAIL;
PUT_MSG (" * " & TEST_NAME (1..TEST_NAME_LEN) & " " &
DESCR & ".");
END FAILED;
PROCEDURE NOT_APPLICABLE (DESCR : STRING) IS
BEGIN
IF TEST_STATUS = PASS OR TEST_STATUS = ACTION_REQUIRED THEN
TEST_STATUS := DOES_NOT_APPLY;
END IF;
PUT_MSG (" + " & TEST_NAME (1..TEST_NAME_LEN) & " " &
DESCR & ".");
END NOT_APPLICABLE;
PROCEDURE SPECIAL_ACTION (DESCR : STRING) IS
BEGIN
IF TEST_STATUS = PASS THEN
TEST_STATUS := ACTION_REQUIRED;
END IF;
PUT_MSG (" ! " & TEST_NAME (1..TEST_NAME_LEN) & " " &
DESCR & ".");
END SPECIAL_ACTION;
PROCEDURE RESULT IS
BEGIN
CASE TEST_STATUS IS
WHEN PASS =>
PUT_MSG ("==== " & TEST_NAME (1..TEST_NAME_LEN) &
" PASSED ============================.");
WHEN DOES_NOT_APPLY =>
PUT_MSG ("++++ " & TEST_NAME (1..TEST_NAME_LEN) &
" NOT-APPLICABLE ++++++++++++++++++++.");
WHEN ACTION_REQUIRED =>
PUT_MSG ("!!!! " & TEST_NAME (1..TEST_NAME_LEN) &
" TENTATIVELY PASSED !!!!!!!!!!!!!!!!.");
PUT_MSG ("!!!! " & (1..TEST_NAME_LEN => ' ') &
" SEE '!' COMMENTS FOR SPECIAL NOTES!!");
WHEN OTHERS =>
PUT_MSG ("**** " & TEST_NAME (1..TEST_NAME_LEN) &
" FAILED ****************************.");
END CASE;
TEST_STATUS := FAIL;
TEST_NAME_LEN := NO_NAME'LENGTH;
TEST_NAME (1..TEST_NAME_LEN) := NO_NAME;
END RESULT;
FUNCTION IDENT_INT (X : INTEGER) RETURN INTEGER IS
BEGIN
IF EQUAL (X, X) THEN -- ALWAYS EQUAL.
RETURN X; -- ALWAYS EXECUTED.
END IF;
RETURN 0; -- NEVER EXECUTED.
END IDENT_INT;
FUNCTION IDENT_CHAR (X : CHARACTER) RETURN CHARACTER IS
BEGIN
IF EQUAL (CHARACTER'POS(X), CHARACTER'POS(X)) THEN -- ALWAYS
-- EQUAL.
RETURN X; -- ALWAYS EXECUTED.
END IF;
RETURN '0'; -- NEVER EXECUTED.
END IDENT_CHAR;
FUNCTION IDENT_WIDE_CHAR (X : WIDE_CHARACTER) RETURN WIDE_CHARACTER IS
BEGIN
IF EQUAL (WIDE_CHARACTER'POS(X), WIDE_CHARACTER'POS(X)) THEN
-- ALWAYS EQUAL.
RETURN X; -- ALWAYS EXECUTED.
END IF;
RETURN '0'; -- NEVER EXECUTED.
END IDENT_WIDE_CHAR;
FUNCTION IDENT_BOOL (X : BOOLEAN) RETURN BOOLEAN IS
BEGIN
IF EQUAL (BOOLEAN'POS(X), BOOLEAN'POS(X)) THEN -- ALWAYS
-- EQUAL.
RETURN X; -- ALWAYS EXECUTED.
END IF;
RETURN FALSE; -- NEVER EXECUTED.
END IDENT_BOOL;
FUNCTION IDENT_STR (X : STRING) RETURN STRING IS
BEGIN
IF EQUAL (X'LENGTH, X'LENGTH) THEN -- ALWAYS EQUAL.
RETURN X; -- ALWAYS EXECUTED.
END IF;
RETURN ""; -- NEVER EXECUTED.
END IDENT_STR;
FUNCTION IDENT_WIDE_STR (X : WIDE_STRING) RETURN WIDE_STRING IS
BEGIN
IF EQUAL (X'LENGTH, X'LENGTH) THEN -- ALWAYS EQUAL.
RETURN X; -- ALWAYS EXECUTED.
END IF;
RETURN ""; -- NEVER EXECUTED.
END IDENT_WIDE_STR;
FUNCTION EQUAL (X, Y : INTEGER) RETURN BOOLEAN IS
REC_LIMIT : CONSTANT INTEGER RANGE 1..100 := 3; -- RECURSION
-- LIMIT.
Z : BOOLEAN; -- RESULT.
BEGIN
IF X < 0 THEN
IF Y < 0 THEN
Z := EQUAL (-X, -Y);
ELSE Z := FALSE;
END IF;
ELSIF X > REC_LIMIT THEN
Z := EQUAL (REC_LIMIT, Y-X+REC_LIMIT);
ELSIF X > 0 THEN
Z := EQUAL (X-1, Y-1);
ELSE Z := Y = 0;
END IF;
RETURN Z;
EXCEPTION
WHEN OTHERS =>
RETURN X = Y;
END EQUAL;
FUNCTION LEGAL_FILE_NAME (X : FILE_NUM := 1;
NAM : STRING := "")
RETURN STRING IS
SUFFIX : STRING (2..6);
BEGIN
IF NAM = "" THEN
SUFFIX := TEST_NAME(3..7);
ELSE
SUFFIX := NAM(3..7);
END IF;
CASE X IS
WHEN 1 => RETURN ('X' & SUFFIX);
WHEN 2 => RETURN ('Y' & SUFFIX);
WHEN 3 => RETURN ('Z' & SUFFIX);
WHEN 4 => RETURN ('V' & SUFFIX);
WHEN 5 => RETURN ('W' & SUFFIX);
END CASE;
END LEGAL_FILE_NAME;
BEGIN
TEST_NAME_LEN := NO_NAME'LENGTH;
TEST_NAME (1..TEST_NAME_LEN) := NO_NAME;
END REPORT;
|