1 |
294 |
jeremybenn |
-- CD1C03I.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 THE RECORD SIZE AND THE COMPONENT POSITIONS AND
|
27 |
|
|
-- SIZES OF A DERIVED RECORD TYPE ARE INHERITED FROM THE
|
28 |
|
|
-- PARENT IF THOSE ASPECTS OF THE PARENT WERE DETERMINED BY THE
|
29 |
|
|
-- PRAGMA PACK.
|
30 |
|
|
|
31 |
|
|
-- HISTORY:
|
32 |
|
|
-- JET 09/17/87 CREATED ORIGINAL TEST.
|
33 |
|
|
|
34 |
|
|
WITH REPORT; USE REPORT;
|
35 |
|
|
|
36 |
|
|
PROCEDURE CD1C03I IS
|
37 |
|
|
|
38 |
|
|
TYPE E_TYPE IS (RED, BLUE, GREEN);
|
39 |
|
|
|
40 |
|
|
TYPE PARENT_TYPE IS
|
41 |
|
|
RECORD
|
42 |
|
|
B1: BOOLEAN := TRUE;
|
43 |
|
|
I : INTEGER RANGE 0 .. 127 := 127;
|
44 |
|
|
C : CHARACTER := 'S';
|
45 |
|
|
B2: BOOLEAN := FALSE;
|
46 |
|
|
E : E_TYPE := BLUE;
|
47 |
|
|
END RECORD;
|
48 |
|
|
|
49 |
|
|
PRAGMA PACK (PARENT_TYPE);
|
50 |
|
|
|
51 |
|
|
TYPE DERIVED_TYPE IS NEW PARENT_TYPE;
|
52 |
|
|
|
53 |
|
|
P_REC : PARENT_TYPE;
|
54 |
|
|
REC : DERIVED_TYPE;
|
55 |
|
|
|
56 |
|
|
BEGIN
|
57 |
|
|
|
58 |
|
|
TEST("CD1C03I", "CHECK THAT THE RECORD SIZE AND THE COMPONENT " &
|
59 |
|
|
"POSITIONS AND SIZES OF A DERIVED RECORD " &
|
60 |
|
|
"TYPE ARE INHERITED FROM THE PARENT IF THOSE " &
|
61 |
|
|
"ASPECTS OF THE PARENT WERE DETERMINED BY " &
|
62 |
|
|
"THE PRAGMA PACK");
|
63 |
|
|
|
64 |
|
|
IF DERIVED_TYPE'SIZE /= PARENT_TYPE'SIZE THEN
|
65 |
|
|
FAILED ("DERIVED_TYPE'SIZE WAS NOT INHERITED FROM " &
|
66 |
|
|
"PARENT_TYPE");
|
67 |
|
|
END IF;
|
68 |
|
|
|
69 |
|
|
IF REC.I'SIZE /= P_REC.I'SIZE OR
|
70 |
|
|
REC.C'SIZE /= P_REC.C'SIZE OR
|
71 |
|
|
REC.B1'SIZE /= P_REC.B1'SIZE OR
|
72 |
|
|
REC.B2'SIZE /= P_REC.B2'SIZE OR
|
73 |
|
|
REC.E'SIZE /= P_REC.E'SIZE THEN
|
74 |
|
|
FAILED ("THE SIZES OF DERIVED_TYPE ELEMENTS WERE NOT " &
|
75 |
|
|
"INHERITED FROM PARENT_TYPE");
|
76 |
|
|
END IF;
|
77 |
|
|
|
78 |
|
|
REC := (FALSE, 12, 'T', TRUE, RED);
|
79 |
|
|
|
80 |
|
|
IF (REC.I /= 12) OR (REC.C /= 'T') OR
|
81 |
|
|
REC.B1 OR (NOT REC.B2) OR (REC.E /= RED) THEN
|
82 |
|
|
FAILED ("THE VALUES OF DERIVED_TYPE COMPONENTS WERE " &
|
83 |
|
|
"INCORRECT");
|
84 |
|
|
END IF;
|
85 |
|
|
|
86 |
|
|
IF REC.I'POSITION /= P_REC.I'POSITION OR
|
87 |
|
|
REC.C'POSITION /= P_REC.C'POSITION OR
|
88 |
|
|
REC.B1'POSITION /= P_REC.B1'POSITION OR
|
89 |
|
|
REC.B2'POSITION /= P_REC.B2'POSITION OR
|
90 |
|
|
REC.E'POSITION /= P_REC.E'POSITION THEN
|
91 |
|
|
FAILED ("THE POSITIONS OF DERIVED_TYPE COMPONENTS WERE " &
|
92 |
|
|
"NOT INHERITED FROM PARENT_TYPE");
|
93 |
|
|
END IF;
|
94 |
|
|
|
95 |
|
|
IF REC.I'FIRST_BIT /= P_REC.I'FIRST_BIT OR
|
96 |
|
|
REC.C'FIRST_BIT /= P_REC.C'FIRST_BIT OR
|
97 |
|
|
REC.B1'FIRST_BIT /= P_REC.B1'FIRST_BIT OR
|
98 |
|
|
REC.B2'FIRST_BIT /= P_REC.B2'FIRST_BIT OR
|
99 |
|
|
REC.E'FIRST_BIT /= P_REC.E'FIRST_BIT THEN
|
100 |
|
|
FAILED ("THE FIRST_BITS OF DERIVED_TYPE COMPONENTS WERE " &
|
101 |
|
|
"NOT INHERITED FROM PARENT_TYPE");
|
102 |
|
|
END IF;
|
103 |
|
|
|
104 |
|
|
IF REC.I'LAST_BIT /= P_REC.I'LAST_BIT OR
|
105 |
|
|
REC.C'LAST_BIT /= P_REC.C'LAST_BIT OR
|
106 |
|
|
REC.B1'LAST_BIT /= P_REC.B1'LAST_BIT OR
|
107 |
|
|
REC.B2'LAST_BIT /= P_REC.B2'LAST_BIT OR
|
108 |
|
|
REC.E'LAST_BIT /= P_REC.E'LAST_BIT THEN
|
109 |
|
|
FAILED ("THE LAST_BITS OF DERIVED_TYPE COMPONENTS WERE " &
|
110 |
|
|
"NOT INHERITED FROM PARENT_TYPE");
|
111 |
|
|
END IF;
|
112 |
|
|
|
113 |
|
|
RESULT;
|
114 |
|
|
|
115 |
|
|
END CD1C03I;
|