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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- CE2111B.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 A SUCCESSFUL RESET POSITIONS THE INDEX CORRECTLY
27
--     TO THE START OF THE FILE FOR DIRECT IO.
28
 
29
-- APPLICABILITY CRITERIA:
30
--     THIS TEST IS APPLICABLE ONLY TO IMPLEMENTATIONS WHICH SUPPORT
31
--     RESET FOR DIRECT FILES.
32
 
33
-- HISTORY:
34
--     DLD 08/13/82
35
--     JBG 03/24/83
36
--     EG  05/29/85
37
--     JLH 07/23/87  ADDED CHECKS FOR USE_ERROR WHEN FILE IS RESET.
38
 
39
WITH REPORT; USE REPORT;
40
WITH DIRECT_IO;
41
 
42
PROCEDURE CE2111B IS
43
 
44
     PACKAGE DIR_IO IS NEW DIRECT_IO (INTEGER);
45
          USE DIR_IO;
46
     TEST_FILE_ONE : DIR_IO.FILE_TYPE;
47
     DATUM : INTEGER;
48
     INCOMPLETE : EXCEPTION;
49
 
50
BEGIN
51
 
52
     TEST ("CE2111B", "CHECK THAT SUCCESSFUL RESETS POSITION THE " &
53
                      "INDEX CORRECTLY");
54
 
55
-- CREATE AND INITIALIZE TEST FILE
56
 
57
     BEGIN
58
          CREATE (TEST_FILE_ONE, OUT_FILE, LEGAL_FILE_NAME);
59
     EXCEPTION
60
          WHEN USE_ERROR =>
61
               NOT_APPLICABLE ("USE_ERROR RAISED ON CREATE");
62
               RAISE INCOMPLETE;
63
          WHEN NAME_ERROR =>
64
               NOT_APPLICABLE ("NAME_ERROR RAISED ON CREATE");
65
               RAISE INCOMPLETE;
66
     END;
67
 
68
     WRITE (TEST_FILE_ONE, 5);
69
     WRITE (TEST_FILE_ONE, 6);
70
     WRITE (TEST_FILE_ONE, 7);
71
     WRITE (TEST_FILE_ONE, 8);
72
 
73
-- CHECK THAT RESET POSITIONS INDEX CORRECTLY FOR OUT_FILE
74
 
75
     BEGIN
76
          RESET (TEST_FILE_ONE);
77
          IF INDEX (TEST_FILE_ONE) /= 1 THEN
78
               FAILED ("RESET INCORRECTLY POSITIONED FILE FOR " &
79
                       "OUT_FILE");
80
          END IF;
81
     EXCEPTION
82
          WHEN USE_ERROR =>
83
               NOT_APPLICABLE ("RESET NOT SUPPORTED FOR OUT_FILE");
84
               RAISE INCOMPLETE;
85
     END;
86
 
87
-- WRITE MORE DATA
88
 
89
     WRITE (TEST_FILE_ONE, 2);
90
     CLOSE (TEST_FILE_ONE);
91
 
92
-- NOW CHECK TO SEE THAT RESET WORKED FOR OUT_FILE
93
 
94
     BEGIN
95
          OPEN (TEST_FILE_ONE, IN_FILE, LEGAL_FILE_NAME);
96
     EXCEPTION
97
          WHEN USE_ERROR =>
98
               NOT_APPLICABLE ("DIR_IO NOT SUPPORTED FOR IN_FILE OPEN");
99
               RAISE INCOMPLETE;
100
     END;
101
     READ (TEST_FILE_ONE, DATUM);
102
     IF DATUM /= 2 THEN
103
          FAILED ("RESET FAILED FOR OUT_FILE");
104
     END IF;
105
 
106
-- POSITION POINTER APPROPRIATELY FOR IN_FILE RESET
107
 
108
     READ (TEST_FILE_ONE, DATUM);
109
 
110
-- RESET IN_FILE
111
 
112
     BEGIN
113
          RESET (TEST_FILE_ONE);
114
          IF INDEX (TEST_FILE_ONE) /= 1 THEN
115
               FAILED ("RESET INCORRECTLY POSITIONED FILE " &
116
                       "FOR IN_FILE");
117
          END IF;
118
     EXCEPTION
119
          WHEN USE_ERROR =>
120
               NOT_APPLICABLE ("RESET NOT SUPPORTED FOR IN_FILE");
121
               RAISE INCOMPLETE;
122
     END;
123
 
124
-- VALIDATE IN_FILE RESET
125
 
126
     READ (TEST_FILE_ONE, DATUM);
127
     IF DATUM /= 2 THEN
128
          FAILED ("RESET FAILED FOR IN_FILE");
129
     END IF;
130
 
131
-- VALIDATE RESET FOR IN_OUT FILE
132
 
133
     CLOSE (TEST_FILE_ONE);
134
     BEGIN
135
          OPEN (TEST_FILE_ONE, INOUT_FILE, LEGAL_FILE_NAME);
136
     EXCEPTION
137
          WHEN USE_ERROR =>
138
               NOT_APPLICABLE ("DIR_IO NOT SUPPORTED FOR INOUT_FILE " &
139
                               "OPEN");
140
               RAISE INCOMPLETE;
141
     END;
142
 
143
-- WRITE NEW DATA
144
 
145
     WRITE (TEST_FILE_ONE, 3);
146
 
147
-- RESET INOUT_FILE
148
 
149
     BEGIN
150
          RESET (TEST_FILE_ONE);
151
          IF INDEX (TEST_FILE_ONE) /= 1 THEN
152
               FAILED ("RESET INCORRECTLY POSITIONED FILE " &
153
                       "FOR INOUT_FILE");
154
          END IF;
155
     EXCEPTION
156
          WHEN USE_ERROR =>
157
               NOT_APPLICABLE ("RESET NOT SUPPORTED FOR INOUT_FILE");
158
               RAISE INCOMPLETE;
159
     END;
160
 
161
-- VALIDATE RESET
162
 
163
     READ (TEST_FILE_ONE, DATUM);
164
     IF DATUM /= 3 THEN
165
          FAILED ("RESET FAILED FOR INOUT_FILE");
166
     END IF;
167
 
168
-- DELETE TEST FILE
169
 
170
     BEGIN
171
          DELETE (TEST_FILE_ONE);
172
     EXCEPTION
173
          WHEN USE_ERROR =>
174
               NULL;
175
     END;
176
 
177
     RESULT;
178
 
179
EXCEPTION
180
     WHEN INCOMPLETE =>
181
          RESULT;
182
 
183
END CE2111B;

powered by: WebSVN 2.1.0

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