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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- CE3102B.TST
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 FOR TEXT FILES NAME_ERROR IS RAISED BY CREATE AND
27
--     OPEN IF THE GIVEN NAME STRING DOES NOT ALLOW THE IDENTIFICATION
28
--     OF AN EXTERNAL FILE.
29
 
30
-- APPLICABILITY CRITERIA:
31
--     THIS TEST IS ONLY APPLICABLE TO IMPLEMENTATIONS WHICH SUPPORT
32
--     CREATE FOR TEXT_IO.
33
 
34
-- HISTORY:
35
--     ABW 08/24/82
36
--     JBG 03/16/83
37
--     EG  05/30/85
38
--     JLH 08/12/87  REMOVED UNNECESSARY CODE, ADDED NEW CASES FOR OPEN,
39
--                   AND REMOVED DEPENDENCE ON DELETE.
40
 
41
WITH REPORT; USE REPORT;
42
WITH TEXT_IO; USE TEXT_IO;
43
 
44
PROCEDURE CE3102B IS
45
 
46
     FILE1, FILE2 : FILE_TYPE;
47
     FILE_NAME_OK : BOOLEAN := FALSE;
48
     INCOMPLETE : EXCEPTION;
49
 
50
BEGIN
51
 
52
     TEST ("CE3102B", "CHECK THAT NAME_ERROR IS RAISED " &
53
                      "APPROPRIATELY");
54
 
55
     -- CHECK THAT A LEGAL FILE NAME IS OK SO TEST IS VALID
56
 
57
     BEGIN
58
          CREATE (FILE1, OUT_FILE, LEGAL_FILE_NAME);
59
     EXCEPTION
60
          WHEN USE_ERROR =>
61
               NOT_APPLICABLE ("USE_ERROR RAISED ON CREATE " &
62
                               "OF ASSUMED VALID FILE");
63
               RAISE INCOMPLETE;
64
          WHEN NAME_ERROR =>
65
               NOT_APPLICABLE ("NAME_ERROR RAISED ON CREATE " &
66
                               "OF ASSUMED VALID FILE");
67
               RAISE INCOMPLETE;
68
     END;
69
 
70
     BEGIN
71
          DELETE (FILE1);
72
 
73
          BEGIN
74
               OPEN (FILE1, IN_FILE, LEGAL_FILE_NAME);
75
               FAILED ("FILE STILL EXISTS AFTER DELETE");
76
          EXCEPTION
77
               WHEN NAME_ERROR =>
78
                    NULL;
79
               WHEN USE_ERROR =>
80
                    FAILED ("USE_ERROR RAISED ON TEXT OPEN WITH " &
81
                            "IN_FILE MODE");
82
               WHEN OTHERS =>
83
                    FAILED ("UNEXPECTED EXCEPTION RAISED ON TEXT OPEN");
84
          END;
85
 
86
     EXCEPTION
87
          WHEN USE_ERROR =>
88
               NULL;
89
     END;
90
 
91
     -- PERFORM VARIOUS CHECKS
92
 
93
     BEGIN
94
          OPEN (FILE2, IN_FILE, LEGAL_FILE_NAME(2));
95
          FAILED ("NO EXCEPTION FOR NON-EXISTENT FILE - IN_FILE");
96
     EXCEPTION
97
          WHEN NAME_ERROR =>
98
               NULL;
99
          WHEN OTHERS =>
100
               FAILED ("OTHER EXCEPTION RAISED FOR OPEN OF " &
101
                       "NON-EXISTENT FILE - IN_FILE");
102
     END;
103
 
104
     BEGIN
105
          OPEN (FILE2, OUT_FILE, LEGAL_FILE_NAME(3));
106
          FAILED ("NO EXCEPTION FOR NON-EXISTENT FILE - OUT_FILE");
107
     EXCEPTION
108
          WHEN NAME_ERROR =>
109
               NULL;
110
          WHEN OTHERS =>
111
               FAILED ("OTHER EXCEPTION RAISED FOR OPEN FOR " &
112
                       "NON-EXISTENT FILE - OUT_FILE");
113
     END;
114
 
115
     BEGIN
116
          CREATE (FILE1, NAME => "$ILLEGAL_EXTERNAL_FILE_NAME1");
117
          FAILED ("NO EXCEPTION RAISED FOR " &
118
                  "$ILLEGAL_EXTERNAL_FILE_NAME1 - CREATE");
119
     EXCEPTION
120
          WHEN USE_ERROR =>
121
               FAILED ("USE_ERROR RAISED FOR " &
122
                       "$ILLEGAL_EXTERNAL_FILE_NAME1 - CREATE");
123
          WHEN NAME_ERROR =>
124
               NULL;
125
          WHEN OTHERS =>
126
               FAILED ("OTHER EXCEPTION RAISED FOR " &
127
                       "$ILLEGAL_EXTERNAL_FILE_NAME1 - CREATE");
128
     END;
129
 
130
     BEGIN
131
          CREATE (FILE2, NAME => "$ILLEGAL_EXTERNAL_FILE_NAME2");
132
          FAILED ("NO EXCEPTION RAISED FOR " &
133
                  "$ILLEGAL_EXTERNAL_FILE_NAME2 - CREATE");
134
     EXCEPTION
135
          WHEN USE_ERROR =>
136
               FAILED ("USE_ERROR RAISED FOR " &
137
                       "$ILLEGAL_EXTERNAL_FILE_NAME2 - CREATE");
138
          WHEN NAME_ERROR =>
139
               NULL;
140
          WHEN OTHERS =>
141
               FAILED ("OTHER EXCEPTION RAISED FOR " &
142
                       "$ILLEGAL_EXTERNAL_FILE_NAME2 - CREATE");
143
     END;
144
 
145
     BEGIN
146
          OPEN (FILE2, IN_FILE,
147
                NAME => "$ILLEGAL_EXTERNAL_FILE_NAME1");
148
          FAILED ("NO EXCEPTION RAISED FOR " &
149
                  "$ILLEGAL_EXTERNAL_FILE_NAME1 - OPEN");
150
     EXCEPTION
151
          WHEN USE_ERROR =>
152
               FAILED ("USE ERROR RAISED FOR " &
153
                       "$ILLEGAL_EXTERNAL_FILE_NAME1 - OPEN");
154
          WHEN NAME_ERROR =>
155
               NULL;
156
          WHEN OTHERS =>
157
               FAILED ("OTHER EXCEPTION RAISED FOR " &
158
                       "$ILLEGAL_EXTERNAL_FILE_NAME1 - OPEN");
159
     END;
160
 
161
     BEGIN
162
          OPEN (FILE1, IN_FILE,
163
                NAME => "$ILLEGAL_EXTERNAL_FILE_NAME2");
164
          FAILED ("NO EXCEPTION RAISED FOR " &
165
                  "$ILLEGAL_EXTERNAL_FILE_NAME2 - OPEN");
166
     EXCEPTION
167
          WHEN USE_ERROR =>
168
               FAILED ("USE_ERROR RAISED FOR " &
169
                       "$ILLEGAL_EXTERNAL_FILE_NAME2 - OPEN");
170
          WHEN NAME_ERROR =>
171
               NULL;
172
          WHEN OTHERS =>
173
               FAILED ("OTHER EXCEPTION RAISED FOR " &
174
                       "$ILLEGAL_EXTERNAL_FILE_NAME2 - OPEN");
175
     END;
176
 
177
     RESULT;
178
 
179
EXCEPTION
180
 
181
     WHEN INCOMPLETE =>
182
          RESULT;
183
 
184
END CE3102B;

powered by: WebSVN 2.1.0

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