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

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

Line No. Rev Author Line
1 149 jeremybenn
-- CE2111E.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 FILE REMAINS OPEN AFTER A RESET.
27
 
28
--     THIS OBJECTIVE IS BEING INTERPRETED AS : CHECK THAT A FILE
29
--     REMAINS OPEN AFTER AN ATTEMPT TO RESET.
30
 
31
-- APPLICABILITY CRITERIA:
32
--     THIS TEST IS APPLICABLE ONLY TO IMPLEMENTATIONS WHICH SUPPORT
33
--     DIRECT FILES.
34
 
35
-- HISTORY:
36
--     DLD 08/13/82
37
--     SPS 11/09/82
38
--     JBG 03/24/83
39
--     EG  05/28/85
40
--     JLH 07/23/87  REWROTE TEST ALGORITHM.
41
 
42
WITH REPORT; USE REPORT;
43
WITH DIRECT_IO;
44
 
45
PROCEDURE CE2111E IS
46
 
47
     PACKAGE DIR_IO IS NEW DIRECT_IO (INTEGER);
48
          USE DIR_IO;
49
 
50
     DIR_FILE : DIR_IO.FILE_TYPE;
51
     VAR1 : INTEGER := 5;
52
     INCOMPLETE : EXCEPTION;
53
 
54
BEGIN
55
 
56
     TEST ("CE2111E", "CHECK THAT THE FILE REMAINS OPEN AFTER A RESET");
57
 
58
-- CREATE DIRECT TEST FILE
59
 
60
     BEGIN
61
          CREATE (DIR_FILE, OUT_FILE, LEGAL_FILE_NAME);
62
          WRITE (DIR_FILE, VAR1);
63
          CLOSE (DIR_FILE);
64
     EXCEPTION
65
          WHEN USE_ERROR | NAME_ERROR =>
66
               NOT_APPLICABLE ("DIRECT FILES NOT SUPPORTED");
67
               RAISE INCOMPLETE;
68
     END;
69
 
70
-- OPEN FILE
71
 
72
     BEGIN
73
          OPEN (DIR_FILE, IN_FILE, LEGAL_FILE_NAME);
74
     EXCEPTION
75
          WHEN USE_ERROR =>
76
               NOT_APPLICABLE ("OPEN WITH IN_FILE MODE NOT SUPPORTED " &
77
                               "FOR DIR_IO");
78
               RAISE INCOMPLETE;
79
     END;
80
 
81
-- RESET FILE
82
 
83
     BEGIN
84
          RESET (DIR_FILE);
85
     EXCEPTION
86
          WHEN USE_ERROR =>
87
               NULL;
88
     END;
89
 
90
     IF IS_OPEN (DIR_FILE) THEN
91
          CLOSE (DIR_FILE);
92
     ELSE
93
          FAILED ("RESET FOR IN_FILE, CLOSED FILE");
94
     END IF;
95
 
96
 
97
-- RE-OPEN AS OUT_FILE AND REPEAT TEST
98
 
99
     BEGIN
100
          OPEN (DIR_FILE, OUT_FILE, LEGAL_FILE_NAME);
101
     EXCEPTION
102
          WHEN USE_ERROR =>
103
               NOT_APPLICABLE ("OPEN WITH OUT_FILE MODE NOT " &
104
                               "SUPPORTED FOR DIR_IO");
105
               RAISE INCOMPLETE;
106
     END;
107
 
108
     BEGIN
109
          RESET (DIR_FILE);
110
     EXCEPTION
111
          WHEN USE_ERROR =>
112
               NULL;
113
     END;
114
 
115
     IF IS_OPEN (DIR_FILE) THEN
116
          CLOSE (DIR_FILE);
117
     ELSE
118
          FAILED ("RESET FOR OUT_FILE, CLOSED FILE");
119
     END IF;
120
 
121
-- RE-OPEN AS IN_OUT FILE AND REPEAT TEST
122
 
123
     BEGIN
124
          OPEN (DIR_FILE, INOUT_FILE, LEGAL_FILE_NAME);
125
     EXCEPTION
126
          WHEN USE_ERROR =>
127
               NOT_APPLICABLE ("OPEN WITH IN_OUT FILE MODE NOT " &
128
                               "SUPPORTED FOR DIR_IO");
129
               RAISE INCOMPLETE;
130
     END;
131
 
132
     BEGIN
133
          RESET (DIR_FILE);
134
     EXCEPTION
135
          WHEN USE_ERROR =>
136
               NULL;
137
     END;
138
 
139
     IF IS_OPEN (DIR_FILE) THEN
140
          BEGIN
141
               DELETE (DIR_FILE);
142
          EXCEPTION
143
               WHEN USE_ERROR =>
144
                    NULL;
145
          END;
146
     ELSE
147
          FAILED ("RESET FOR INOUT_FILE, CLOSED FILE");
148
     END IF;
149
 
150
     RESULT;
151
 
152
EXCEPTION
153
     WHEN INCOMPLETE =>
154
          RESULT;
155
 
156
END CE2111E;

powered by: WebSVN 2.1.0

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