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 formal parameters of a class-wide type can be passed
28 -- values of any specific type within the class.
31 -- Define an object of a root tagged type and of various types derived
32 -- from the root. Define objects of the root class, and initialize them
33 -- by parameter association of objects of the specific types (root and
34 -- extended types) within the class.
36 -- The particular root and extended types used in this abstraction are
37 -- defined in foundation code (F341A00.A), and are graphically displayed
50 -- package Interest_Checking
55 -- This test depends on the following foundation code:
59 -- The following files comprise this test:
65 -- 06 Dec 94 SAIC ACVC 2.0
69 with F341A00_0
; -- package Bank
70 with F341A00_1
; -- package Checking
71 with F341A00_2
; -- package Interest_Checking
76 package Bank
renames F341A00_0
;
77 use type Bank
.Dollar_Amount
;
78 package Checking
renames F341A00_1
;
79 package Interest_Checking
renames F341A00_2
;
81 Max_Accts
: constant := 3;
82 Bank_Balance
: Bank
.Dollar_Amount
:= 0.00;
84 -- Initialize objects of specific tagged types.
85 B_Acct
: Bank
.Account
:= (Current_Balance
=> 10.00);
86 C_Acct
: Checking
.Account
:= (100.00, 10.00);
87 IC_Acct
: Interest_Checking
.Account
:= (1000.00, 10.00, 0.030);
89 -- Define and initialize (by parameter association) objects of class-wide
90 -- type originating from the root type (Bank.Account).
92 -- Define an account auditing procedure with a class-wide
93 -- variable that can hold a value of any object within the class.
94 procedure Audit
(Next_Account
: Bank
.Account
'Class) is
96 Bank_Balance
:= Bank_Balance
+ Next_Account
.Current_Balance
;
102 Report
.Test
("C341A01", "Check that objects of a class-wide type can " &
103 "be initialized, by direct assignment, to a " &
104 "value of any specific type within the class" );
106 -- Perform nightly audit of total funds on deposit in bank.
111 if Bank_Balance
/= 1110.00 then
112 Report
.Failed
("Class-wide object processing failed");