OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [ce/] [ce2103c.ada] - Blame information for rev 294

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- CE2103C.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 IS_OPEN RETURNS THE PROPER VALUES FOR FILES OF
27
--     TYPE SEQUENTIAL_IO.
28
 
29
--          B) OPENED FILES
30
 
31
-- APPLICABILITY CRITERIA:
32
--     THIS TEST IS APPLICABLE ONLY TO IMPLEMENTATIONS WHICH SUPPORT
33
--     SEQUENTIAL FILES.
34
 
35
-- HISTORY:
36
--     SPW 08/10/87  CREATED ORIGINAL TEST.
37
 
38
WITH REPORT; USE REPORT;
39
WITH SEQUENTIAL_IO;
40
 
41
PROCEDURE CE2103C IS
42
 
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;
48
 
49
BEGIN
50
 
51
     TEST ("CE2103C", "CHECK THAT IS_OPEN RETURNS THE PROPER " &
52
                      "VALUES FOR FILES OF TYPE SEQUENTIAL_IO");
53
 
54
-- FOLLOWING A CREATE
55
 
56
     VAL := FALSE;
57
 
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;
70
 
71
     VAL := IS_OPEN (TEST_FILE_ONE);
72
 
73
     IF VAL = FALSE THEN
74
          FAILED ("IS_OPEN RETURNS FALSE AFTER CREATE");
75
     END IF;
76
 
77
-- FOLLOWING CLOSE
78
 
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;
85
 
86
-- FOLLOWING OPEN
87
 
88
     VAL := FALSE;
89
 
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;
100
 
101
     VAL := IS_OPEN (TEST_FILE_ONE);
102
     IF VAL = FALSE THEN
103
          FAILED ("IS_OPEN RETURNS FALSE AFTER OPEN");
104
     END IF;
105
 
106
-- AFTER RESET
107
 
108
     VAL := FALSE;
109
 
110
     BEGIN
111
          RESET (TEST_FILE_ONE);
112
     EXCEPTION
113
          WHEN USE_ERROR =>
114
               NULL;
115
     END;
116
 
117
     VAL := IS_OPEN (TEST_FILE_ONE);
118
     IF VAL = FALSE THEN
119
          FAILED ("IS_OPEN RETURNS FALSE AFTER RESET");
120
     END IF;
121
 
122
-- AFTER DELETE
123
 
124
     VAL := TRUE;
125
 
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;
136
 
137
     VAL := IS_OPEN (TEST_FILE_ONE);
138
     IF VAL = TRUE THEN
139
          FAILED ("IS_OPEN RETURNS TRUE AFTER DELETE");
140
     END IF;
141
 
142
     RESULT;
143
 
144
EXCEPTION
145
 
146
     WHEN INCOMPLETE =>
147
          RESULT;
148
 
149
END CE2103C;

powered by: WebSVN 2.1.0

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