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

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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