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

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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