1-- C45272A.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 EQUALITY AND INEQUALITY ARE EVALUATED CORRECTLY FOR
26-- RECORDS WHOSE COMPONENTS HAVE CHANGEABLE DISCRIMINANTS, INCLUDING
27-- RECORDS DESIGNATED BY ACCESS VALUES.
28
29-- TBN  8/7/86
30
31WITH REPORT; USE REPORT;
32PROCEDURE C45272A IS
33
34     SUBTYPE INT IS INTEGER RANGE 0 .. 20;
35     TYPE VARSTR (LEN : INT := 0) IS
36          RECORD
37               VAL : STRING (1..LEN);
38          END RECORD;
39     TYPE VARREC IS
40          RECORD
41               A, B : VARSTR;
42          END RECORD;
43
44     TYPE CELL2;
45     TYPE LINK IS ACCESS CELL2;
46     TYPE CELL1 (NAM_LEN : INT := 0) IS
47          RECORD
48               NAME : STRING (1..NAM_LEN);
49          END RECORD;
50     TYPE CELL2 IS
51          RECORD
52               ONE : CELL1;
53               TWO : CELL1;
54               NEW_LINK : LINK;
55          END RECORD;
56
57     X, Y : VARREC;
58     FRONT : LINK := NEW CELL2'((5, "XXYZZ"), (5, "YYYZZ"), NULL);
59     BACK : LINK := NEW CELL2'((5, "XXYZZ"), (5, "YYYZZ"), NULL);
60
61BEGIN
62     TEST ("C45272A", "CHECK THAT EQUALITY AND INEQUALITY ARE " &
63                      "EVALUATED CORRECTLY FOR RECORDS WHOSE " &
64                      "COMPONENTS HAVE CHANGEABLE DISCRIMINANTS");
65
66     X := ((5, "AAAXX"), (5, "BBBYY"));
67     Y := ((5, "AAAZZ"), (5, "BBBYY"));
68     IF X = Y THEN
69          FAILED ("INCORRECT RESULTS FOR RECORDS - 1");
70     END IF;
71
72     X.A := (3, "HHH");
73     Y.A := (IDENT_INT(3), IDENT_STR("HHH"));
74     IF X /= Y THEN
75          FAILED ("INCORRECT RESULTS FOR RECORDS - 2");
76     END IF;
77
78     IF FRONT.ALL /= BACK.ALL THEN
79          FAILED ("INCORRECT RESULTS FOR RECORDS - 3");
80     END IF;
81
82     BACK.NEW_LINK := FRONT;
83     IF FRONT.ALL = BACK.ALL THEN
84          FAILED ("INCORRECT RESULTS FOR RECORDS - 4");
85     END IF;
86
87     FRONT.NEW_LINK := FRONT;
88     IF FRONT.ALL /= BACK.ALL THEN
89          FAILED ("INCORRECT RESULTS FOR RECORDS - 5");
90     END IF;
91
92     FRONT.ONE := (5, "XXXXX");
93     BACK.ONE := (5, "ZZZZZ");
94     IF FRONT.ALL = BACK.ALL THEN
95          FAILED ("INCORRECT RESULTS FOR RECORDS - 6");
96     END IF;
97
98     FRONT.ONE := (3, "XXX");
99     BACK.ONE := (3, "XXX");
100     IF FRONT.ALL /= BACK.ALL THEN
101          FAILED ("INCORRECT RESULTS FOR RECORDS - 7");
102     END IF;
103
104     RESULT;
105END C45272A;
106