1 |
12 |
jlechner |
-- C41320A.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 |
|
|
-- OBJECTIVE:
|
26 |
|
|
-- CHECK THAT IMPLICITLY DECLARED ENUMERATION LITERALS, CHARACTER
|
27 |
|
|
-- LITERALS, AND THE RELATIONAL OPERATORS CAN BE SELECTED FROM
|
28 |
|
|
-- OUTSIDE THE PACKAGE USING AN EXPANDED NAME, FOR ENUMERATION TYPES.
|
29 |
|
|
|
30 |
|
|
-- HISTORY:
|
31 |
|
|
-- TBN 07/15/86 CREATED ORIGINAL TEST.
|
32 |
|
|
-- JET 08/04/87 ADDED TEST FOR OVERLOADED VARIABLES.
|
33 |
|
|
|
34 |
|
|
WITH REPORT; USE REPORT;
|
35 |
|
|
PROCEDURE C41320A IS
|
36 |
|
|
|
37 |
|
|
PACKAGE P IS
|
38 |
|
|
TYPE FLAG IS (RED, WHITE, BLUE);
|
39 |
|
|
TYPE ROMAN_DIGITS IS ('I', 'V', 'X', 'C', 'M');
|
40 |
|
|
TYPE TRAFFIC_LIGHT IS (RED, YELLOW, GREEN);
|
41 |
|
|
TYPE HEX IS ('A', 'B', 'C', 'D', 'E', 'F');
|
42 |
|
|
FLAG_COLOR_1 : FLAG := RED;
|
43 |
|
|
FLAG_COLOR_2 : FLAG := WHITE;
|
44 |
|
|
TRAFFIC_LIGHT_COLOR_1 : FLAG := RED;
|
45 |
|
|
HEX_3 : HEX := 'C';
|
46 |
|
|
ROMAN_1 : ROMAN_DIGITS := 'I';
|
47 |
|
|
END P;
|
48 |
|
|
|
49 |
|
|
USA_FLAG_1 : P.FLAG := P.RED;
|
50 |
|
|
USA_FLAG_3 : P.FLAG := P.BLUE;
|
51 |
|
|
HEX_CHAR_3 : P.HEX := P.'C';
|
52 |
|
|
ROMAN_DIGITS_4 : P.ROMAN_DIGITS := P.'C';
|
53 |
|
|
TRAFFIC_LIGHT_1 : P.TRAFFIC_LIGHT := P.RED;
|
54 |
|
|
|
55 |
|
|
BEGIN
|
56 |
|
|
TEST ("C41320A", "CHECK THAT IMPLICITLY DECLARED ENUMERATION " &
|
57 |
|
|
"LITERALS, CHARACTER LITERALS, AND THE " &
|
58 |
|
|
"RELATIONAL OPERATORS CAN BE SELECTED FROM " &
|
59 |
|
|
"OUTSIDE THE PACKAGE USING AN EXPANDED NAME " &
|
60 |
|
|
"FOR ENUMERATION TYPES");
|
61 |
|
|
|
62 |
|
|
IF P."/=" (USA_FLAG_1, P.FLAG_COLOR_1) THEN
|
63 |
|
|
FAILED ("INCORRECT RESULTS FROM EXPANDED NAME - 1");
|
64 |
|
|
END IF;
|
65 |
|
|
|
66 |
|
|
IF P."=" (USA_FLAG_3, P.FLAG_COLOR_2) THEN
|
67 |
|
|
FAILED ("INCORRECT RESULTS FROM EXPANDED NAME - 2");
|
68 |
|
|
END IF;
|
69 |
|
|
|
70 |
|
|
IF P."<" (HEX_CHAR_3, P.HEX_3) THEN
|
71 |
|
|
FAILED ("INCORRECT RESULTS FROM EXPANDED NAME - 3");
|
72 |
|
|
END IF;
|
73 |
|
|
|
74 |
|
|
IF P.">" (P.ROMAN_1, ROMAN_DIGITS_4) THEN
|
75 |
|
|
FAILED ("INCORRECT RESULTS FROM EXPANDED NAME - 4");
|
76 |
|
|
END IF;
|
77 |
|
|
|
78 |
|
|
IF P.">=" (TRAFFIC_LIGHT_1, P.TRAFFIC_LIGHT'PRED (P.GREEN)) THEN
|
79 |
|
|
FAILED ("INCORRECT RESULTS FROM EXPANDED NAME - 5");
|
80 |
|
|
END IF;
|
81 |
|
|
|
82 |
|
|
FOR J IN P.FLAG'(P.WHITE) .. P.FLAG'(P.WHITE) LOOP
|
83 |
|
|
IF P."<=" (P.FLAG'SUCC (P.WHITE), J) THEN
|
84 |
|
|
FAILED ("INCORRECT RESULTS FROM EXPANDED NAME - 6");
|
85 |
|
|
END IF;
|
86 |
|
|
END LOOP;
|
87 |
|
|
|
88 |
|
|
IF P.">=" (P.RED, P.GREEN) THEN
|
89 |
|
|
FAILED ("INCORRECT RESULT FROM OVERLOADED VARIABLE NAME - 1");
|
90 |
|
|
END IF;
|
91 |
|
|
|
92 |
|
|
IF P."<=" (P.BLUE, P.RED) THEN
|
93 |
|
|
FAILED ("INCORRECT RESULT FROM OVERLOADED VARIABLE NAME - 2");
|
94 |
|
|
END IF;
|
95 |
|
|
|
96 |
|
|
RESULT;
|
97 |
|
|
END C41320A;
|