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/] [ce/] [ce3104a.ada] - Blame information for rev 294

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- CE3104A.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
-- OBJECTIVE:
26
--     CHECK THAT THE CURRENT COLUMN, LINE, AND PAGE NUMBERS OF
27
--     TEXT FILES ARE SET TO ONE AFTER A CREATE, OPEN, OR RESET.
28
 
29
-- APPLICABILITY CRITERIA:
30
--     THIS TEST IS APPLICABLE ONLY TO IMPLEMENTATIONS WHICH SUPPORT
31
--     TEXT FILES.
32
 
33
-- HISTORY:
34
--     ABW 08/24/82
35
--     SPS 09/16/82
36
--     SPS 11/09/82
37
--     JBG 03/16/83
38
--     TBN 11/04/86  REVISED TEST TO OUTPUT A NON_APPLICABLE
39
--                   RESULT WHEN FILES ARE NOT SUPPORTED.
40
--     DWC 08/13/87  CHANGED FAILED MESSAGES AND ADDED SUBTEST
41
--                   EXCEPTION.
42
 
43
WITH REPORT;
44
USE REPORT;
45
WITH TEXT_IO;
46
USE TEXT_IO;
47
 
48
PROCEDURE CE3104A IS
49
 
50
     INCOMPLETE, SUBTEST : EXCEPTION;
51
     FILE, FT : FILE_TYPE;
52
     ONE      : CONSTANT POSITIVE_COUNT := POSITIVE_COUNT(IDENT_INT(1));
53
     CHAR     : CHARACTER;
54
 
55
BEGIN
56
 
57
     TEST ("CE3104A" , "CHECK THAT COLUMN, LINE, AND " &
58
                       "PAGE NUMBERS ARE ONE AFTER A " &
59
                       "CREATE, OPEN, OR RESET");
60
 
61
     BEGIN
62
          CREATE (FILE, OUT_FILE, LEGAL_FILE_NAME);
63
     EXCEPTION
64
          WHEN USE_ERROR =>
65
               NOT_APPLICABLE ("USE_ERROR RAISED; TEXT CREATE " &
66
                               "WITH OUT_FILE MODE");
67
               RAISE INCOMPLETE;
68
          WHEN NAME_ERROR =>
69
               NOT_APPLICABLE ("NAME_ERROR RAISED; TEXT CREATE " &
70
                               "WITH OUT_FILE MODE");
71
               RAISE INCOMPLETE;
72
          WHEN OTHERS =>
73
               FAILED ("UNEXPECTED EXCEPTION RAISED; TEXT CREATE " &
74
                       "WITH OUT_FILE MODE");
75
               RAISE INCOMPLETE;
76
     END;
77
 
78
     IF COL (FILE) /= ONE THEN
79
          FAILED ("INCORRECT RESULTS FROM COLUMN AFTER CREATE");
80
     END IF;
81
     IF LINE (FILE) /= ONE THEN
82
          FAILED ("INCORRECT RESULTS FROM LINE AFTER CREATE");
83
     END IF;
84
     IF PAGE (FILE) /= ONE THEN
85
          FAILED ("INCORRECT RESULTS FROM PAGE AFTER CREATE");
86
     END IF;
87
 
88
     NEW_PAGE (FILE);
89
     NEW_LINE (FILE);
90
     PUT (FILE, "STRING");
91
 
92
     CLOSE (FILE);
93
 
94
     BEGIN
95
          BEGIN
96
               OPEN (FILE, IN_FILE, LEGAL_FILE_NAME);
97
          EXCEPTION
98
               WHEN USE_ERROR =>
99
                    RAISE SUBTEST;
100
          END;
101
 
102
          IF COL (FILE) /= ONE THEN
103
               FAILED ("INCORRECT RESULTS FROM COLUMN AFTER " &
104
                       "OPEN - IN_FILE");
105
          END IF;
106
          IF LINE (FILE) /= ONE THEN
107
               FAILED ("INCORRECT RESULTS FROM LINE AFTER " &
108
                       "OPEN - IN_FILE");
109
          END IF;
110
          IF PAGE (FILE) /= ONE THEN
111
               FAILED ("INCORRECT RESULTS FROM PAGE AFTER " &
112
                       "OPEN - IN_FILE");
113
          END IF;
114
 
115
          GET (FILE, CHAR);   -- SETS PAGE, LINE, AND COL /= 1
116
 
117
          BEGIN
118
               RESET (FILE);
119
          EXCEPTION
120
               WHEN USE_ERROR =>
121
                    CLOSE (FILE);
122
                    RAISE SUBTEST;
123
          END;
124
 
125
          IF COL (FILE) /= ONE THEN
126
               FAILED ("INCORRECT RESULTS FROM COLUMN AFTER RESET");
127
          END IF;
128
          IF LINE (FILE) /= ONE THEN
129
               FAILED ("INCORRECT RESULTS FROM LINE AFTER RESET");
130
          END IF;
131
          IF PAGE (FILE) /= ONE THEN
132
               FAILED ("INCORRECT RESULTS FROM PAGE AFTER RESET");
133
          END IF;
134
 
135
          GET (FILE, CHAR);   -- CHANGES LINE, PAGE, COL; STILL IN_FILE
136
 
137
          BEGIN
138
               RESET (FILE,OUT_FILE);
139
          EXCEPTION
140
               WHEN USE_ERROR =>
141
                    CLOSE (FILE);
142
                    RAISE SUBTEST;
143
          END;
144
 
145
          IF COL (FILE) /= ONE THEN
146
               FAILED ("INCORRECT RESULTS FROM COLUMN AFTER RESET " &
147
                       "TO OUT_FILE");
148
          END IF;
149
          IF LINE (FILE) /= ONE THEN
150
               FAILED ("INCORRECT RESULTS FROM LINE AFTER RESET " &
151
                       "TO OUT_FILE");
152
          END IF;
153
          IF PAGE (FILE) /= ONE THEN
154
               FAILED ("INCORRECT RESULTS FROM PAGE AFTER RESET " &
155
                       "TO OUT_FILE");
156
          END IF;
157
 
158
          CLOSE (FILE);
159
 
160
     EXCEPTION
161
          WHEN SUBTEST =>
162
               NULL;
163
     END;
164
 
165
     BEGIN
166
          BEGIN
167
               OPEN (FILE, OUT_FILE, LEGAL_FILE_NAME);
168
          EXCEPTION
169
               WHEN USE_ERROR =>
170
                    RAISE SUBTEST;
171
          END;
172
 
173
          IF COL (FILE) /= ONE THEN
174
               FAILED ("INCORRECT RESULTS FROM COLUMN AFTER OPEN " &
175
                       "TO OUT_FILE");
176
          END IF;
177
          IF LINE (FILE) /= ONE THEN
178
               FAILED ("INCORRECT RESULTS FROM LINE AFTER OPEN " &
179
                       "TO OUT_FILE");
180
          END IF;
181
          IF PAGE (FILE) /= ONE THEN
182
               FAILED ("INCORRECT RESULTS FROM PAGE AFTER OPEN " &
183
                       "TO OUT_FILE");
184
          END IF;
185
 
186
     EXCEPTION
187
          WHEN SUBTEST =>
188
               NULL;
189
     END;
190
 
191
     BEGIN
192
          BEGIN
193
               CREATE (FT, IN_FILE);
194
          EXCEPTION
195
               WHEN USE_ERROR =>
196
                    RAISE SUBTEST;
197
          END;
198
 
199
          IF COL (FILE) /= ONE THEN
200
               FAILED ("INCORRECT RESULTS FROM COLUMN AFTER CREATE " &
201
                       "IN IN_FILE");
202
          END IF;
203
          IF LINE (FILE) /= ONE THEN
204
               FAILED ("INCORRECT RESULTS FROM LINE AFTER CREATE " &
205
                       "IN IN_FILE");
206
          END IF;
207
          IF PAGE (FILE) /= ONE THEN
208
               FAILED ("INCORRECT RESULTS FROM PAGE AFTER CREATE " &
209
                       "IN IN_FILE");
210
          END IF;
211
 
212
          CLOSE (FT);
213
 
214
     EXCEPTION
215
          WHEN SUBTEST =>
216
               NULL;
217
     END;
218
 
219
     BEGIN
220
          DELETE (FILE);
221
     EXCEPTION
222
          WHEN USE_ERROR =>
223
               NULL;
224
     END;
225
 
226
     RESULT;
227
 
228
EXCEPTION
229
     WHEN INCOMPLETE =>
230
          RESULT;
231
END CE3104A;

powered by: WebSVN 2.1.0

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