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 controlled objects declared immediately within a library
28 -- package are finalized following the completion of the environment
29 -- task (and prior to termination of the program).
32 -- This test derives a type from Ada.Finalization.Controlled, and
33 -- declares an object of that type in the body of a library package.
34 -- The dispatching procedure Finalize is redefined for the derived
35 -- type to perform a check that it has been called only once, and in
36 -- turn calls Report.Result. This test may fail by not calling
37 -- Report.Result. This test may also fail by calling Report.Result
38 -- twice, the first call will report a false pass.
42 -- 06 Dec 94 SAIC ACVC 2.0
43 -- 13 Nov 95 SAIC Updated for ACVC 2.0.1
47 with Ada
.Finalization
;
50 type Global
is new Ada
.Finalization
.Controlled
with null record;
51 procedure Finalize
( It
: in out Global
);
65 package body C761001_0
is
69 Done
: Boolean := False;
71 procedure Finalize
( It
: in out Global
) is
73 if not C761001_1
.Library_Task
'Terminated then
74 Report
.Failed
("Library task not terminated before finalize");
76 if Done
then -- checking included "just in case"
77 Report
.Comment
("Test FAILED, even if previously reporting passed");
78 Report
.Failed
("Unwarranted multiple call to finalize");
87 package body C761001_1
is
89 task body Library_Task
is
91 if Report
.Ident_Int
( 1 ) /= 1 then
92 Report
.Failed
( "Baseline failure in Library_Task");
103 begin -- Main test procedure.
105 Report
.Test
("C761001", "Check that controlled objects declared "
106 & "immediately within a library package are "
107 & "finalized following the completion of the "
108 & "environment task (and prior to termination "
109 & "of the program)");
111 -- note that if the test DOES call report twice, the first will report a
112 -- false pass, the second call will correctly fail the test.
114 -- not calling Report.Result;
115 -- Result is called as part of the finalization of C761001_0.My_Object.