3 -- Grant of Unlimited Rights
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
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.
27 -- Check that an extended type can be derived in the specification of a
28 -- generic package when the parent is an abstract type in a library
32 -- Extend an abstract type in the visible part of a generic package.
33 -- Make all of the procedures which override abstract procedures
34 -- available as part of the generic interface. Instantiate the generic.
37 -- This test depends on the following foundation code:
39 -- F393B00.A Package Alert_Foundation
43 -- 06 Dec 94 SAIC ACVC 2.0
44 -- 14 Oct 95 SAIC Update and repair for ACVC 2.0.1
45 -- 27 Feb 97 PWB.CTA Add pragma Elaborate for C393B12_0.
48 ----------------------------------------------------------------- C393B12_0
53 type Generic_Status_Enum
is (<>);
58 type Generic_Alert_Type
is new F393B00
.Alert
with record
59 Status
: Generic_Status_Enum
:= Generic_Status_Enum
'First;
61 -- extension of an abstract type
63 procedure Handle
(GA
: in out Generic_Alert_Type
);
64 -- override of abstract procedure
66 function Query_Status
(GA
: Generic_Alert_Type
)
67 return Generic_Status_Enum
; -- new primitive operation for
72 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
74 package body C393B12_0
is
77 procedure Handle
(GA
: in out Generic_Alert_Type
) is
79 GA
.Status
:= Generic_Status_Enum
'Last;
82 function Query_Status
(GA
: Generic_Alert_Type
)
83 return Generic_Status_Enum
is
90 ----------------------------------------------------------------- C393B12_1
93 type Status
is (Low
, Medium
, High
);
96 ------------------------------------------------------- C393B12_1.C393B12_2
99 pragma Elaborate
(C393B12_0
);
100 package C393B12_1
.C393B12_2
is new C393B12_0
102 (Generic_Status_Enum
=> Status
);
104 ------------------------------------------------------------------- C393B12
106 with C393B12_1
.C393B12_2
;
110 use type C393B12_1
.Status
;
112 package Alt_Alert
renames C393B12_1
.C393B12_2
;
114 GA
: Alt_Alert
.Generic_Alert_Type
;
117 Report
.Test
("C393B12", "Check that an extended type can be derived " &
118 "from an abstract type");
120 if Alt_Alert
.Query_Status
(GA
) /= C393B12_1
.Low
then
121 Report
.Failed
("Wrong initialization");
124 Alt_Alert
.Handle
(GA
);
125 if Alt_Alert
.Query_Status
(GA
) /= C393B12_1
.High
then
126 Report
.Failed
("Wrong results from Handle");