Dead
[official-gcc.git] / gomp-20050608-branch / gcc / testsuite / ada / acats / tests / ce / ce2103c.ada
blob2f70f3cb9fef72e2637b39f213d2ae4b1bdec9bc
1 -- CE2103C.ADA
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.
16 -- DISCLAIMER
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 IS_OPEN RETURNS THE PROPER VALUES FOR FILES OF
27 -- TYPE SEQUENTIAL_IO.
29 -- B) OPENED FILES
31 -- APPLICABILITY CRITERIA:
32 -- THIS TEST IS APPLICABLE ONLY TO IMPLEMENTATIONS WHICH SUPPORT
33 -- SEQUENTIAL FILES.
35 -- HISTORY:
36 -- SPW 08/10/87 CREATED ORIGINAL TEST.
38 WITH REPORT; USE REPORT;
39 WITH SEQUENTIAL_IO;
41 PROCEDURE CE2103C IS
43 PACKAGE SEQ_IO IS NEW SEQUENTIAL_IO(CHARACTER);
44 USE SEQ_IO;
45 INCOMPLETE : EXCEPTION;
46 TEST_FILE_ONE : SEQ_IO.FILE_TYPE;
47 VAL : BOOLEAN;
49 BEGIN
51 TEST ("CE2103C", "CHECK THAT IS_OPEN RETURNS THE PROPER " &
52 "VALUES FOR FILES OF TYPE SEQUENTIAL_IO");
54 -- FOLLOWING A CREATE
56 VAL := FALSE;
58 BEGIN
59 CREATE (TEST_FILE_ONE, OUT_FILE, LEGAL_FILE_NAME);
60 EXCEPTION
61 WHEN USE_ERROR =>
62 NOT_APPLICABLE ("USE_ERROR RAISED ON CREATE WITH " &
63 "OUT_FILE MODE");
64 RAISE INCOMPLETE;
65 WHEN NAME_ERROR =>
66 NOT_APPLICABLE ("NAME_ERROR RAISED ON CREATE WITH " &
67 "OUT_FILE MODE");
68 RAISE INCOMPLETE;
69 END;
71 VAL := IS_OPEN (TEST_FILE_ONE);
73 IF VAL = FALSE THEN
74 FAILED ("IS_OPEN RETURNS FALSE AFTER CREATE");
75 END IF;
77 -- FOLLOWING CLOSE
79 VAL := TRUE;
80 CLOSE (TEST_FILE_ONE);
81 VAL := IS_OPEN (TEST_FILE_ONE);
82 IF VAL = TRUE THEN
83 FAILED ("IS_OPEN RETURNS TRUE AFTER CLOSE");
84 END IF;
86 -- FOLLOWING OPEN
88 VAL := FALSE;
90 BEGIN
91 OPEN (TEST_FILE_ONE, IN_FILE, LEGAL_FILE_NAME);
92 EXCEPTION
93 WHEN USE_ERROR =>
94 IF IS_OPEN (TEST_FILE_ONE) /= FALSE THEN
95 FAILED ("IS_OPEN GIVES TRUE ON " &
96 "UNSUCESSFUL OPEN");
97 END IF;
98 RAISE INCOMPLETE;
99 END;
101 VAL := IS_OPEN (TEST_FILE_ONE);
102 IF VAL = FALSE THEN
103 FAILED ("IS_OPEN RETURNS FALSE AFTER OPEN");
104 END IF;
106 -- AFTER RESET
108 VAL := FALSE;
110 BEGIN
111 RESET (TEST_FILE_ONE);
112 EXCEPTION
113 WHEN USE_ERROR =>
114 NULL;
115 END;
117 VAL := IS_OPEN (TEST_FILE_ONE);
118 IF VAL = FALSE THEN
119 FAILED ("IS_OPEN RETURNS FALSE AFTER RESET");
120 END IF;
122 -- AFTER DELETE
124 VAL := TRUE;
126 BEGIN
127 DELETE (TEST_FILE_ONE);
128 EXCEPTION
129 WHEN USE_ERROR =>
130 IF IS_OPEN (TEST_FILE_ONE) /= FALSE THEN
131 FAILED ("IS_OPEN GIVES TRUE ON UNSUCCESSFUL " &
132 "DELETE");
133 END IF;
134 RAISE INCOMPLETE;
135 END;
137 VAL := IS_OPEN (TEST_FILE_ONE);
138 IF VAL = TRUE THEN
139 FAILED ("IS_OPEN RETURNS TRUE AFTER DELETE");
140 END IF;
142 RESULT;
144 EXCEPTION
146 WHEN INCOMPLETE =>
147 RESULT;
149 END CE2103C;