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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- CE2103A.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 IS_OPEN RETURNS THE PROPER VALUES FOR FILES OF
27
--     TYPE SEQUENTIAL_IO.
28
 
29
--          A) UNOPENED FILES
30
 
31
-- HISTORY:
32
--     DLD 08/10/82
33
--     SPS 11/09/82
34
--     JBG 03/24/83
35
--     EG  06/03/85
36
--     SPW 08/10/87  SPLIT CASE FOR OPENED FILES INTO CE2103C.ADA.
37
--     PWB 03/07/97  ADDED CHECK FOR FILE SUPPORT.
38
 
39
WITH REPORT; USE REPORT;
40
WITH SEQUENTIAL_IO;
41
 
42
PROCEDURE CE2103A IS
43
 
44
     PACKAGE SEQ_IO IS NEW SEQUENTIAL_IO(CHARACTER);
45
          USE SEQ_IO;
46
 
47
     TEST_FILE_ZERO : SEQ_IO.FILE_TYPE;
48
     TEST_FILE_ONE : SEQ_IO.FILE_TYPE;
49
     TEST_FILE_TWO : SEQ_IO.FILE_TYPE;
50
     TEST_FILE_THREE : SEQ_IO.FILE_TYPE;
51
     TEST_FILE_FOUR : SEQ_IO.FILE_TYPE;
52
     VAL : BOOLEAN;
53
 
54
     INCOMPLETE : EXCEPTION;
55
 
56
BEGIN
57
 
58
     TEST ("CE2103A", "CHECK THAT IS_OPEN RETURNS THE PROPER " &
59
                      "VALUES FOR UNOPENED FILES OF TYPE " &
60
                      "SEQUENTIAL_IO");
61
 
62
-- FIRST TEST WHETHER IMPLEMENTATION SUPPORTS SEQUENTIAL FILES AT ALL
63
 
64
     BEGIN
65
          SEQ_IO.CREATE ( TEST_FILE_ZERO,
66
                          SEQ_IO.OUT_FILE,
67
                          REPORT.LEGAL_FILE_NAME );
68
     EXCEPTION
69
          WHEN SEQ_IO.USE_ERROR | SEQ_IO.NAME_ERROR =>
70
               REPORT.NOT_APPLICABLE
71
                    ( "SEQUENTIAL FILES NOT SUPPORTED -- CREATE OUT-FILE" );
72
               RAISE INCOMPLETE;
73
     END;
74
     SEQ_IO.DELETE ( TEST_FILE_ZERO );
75
 
76
-- WHEN FILE IS DECLARED BUT NOT OPEN
77
 
78
     BEGIN
79
          VAL := TRUE;
80
          VAL := IS_OPEN (TEST_FILE_ONE);
81
          IF VAL = TRUE THEN
82
               FAILED ("FILE NOT OPEN BUT IS_OPEN RETURNS TRUE");
83
          END IF;
84
     END;
85
 
86
-- FOLLOWING UNSUCCESSFUL CREATE
87
 
88
     BEGIN
89
          VAL := TRUE;
90
          CREATE (TEST_FILE_TWO, OUT_FILE,
91
                  "$ILLEGAL_EXTERNAL_FILE_NAME1");
92
          FAILED ("NAME_ERROR NOT RAISED - UNSUCCESSFUL CREATE");
93
     EXCEPTION
94
          WHEN NAME_ERROR =>
95
               VAL := IS_OPEN (TEST_FILE_TWO);
96
               IF VAL = TRUE THEN
97
                    FAILED ("IS_OPEN GIVES TRUE AFTER AN " &
98
                            "UNSUCCESSFUL CREATE");
99
               END IF;
100
     END;
101
 
102
-- FOLLOWING UNSUCCESSFUL OPEN
103
 
104
     BEGIN
105
          VAL := TRUE;
106
          OPEN (TEST_FILE_THREE, IN_FILE,
107
                "$ILLEGAL_EXTERNAL_FILE_NAME1");
108
          FAILED ("NAME_ERROR NOT RAISED - UNSUCCESSFUL OPEN");
109
     EXCEPTION
110
          WHEN NAME_ERROR =>
111
               VAL := IS_OPEN (TEST_FILE_THREE);
112
               IF VAL = TRUE THEN
113
                    FAILED ("IS_OPEN GIVES TRUE - UNSUCCESSFUL OPEN");
114
               END IF;
115
     END;
116
 
117
-- FOLLOWING CLOSING FILE THAT IS NOT OPEN
118
 
119
     BEGIN
120
          VAL := TRUE;
121
          CLOSE (TEST_FILE_FOUR);
122
          FAILED ("STATUS ERROR NOT RAISED WHEN " &
123
                  "ATTEMPTING TO CLOSE AN UNOPENED FILE");
124
     EXCEPTION
125
          WHEN STATUS_ERROR =>
126
               VAL := IS_OPEN (TEST_FILE_FOUR);
127
               IF VAL = TRUE THEN
128
                    FAILED ("IS_OPEN GIVES TRUE AFTER ATTEMPTING " &
129
                            "TO CLOSE AN UNOPENED FILE");
130
               END IF;
131
     END;
132
 
133
     RESULT;
134
 
135
EXCEPTION
136
     WHEN INCOMPLETE =>
137
          NULL;
138
          REPORT.RESULT;
139
     WHEN OTHERS =>
140
          REPORT.FAILED ( "UNEXPECTED EXCEPTION" );
141
          REPORT.RESULT;
142
END CE2103A;

powered by: WebSVN 2.1.0

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