annotate gcc/testsuite/ada/acats/tests/c3/c3900050.a @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 -- C3900050.A
kono
parents:
diff changeset
2 --
kono
parents:
diff changeset
3 -- Grant of Unlimited Rights
kono
parents:
diff changeset
4 --
kono
parents:
diff changeset
5 -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
kono
parents:
diff changeset
6 -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
kono
parents:
diff changeset
7 -- unlimited rights in the software and documentation contained herein.
kono
parents:
diff changeset
8 -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
kono
parents:
diff changeset
9 -- this public release, the Government intends to confer upon all
kono
parents:
diff changeset
10 -- recipients unlimited rights equal to those held by the Government.
kono
parents:
diff changeset
11 -- These rights include rights to use, duplicate, release or disclose the
kono
parents:
diff changeset
12 -- released technical data and computer software in whole or in part, in
kono
parents:
diff changeset
13 -- any manner and for any purpose whatsoever, and to have or permit others
kono
parents:
diff changeset
14 -- to do so.
kono
parents:
diff changeset
15 --
kono
parents:
diff changeset
16 -- DISCLAIMER
kono
parents:
diff changeset
17 --
kono
parents:
diff changeset
18 -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
kono
parents:
diff changeset
19 -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
kono
parents:
diff changeset
20 -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
kono
parents:
diff changeset
21 -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
kono
parents:
diff changeset
22 -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
kono
parents:
diff changeset
23 -- PARTICULAR PURPOSE OF SAID MATERIAL.
kono
parents:
diff changeset
24 --*
kono
parents:
diff changeset
25 --
kono
parents:
diff changeset
26 -- OBJECTIVE:
kono
parents:
diff changeset
27 -- See C3900053.AM.
kono
parents:
diff changeset
28 --
kono
parents:
diff changeset
29 -- TEST DESCRIPTION:
kono
parents:
diff changeset
30 -- See C3900053.AM.
kono
parents:
diff changeset
31 --
kono
parents:
diff changeset
32 -- TEST FILES:
kono
parents:
diff changeset
33 -- This test consists of the following files:
kono
parents:
diff changeset
34 --
kono
parents:
diff changeset
35 -- => C3900050.A
kono
parents:
diff changeset
36 -- C3900051.A
kono
parents:
diff changeset
37 -- C3900052.A
kono
parents:
diff changeset
38 -- C3900053.AM
kono
parents:
diff changeset
39 --
kono
parents:
diff changeset
40 -- CHANGE HISTORY:
kono
parents:
diff changeset
41 -- 06 Dec 94 SAIC ACVC 2.0
kono
parents:
diff changeset
42 -- 15 May 96 SAIC ACVC 2.1: Modified prologue. Added pragma Elaborate
kono
parents:
diff changeset
43 -- for Ada.Calendar.
kono
parents:
diff changeset
44 --
kono
parents:
diff changeset
45 --!
kono
parents:
diff changeset
46
kono
parents:
diff changeset
47 with Ada.Calendar;
kono
parents:
diff changeset
48 pragma Elaborate (Ada.Calendar);
kono
parents:
diff changeset
49
kono
parents:
diff changeset
50 package C3900050 is -- Alert system abstraction.
kono
parents:
diff changeset
51
kono
parents:
diff changeset
52 -- Declarations used by component Arrival_Time.
kono
parents:
diff changeset
53
kono
parents:
diff changeset
54 Default_Time : constant Ada.Calendar.Time :=
kono
parents:
diff changeset
55 Ada.Calendar.Time_Of (1901, 1, 1);
kono
parents:
diff changeset
56 Alert_Time : constant Ada.Calendar.Time :=
kono
parents:
diff changeset
57 Ada.Calendar.Time_Of (1991, 6, 15);
kono
parents:
diff changeset
58
kono
parents:
diff changeset
59
kono
parents:
diff changeset
60 -- Declarations used by component Display_On and procedure Display.
kono
parents:
diff changeset
61
kono
parents:
diff changeset
62 type Device_Enum is (Null_Device, Teletype, Console, Big_Screen);
kono
parents:
diff changeset
63 type Display_Counters is array (Device_Enum) of Natural;
kono
parents:
diff changeset
64
kono
parents:
diff changeset
65 Display_Count_For : Display_Counters := (others => 0);
kono
parents:
diff changeset
66
kono
parents:
diff changeset
67
kono
parents:
diff changeset
68
kono
parents:
diff changeset
69 type Alert_Type is tagged private; -- Root tagged type.
kono
parents:
diff changeset
70
kono
parents:
diff changeset
71 procedure Set_Display (A : in out Alert_Type; -- To be inherited by
kono
parents:
diff changeset
72 D : in Device_Enum); -- all derivatives.
kono
parents:
diff changeset
73
kono
parents:
diff changeset
74 procedure Display (A : in Alert_Type); -- To be inherited by
kono
parents:
diff changeset
75 -- all derivatives.
kono
parents:
diff changeset
76
kono
parents:
diff changeset
77 procedure Handle (A : in out Alert_Type); -- To be overridden by
kono
parents:
diff changeset
78 -- all derivatives.
kono
parents:
diff changeset
79
kono
parents:
diff changeset
80
kono
parents:
diff changeset
81 -- The following functions are needed to verify the values of the
kono
parents:
diff changeset
82 -- root tagged type's private components.
kono
parents:
diff changeset
83
kono
parents:
diff changeset
84 function Get_Time (A: Alert_Type) return Ada.Calendar.Time;
kono
parents:
diff changeset
85
kono
parents:
diff changeset
86 function Get_Display (A: Alert_Type) return Device_Enum;
kono
parents:
diff changeset
87
kono
parents:
diff changeset
88 function Initial_Values_Okay (A : in Alert_Type)
kono
parents:
diff changeset
89 return Boolean;
kono
parents:
diff changeset
90
kono
parents:
diff changeset
91 function Bad_Final_Values (A : in Alert_Type)
kono
parents:
diff changeset
92 return Boolean;
kono
parents:
diff changeset
93
kono
parents:
diff changeset
94 private
kono
parents:
diff changeset
95
kono
parents:
diff changeset
96 type Alert_Type is tagged record -- Root tagged type.
kono
parents:
diff changeset
97 Arrival_Time : Ada.Calendar.Time := Default_Time;
kono
parents:
diff changeset
98 Display_On : Device_Enum := Null_Device;
kono
parents:
diff changeset
99 end record;
kono
parents:
diff changeset
100
kono
parents:
diff changeset
101
kono
parents:
diff changeset
102 end C3900050;
kono
parents:
diff changeset
103
kono
parents:
diff changeset
104
kono
parents:
diff changeset
105 --==================================================================--
kono
parents:
diff changeset
106
kono
parents:
diff changeset
107
kono
parents:
diff changeset
108 package body C3900050 is -- Alert system abstraction.
kono
parents:
diff changeset
109
kono
parents:
diff changeset
110
kono
parents:
diff changeset
111 procedure Set_Display (A : in out Alert_Type;
kono
parents:
diff changeset
112 D : in Device_Enum) is
kono
parents:
diff changeset
113 begin
kono
parents:
diff changeset
114 A.Display_On := D;
kono
parents:
diff changeset
115 end Set_Display;
kono
parents:
diff changeset
116
kono
parents:
diff changeset
117
kono
parents:
diff changeset
118 procedure Display (A : in Alert_Type) is
kono
parents:
diff changeset
119 begin
kono
parents:
diff changeset
120 Display_Count_For (A.Display_On) := Display_Count_For (A.Display_On) + 1;
kono
parents:
diff changeset
121 end Display;
kono
parents:
diff changeset
122
kono
parents:
diff changeset
123
kono
parents:
diff changeset
124 procedure Handle (A : in out Alert_Type) is
kono
parents:
diff changeset
125 begin
kono
parents:
diff changeset
126 A.Arrival_Time := Alert_Time;
kono
parents:
diff changeset
127 Display (A);
kono
parents:
diff changeset
128 end Handle;
kono
parents:
diff changeset
129
kono
parents:
diff changeset
130
kono
parents:
diff changeset
131 function Get_Time (A: Alert_Type) return Ada.Calendar.Time is
kono
parents:
diff changeset
132 begin
kono
parents:
diff changeset
133 return A.Arrival_Time;
kono
parents:
diff changeset
134 end Get_Time;
kono
parents:
diff changeset
135
kono
parents:
diff changeset
136
kono
parents:
diff changeset
137 function Get_Display (A: Alert_Type) return Device_Enum is
kono
parents:
diff changeset
138 begin
kono
parents:
diff changeset
139 return A.Display_On;
kono
parents:
diff changeset
140 end Get_Display;
kono
parents:
diff changeset
141
kono
parents:
diff changeset
142
kono
parents:
diff changeset
143 function Initial_Values_Okay (A : in Alert_Type) return Boolean is
kono
parents:
diff changeset
144 begin
kono
parents:
diff changeset
145 return (A = (Arrival_Time => Default_Time, -- Check "=" operator
kono
parents:
diff changeset
146 Display_On => Null_Device)); -- availability.
kono
parents:
diff changeset
147 end Initial_Values_Okay; -- Aggregate with
kono
parents:
diff changeset
148 -- named associations.
kono
parents:
diff changeset
149
kono
parents:
diff changeset
150 function Bad_Final_Values (A : in Alert_Type) return Boolean is
kono
parents:
diff changeset
151 begin
kono
parents:
diff changeset
152 return (A /= (Alert_Time, Null_Device)); -- Check "/=" operator
kono
parents:
diff changeset
153 -- availability.
kono
parents:
diff changeset
154 end Bad_Final_Values; -- Aggregate with
kono
parents:
diff changeset
155 -- positional assoc.
kono
parents:
diff changeset
156
kono
parents:
diff changeset
157 end C3900050;