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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [ce/] [ce3106a.ada] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- CE3106A.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 CLOSING A FILE HAS THE FOLLOWING EFFECT:
27
--          1) IF THERE IS NO LINE TERMINATOR, A LINE TERMINATOR, PAGE
28
--             TERMINATOR, AND FILE TERMINATOR ARE WRITTEN AT THE END
29
--             OF THE FILE.
30
--          2) IF THERE IS A LINE TERMINATOR BUT NO PAGE TERMINATOR, A
31
--             PAGE TERMINATOR AND A FILE TERMINATOR ARE WRITTEN.
32
--          3) IF THERE IS A PAGE TERMINATOR, A FILE TERMINATOR IS
33
--             WRITTEN.
34
 
35
-- APPLICABILITY CRITERIA:
36
--     THIS TEST IS APPLICABLE ONLY TO IMPLEMENTATIONS WHICH SUPPORT
37
--     TEXT FILES.
38
 
39
-- HISTORY:
40
--     JLH 07/08/88  CREATED ORIGINAL TEST.
41
 
42
WITH REPORT; USE REPORT;
43
WITH TEXT_IO; USE TEXT_IO;
44
 
45
PROCEDURE CE3106A IS
46
 
47
     INCOMPLETE : EXCEPTION;
48
     FILE1, FILE2, FILE3 : FILE_TYPE;
49
     ITEM : CHARACTER;
50
 
51
BEGIN
52
 
53
     TEST ("CE3106A", "CHECK THAT CLOSING A FILE HAS THE CORRECT " &
54
                      "EFFECT ON THE FILE CONCERNING LINE, PAGE, " &
55
                      "AND FILE TERMINATORS");
56
 
57
     BEGIN
58
 
59
          BEGIN
60
               CREATE (FILE1, OUT_FILE, LEGAL_FILE_NAME);
61
          EXCEPTION
62
               WHEN USE_ERROR =>
63
                    NOT_APPLICABLE ("USE_ERROR RAISED ON CREATE " &
64
                                    "WITH MODE OUT_FILE");
65
                    RAISE INCOMPLETE;
66
               WHEN NAME_ERROR =>
67
                    NOT_APPLICABLE ("NAME_ERROR RAISED ON CREATE" &
68
                                    "WITH MODE OUT_FILE");
69
                    RAISE INCOMPLETE;
70
               WHEN OTHERS =>
71
                    FAILED ("UNEXPECTED EXCEPTION RAISED ON CREATE");
72
                    RAISE INCOMPLETE;
73
          END;
74
 
75
          PUT (FILE1, 'A');
76
          NEW_LINE (FILE1);
77
          PUT (FILE1, 'B');
78
 
79
          CLOSE (FILE1);
80
 
81
          BEGIN
82
               OPEN (FILE1, IN_FILE, LEGAL_FILE_NAME);
83
          EXCEPTION
84
               WHEN USE_ERROR =>
85
                    NOT_APPLICABLE ("USE_ERROR RAISED ON TEXT OPEN " &
86
                                    "WITH MODE IN_FILE");
87
                    RAISE INCOMPLETE;
88
          END;
89
 
90
          GET (FILE1, ITEM);
91
 
92
          IF LINE (FILE1) /= 1 THEN
93
               FAILED ("INCORRECT LINE NUMBER - 1");
94
          END IF;
95
 
96
          GET (FILE1, ITEM);
97
          IF ITEM /= 'B' THEN
98
               FAILED ("INCORRECT VALUE READ - 1");
99
          END IF;
100
 
101
          IF LINE (FILE1) /= 2 THEN
102
               FAILED ("INCORRECT LINE NUMBER - 2");
103
          END IF;
104
 
105
          IF NOT END_OF_LINE (FILE1) THEN
106
               FAILED ("LINE TERMINATOR NOT WRITTEN WHEN FILE " &
107
                       "IS CLOSED");
108
          END IF;
109
 
110
          IF NOT END_OF_PAGE (FILE1) THEN
111
               FAILED ("PAGE TERMINATOR NOT WRITTEN WHEN FILE " &
112
                       "IS CLOSED");
113
          END IF;
114
 
115
          IF NOT END_OF_FILE (FILE1) THEN
116
               FAILED ("FILE TERMINATOR NOT WRITTEN WHEN FILE " &
117
                       "IS CLOSED");
118
          END IF;
119
 
120
          BEGIN
121
               DELETE (FILE1);
122
          EXCEPTION
123
               WHEN USE_ERROR =>
124
                    NULL;
125
          END;
126
 
127
          CREATE (FILE2, OUT_FILE, LEGAL_FILE_NAME(2));
128
          PUT (FILE2, 'A');
129
          NEW_LINE (FILE2);
130
          PUT (FILE2, 'B');
131
          NEW_PAGE (FILE2);
132
          PUT (FILE2, 'C');
133
          NEW_LINE (FILE2);
134
 
135
          CLOSE (FILE2);
136
 
137
          OPEN (FILE2, IN_FILE, LEGAL_FILE_NAME(2));
138
 
139
          GET (FILE2, ITEM);
140
 
141
          GET (FILE2, ITEM);
142
          IF ITEM /= 'B' THEN
143
               FAILED ("INCORRECT VALUE READ - 2");
144
          END IF;
145
 
146
          IF LINE (FILE2) /= 2 THEN
147
               FAILED ("INCORRECT LINE NUMBER - 3");
148
          END IF;
149
 
150
          GET (FILE2, ITEM);
151
 
152
          IF LINE (FILE2) /= 1 THEN
153
               FAILED ("INCORRECT LINE NUMBER - 4");
154
          END IF;
155
 
156
          IF PAGE (FILE2) /= 2 THEN
157
               FAILED ("INCORRECT PAGE NUMBER - 1");
158
          END IF;
159
 
160
          IF NOT END_OF_PAGE (FILE2) THEN
161
               FAILED ("PAGE TERMINATOR NOT WRITTEN WHEN FILE " &
162
                       "IS CLOSED - 2");
163
          END IF;
164
 
165
          IF NOT END_OF_FILE (FILE2) THEN
166
               FAILED ("FILE TERMINATOR NOT WRITTEN WHEN FILE " &
167
                       "IS CLOSED - 2");
168
          END IF;
169
 
170
          BEGIN
171
               DELETE (FILE2);
172
          EXCEPTION
173
               WHEN USE_ERROR =>
174
                    NULL;
175
          END;
176
 
177
          CREATE (FILE3, OUT_FILE, LEGAL_FILE_NAME(3));
178
          PUT (FILE3, 'A');
179
          NEW_PAGE (FILE3);
180
          PUT (FILE3, 'B');
181
          NEW_PAGE (FILE3);
182
          NEW_LINE (FILE3);
183
          PUT (FILE3, 'C');
184
          NEW_PAGE (FILE3);
185
 
186
          CLOSE (FILE3);
187
 
188
          OPEN (FILE3, IN_FILE, LEGAL_FILE_NAME(3));
189
 
190
          GET (FILE3, ITEM);
191
 
192
          GET (FILE3, ITEM);
193
          IF ITEM /= 'B' THEN
194
               FAILED ("INCORRECT VALUE READ - 3");
195
          END IF;
196
 
197
          GET (FILE3, ITEM);
198
 
199
          IF LINE (FILE3) /= 2 THEN
200
               FAILED ("INCORRECT LINE NUMBER - 5");
201
          END IF;
202
 
203
          IF PAGE (FILE3) /= 3 THEN
204
               FAILED ("INCORRECT PAGE NUMBER - 2");
205
          END IF;
206
 
207
          IF NOT END_OF_FILE (FILE3) THEN
208
               FAILED ("FILE TERMINATOR NOT WRITTEN WHEN FILE " &
209
                       "IS CLOSED - 3");
210
          END IF;
211
 
212
          BEGIN
213
               DELETE (FILE3);
214
          EXCEPTION
215
               WHEN USE_ERROR =>
216
                    NULL;
217
          END;
218
 
219
     EXCEPTION
220
          WHEN INCOMPLETE =>
221
               NULL;
222
     END;
223
 
224
     RESULT;
225
 
226
END CE3106A;

powered by: WebSVN 2.1.0

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