OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc2/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [c3/] [c390a031.am] - Blame information for rev 384

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- C390A031.AM
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
--
26
-- OBJECTIVE:
27
--      Check that a nonprivate tagged type declared in a package specification
28
--      may be extended with a private extension in a different package
29
--      specification, and that this private extension may in turn be extended
30
--      by a private extension.
31
--
32
--      Check that each derivative inherits the user-defined primitive
33
--      subprograms of its parent (including those that its parent inherited),
34
--      that it may override these inherited primitive subprograms, and that it
35
--      may also declare its own primitive subprograms.
36
--
37
--      Check that predefined equality operators are defined for the tagged
38
--      type and its derivatives.
39
--
40
--      Check that type conversion is defined from a type extension to its
41
--      parent, and that this parent itself may be a type extension.
42
--
43
-- TEST DESCRIPTION:
44
--      Declare a root tagged type and two associated primitive subprograms
45
--      in a package specification (foundation code).
46
--
47
--      Extend the root type with a private extension in a different package
48
--      specification. Declare a new primitive subprogram for the extension,
49
--      and override one of the two inherited subprograms. Within the
50
--      overriding subprogram, utilize type conversion to call the parent's
51
--      implementation of the same subprogram. Also within the overriding
52
--      subprogram, call the new primitive subprogram and each inherited
53
--      subprogram. Declare operations of the private extension which utilize
54
--      aggregates and equality operators to verify the correctness of the
55
--      components.
56
--
57
--      Extend the extension with a private extension in the same package
58
--      specification. Declare a new primitive subprogram for this second
59
--      extension, and override one of the three inherited subprograms.
60
--      Within the overriding subprogram, utilize type conversion to call the
61
--      parent's implementation of the same subprogram. Also within the
62
--      overriding subprogram, call the new primitive subprogram and each
63
--      inherited subprogram. Declare operations of the private extension
64
--      which override the verification operations of its parent. Within
65
--      these overriding operations, utilize type conversion to call the
66
--      parent's implementations of the same operations.
67
--
68
--      In the main program, declare objects of the two extended types.
69
--      For each object, call the overriding subprogram, and verify the
70
--      correctness of the components by calling the verification operations
71
--      declared in the second package.
72
--
73
-- TEST FILES:
74
--      This test consists of the following files:
75
--
76
--         F390A00.A
77
--         C390A030.A
78
--      => C390A031.AM
79
--
80
--
81
-- CHANGE HISTORY:
82
--      06 Dec 94   SAIC    ACVC 2.0
83
--      04 Jun 96   SAIC    ACVC 2.1: Modified prologue.
84
--
85
--!
86
 
87
with Report;
88
 
89
with F390A00;  -- Basic alert abstraction.
90
with C390A030; -- Extended alert abstraction.
91
 
92
use  F390A00;  -- Primitive operations of Alert_Type directly visible.
93
 
94
procedure C390A031 is
95
begin
96
 
97
   Report.Test ("C390A03", "Primitive operation inheritance by type " &
98
                "extensions: all extensions are private and declared " &
99
                "in same package, but a different package from that " &
100
                "of root type");
101
 
102
 
103
   -- The case for type F390A00.Alert_Type is tested in C390A01.
104
   -- That subtest is not repeated here.
105
 
106
 
107
   LOW_ALERT_SUBTEST: ---------------------------------------------------------
108
 
109
      declare
110
         Low_Alarm : C390A030.Low_Alert_Type;  -- Priv. ext. of tagged type.
111
         use C390A030; -- Primitive operations of extension directly visible.
112
      begin
113
         if not C390A030.Initial_Values_Okay (Low_Alarm) then
114
            Report.Failed ("Wrong initial values for Low_Alert_Type");
115
         end if;
116
 
117
         Handle (Low_Alarm);
118
 
119
         if C390A030.Bad_Final_Values (Low_Alarm) then
120
            Report.Failed ("Wrong values for Low_Alert_Type after Handle");
121
         end if;
122
      end Low_Alert_Subtest;
123
 
124
 
125
   -- Check intermediate display counts:
126
 
127
   if F390A00.Display_Count_For /= (Null_Device => 1,
128
                                    Teletype    => 1,
129
                                    Console     => 0,
130
                                    Big_Screen  => 0)
131
   then
132
      Report.Failed ("Wrong display counts after Low_Alert");
133
   end if;
134
 
135
 
136
   MEDIUM_ALERT_SUBTEST: ------------------------------------------------------
137
 
138
      declare
139
         Medium_Alarm : C390A030.Medium_Alert_Type; -- Priv. ext. of extension.
140
         use C390A030; -- Primitive operations of extension directly visible.
141
      begin
142
         if not C390A030.Initial_Values_Okay (Medium_Alarm) then
143
            Report.Failed ("Wrong initial values for Medium_Alert_Type");
144
         end if;
145
 
146
         Handle (Medium_Alarm);
147
 
148
         if C390A030.Bad_Final_Values (Medium_Alarm) then
149
            Report.Failed ("Wrong values for Medium_Alert_Type after Handle");
150
         end if;
151
      end Medium_Alert_Subtest;
152
 
153
 
154
   -- Check final display counts:
155
 
156
   if F390A00.Display_Count_For /= (Null_Device => 2,
157
                                    Teletype    => 2,
158
                                    Console     => 1,
159
                                    Big_Screen  => 0)
160
   then
161
      Report.Failed ("Wrong display counts after Medium_Alert_Type");
162
   end if;
163
 
164
 
165
   Report.Result;
166
 
167
end C390A031;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.