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/] [ce3106b.ada] - Blame information for rev 867

Go to most recent revision | Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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