OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [c9/] [c96007a.ada] - Blame information for rev 294

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- C96007A.ADA
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
-- CHECK THAT APPROPRIATE EXCEPTIONS ARE RAISED FOR THE TIME_OF()
26
-- FUNCTION IN THE PACKAGE CALENDAR. PARTICULARLY,
27
--   (A) TIME_ERROR IS RAISED ON INVALID DATES.
28
--   (B) CONSTRAINT_ERROR IS RAISED FOR OUT-OF-RANGE PARAMETERS.
29
 
30
-- CPP 8/16/84
31
 
32
WITH CALENDAR;  USE CALENDAR;
33
WITH REPORT;  USE REPORT;
34
PROCEDURE C96007A IS
35
 
36
BEGIN
37
     TEST ("C96007A", "CHECK THAT APPROPRIATE EXCEPTIONS ARE RAISED " &
38
           "FOR THE TIME_OF FUNCTION IN THE PACKAGE CALENDAR");
39
 
40
     --------------------------------------------
41
 
42
     DECLARE   -- (A)
43
 
44
          BAD_TIME : TIME;
45
 
46
     BEGIN     -- (A)
47
 
48
          BEGIN
49
               BAD_TIME := TIME_OF (1984, 2, 30);
50
               FAILED ("EXCEPTION NOT RAISED - 2/30 (A)");
51
          EXCEPTION
52
               WHEN TIME_ERROR =>
53
                    NULL;
54
               WHEN OTHERS =>
55
                    FAILED ("WRONG EXCEPTION RAISED - 2/30 (A)");
56
          END;
57
 
58
          BEGIN
59
               BAD_TIME := TIME_OF (1984, 2, 31);
60
               FAILED ("EXCEPTION NOT RAISED - 2/31 (A)");
61
          EXCEPTION
62
               WHEN TIME_ERROR =>
63
                    NULL;
64
               WHEN OTHERS =>
65
                    FAILED ("WRONG EXCEPTION RAISED - 2/31 (A)");
66
          END;
67
 
68
          BEGIN
69
               BAD_TIME := TIME_OF (1984, 4, 31);
70
               FAILED ("EXCEPTION NOT RAISED - 4/31 (A)");
71
          EXCEPTION
72
               WHEN TIME_ERROR =>
73
                    NULL;
74
               WHEN OTHERS =>
75
                    FAILED ("WRONG EXCEPTION RAISED - 4/31 (A)");
76
          END;
77
 
78
          BEGIN
79
               BAD_TIME := TIME_OF (1984, 6, 31);
80
               FAILED ("EXCEPTION NOT RAISED - 6/31 (A)");
81
          EXCEPTION
82
               WHEN TIME_ERROR =>
83
                    NULL;
84
               WHEN OTHERS =>
85
                    FAILED ("WRONG EXCEPTION RAISED - 6/31 (A)");
86
          END;
87
 
88
          BEGIN
89
               BAD_TIME := TIME_OF (1984, 9, 31);
90
               FAILED ("EXCEPTION NOT RAISED - 9/31 (A)");
91
          EXCEPTION
92
               WHEN TIME_ERROR =>
93
                    NULL;
94
               WHEN OTHERS =>
95
                    FAILED ("WRONG EXCEPTION RAISED - 9/31 (A)");
96
          END;
97
 
98
          BEGIN
99
               BAD_TIME := TIME_OF (1984, 11, 31);
100
               FAILED ("EXCEPTION NOT RAISED - 11/31 (A)");
101
          EXCEPTION
102
               WHEN TIME_ERROR =>
103
                    NULL;
104
               WHEN OTHERS =>
105
                    FAILED ("WRONG EXCEPTION RAISED - 11/31 (A)");
106
          END;
107
 
108
          BEGIN
109
               BAD_TIME := TIME_OF (1983, 2, 29);
110
               FAILED ("EXCEPTION NOT RAISED - 2/29 (A)");
111
          EXCEPTION
112
               WHEN TIME_ERROR =>
113
                    NULL;
114
               WHEN OTHERS =>
115
                    FAILED ("WRONG EXCEPTION RAISED - 2/29 (A)");
116
          END;
117
 
118
     END; -- (A)
119
 
120
     --------------------------------------------
121
 
122
     DECLARE   -- (B)
123
 
124
          BAD_TIME : TIME;
125
 
126
     BEGIN     -- (B)
127
 
128
          BEGIN
129
               BAD_TIME := TIME_OF (1900, 8, 13);
130
               FAILED ("EXCEPTION NOT RAISED - 1900 (B)");
131
          EXCEPTION
132
               WHEN CONSTRAINT_ERROR =>
133
                    NULL;
134
               WHEN OTHERS =>
135
                    FAILED ("WRONG EXCEPTION RAISED - 1900 (B)");
136
          END;
137
 
138
          BEGIN
139
               BAD_TIME := TIME_OF (YEAR_NUMBER'LAST + 1, 8, 13);
140
               FAILED ("EXCEPTION NOT RAISED - 2100 (B)");
141
          EXCEPTION
142
               WHEN CONSTRAINT_ERROR =>
143
                    NULL;
144
               WHEN OTHERS =>
145
                    FAILED ("WRONG EXCEPTION RAISED - 2100 (B)");
146
          END;
147
 
148
          BEGIN
149
               BAD_TIME := TIME_OF (1984, 0, 13);
150
               FAILED ("EXCEPTION NOT RAISED - MONTH (B)1");
151
          EXCEPTION
152
               WHEN CONSTRAINT_ERROR =>
153
                    NULL;
154
               WHEN OTHERS =>
155
                    FAILED ("WRONG EXCEPTION RAISED - MONTH (B)1");
156
          END;
157
 
158
          BEGIN
159
               BAD_TIME := TIME_OF (1984, 13, 13);
160
               FAILED ("EXCEPTION NOT RAISED - MONTH (B)2");
161
          EXCEPTION
162
               WHEN CONSTRAINT_ERROR =>
163
                    NULL;
164
               WHEN OTHERS =>
165
                    FAILED ("WRONG EXCEPTION RAISED - MONTH (B)2");
166
          END;
167
 
168
          BEGIN
169
               BAD_TIME := TIME_OF (1984, 8, 0);
170
               FAILED ("EXCEPTION NOT RAISED - DAY (B)1");
171
          EXCEPTION
172
               WHEN CONSTRAINT_ERROR =>
173
                    NULL;
174
               WHEN OTHERS =>
175
                    FAILED ("WRONG EXCEPTION RAISED - DAY (B)1");
176
          END;
177
 
178
          BEGIN
179
               BAD_TIME := TIME_OF (19784, 8, 32);
180
               FAILED ("EXCEPTION NOT RAISED - DAY (B)2");
181
          EXCEPTION
182
               WHEN CONSTRAINT_ERROR =>
183
                    NULL;
184
               WHEN OTHERS =>
185
                    FAILED ("WRONG EXCEPTION RAISED - DAY (B)2");
186
          END;
187
 
188
          BEGIN
189
               BAD_TIME := TIME_OF (1984, 8, 13, -0.5);
190
               FAILED ("EXCEPTION NOT RAISED - SECONDS (B)1");
191
          EXCEPTION
192
               WHEN CONSTRAINT_ERROR =>
193
                    NULL;
194
               WHEN OTHERS =>
195
                    FAILED ("WRONG EXCEPTION RAISED - SECONDS (B)1");
196
          END;
197
 
198
     END; -- (B)
199
 
200
     --------------------------------------------
201
 
202
     RESULT;
203
END C96007A;

powered by: WebSVN 2.1.0

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