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

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

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

powered by: WebSVN 2.1.0

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