OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- CE2111A.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
--     SEQUENTIAL 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/22/87  REWROTE TEST ALGORITHM.
41
 
42
WITH REPORT; USE REPORT;
43
WITH SEQUENTIAL_IO;
44
 
45
PROCEDURE CE2111A IS
46
 
47
     PACKAGE SEQ_IO IS NEW SEQUENTIAL_IO(INTEGER);
48
          USE SEQ_IO;
49
 
50
     SEQ_FILE : SEQ_IO.FILE_TYPE;
51
     VAR1 : INTEGER := 5;
52
     INCOMPLETE : EXCEPTION;
53
 
54
BEGIN
55
 
56
     TEST ("CE2111A", "CHECK THAT THE FILE REMAINS OPEN AFTER A RESET");
57
 
58
-- CREATE SEQUENTIAL TEST FILE
59
 
60
     BEGIN
61
          CREATE (SEQ_FILE, OUT_FILE, LEGAL_FILE_NAME);
62
          WRITE (SEQ_FILE, VAR1);
63
          CLOSE (SEQ_FILE);
64
     EXCEPTION
65
          WHEN USE_ERROR | NAME_ERROR =>
66
               NOT_APPLICABLE ("SEQUENTIAL FILES NOT SUPPORTED");
67
               RAISE INCOMPLETE;
68
     END;
69
 
70
-- OPEN FILE
71
 
72
     BEGIN
73
          OPEN (SEQ_FILE, IN_FILE, LEGAL_FILE_NAME);
74
     EXCEPTION
75
          WHEN USE_ERROR =>
76
               NOT_APPLICABLE ("OPEN WITH IN_FILE MODE NOT SUPPORTED " &
77
                               "FOR SEQ_IO");
78
               RAISE INCOMPLETE;
79
     END;
80
 
81
-- RESET FILE
82
 
83
     BEGIN
84
          RESET(SEQ_FILE);
85
     EXCEPTION
86
          WHEN USE_ERROR  =>
87
               NULL;
88
     END;
89
 
90
     IF IS_OPEN (SEQ_FILE) THEN
91
          CLOSE (SEQ_FILE);
92
     ELSE
93
          FAILED ("RESET FOR IN_FILE, CLOSED FILE");
94
     END IF;
95
 
96
-- RE-OPEN AS OUT_FILE AND REPEAT TEST
97
 
98
     BEGIN
99
          OPEN (SEQ_FILE, OUT_FILE, LEGAL_FILE_NAME);
100
     EXCEPTION
101
          WHEN USE_ERROR =>
102
               NOT_APPLICABLE ("OPEN WITH OUT_FILE MODE NOT " &
103
                               "SUPPORTED FOR SEQ_IO");
104
               RAISE INCOMPLETE;
105
     END;
106
 
107
     BEGIN
108
          RESET (SEQ_FILE);
109
     EXCEPTION
110
          WHEN USE_ERROR  =>
111
               NULL;
112
     END;
113
 
114
     IF IS_OPEN (SEQ_FILE) THEN
115
          BEGIN
116
               DELETE (SEQ_FILE);
117
          EXCEPTION
118
               WHEN USE_ERROR =>
119
                    NULL;
120
          END;
121
     ELSE
122
          FAILED ("RESET FOR OUT_FILE, CLOSED FILE");
123
     END IF;
124
 
125
     RESULT;
126
 
127
EXCEPTION
128
     WHEN INCOMPLETE =>
129
          RESULT;
130
 
131
END CE2111A;

powered by: WebSVN 2.1.0

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