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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- CE3107B.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 IS_OPEN RETURNS THE PROPER VALUES FOR FILES OF
27
--     TYPE TEXT_IO.
28
 
29
-- APPLICABILITY CRITERIA:
30
--     THIS TEST IS APPLICABLE ONLY TO IMPLEMENTATIONS WHICH SUPPORT
31
--     CREATION WITH OUT_FILE MODE FOR TEXT FILES.
32
 
33
-- HISTORY:
34
--     DWC 08/17/87  CREATED ORIGINAL TEST.
35
 
36
WITH REPORT; USE REPORT;
37
WITH TEXT_IO; USE TEXT_IO;
38
 
39
PROCEDURE CE3107B IS
40
 
41
     TEST_FILE_ONE : FILE_TYPE;
42
     TEST_FILE_TWO : FILE_TYPE;
43
     VAL : BOOLEAN;
44
 
45
     INCOMPLETE : EXCEPTION;
46
 
47
BEGIN
48
 
49
     TEST("CE3107B", "CHECK THAT IS_OPEN RETURNS THE " &
50
                     "PROPER VALUES FOR FILES OF TYPE TEXT_IO");
51
 
52
-- FOLLOWING A CREATE
53
 
54
     BEGIN
55
          VAL := FALSE;
56
          CREATE(TEST_FILE_ONE, OUT_FILE, LEGAL_FILE_NAME);
57
          VAL := IS_OPEN(TEST_FILE_ONE);
58
          IF VAL = FALSE THEN
59
               FAILED("IS_OPEN RETURNS FALSE AFTER CREATE");
60
          END IF;
61
     EXCEPTION
62
          WHEN USE_ERROR =>
63
               NOT_APPLICABLE ("USE_ERROR RAISED ON CREATE");
64
               RAISE INCOMPLETE;
65
          WHEN NAME_ERROR =>
66
               NOT_APPLICABLE ("NAME_ERROR RAISED ON CREATE");
67
               RAISE INCOMPLETE;
68
     END;
69
 
70
-- FOLLOWING CLOSE
71
 
72
     VAL := TRUE;
73
     IF IS_OPEN(TEST_FILE_ONE) = TRUE THEN
74
          CLOSE(TEST_FILE_ONE);
75
     END IF;
76
     VAL := IS_OPEN(TEST_FILE_ONE);
77
     IF VAL = TRUE THEN
78
          FAILED("IS_OPEN RETURNS TRUE AFTER CLOSE");
79
     END IF;
80
 
81
-- FOLLOWING OPEN
82
 
83
     BEGIN
84
          VAL := FALSE;
85
          BEGIN
86
               OPEN (TEST_FILE_TWO, IN_FILE, LEGAL_FILE_NAME);
87
          EXCEPTION
88
               WHEN USE_ERROR =>
89
                    IF IS_OPEN (TEST_FILE_TWO) /= FALSE THEN
90
                         FAILED ("FILE OPEN AFTER USE_ERROR " &
91
                                 "DURING OPEN");
92
                    END IF;
93
                    RAISE INCOMPLETE;
94
          END;
95
          VAL := IS_OPEN(TEST_FILE_TWO);
96
          IF VAL = FALSE THEN
97
               FAILED("IS_OPEN RETURNS FALSE AFTER OPEN");
98
          END IF;
99
 
100
-- AFTER RESET
101
 
102
          BEGIN
103
               VAL := FALSE;
104
               RESET(TEST_FILE_TWO);
105
               VAL := IS_OPEN(TEST_FILE_TWO);
106
               IF VAL = FALSE THEN
107
                    FAILED("IS_OPEN RETURNS FALSE AFTER RESET");
108
               END IF;
109
          EXCEPTION
110
               WHEN USE_ERROR =>
111
                    COMMENT("IMPLEMENTATION DOES NOT SUPPORT RESET");
112
          END;
113
     EXCEPTION
114
          WHEN INCOMPLETE =>
115
               NULL;
116
     END;
117
 
118
-- AFTER DELETE
119
 
120
     BEGIN
121
          VAL := TRUE;
122
          DELETE(TEST_FILE_TWO);
123
          VAL := IS_OPEN(TEST_FILE_TWO);
124
          IF VAL = TRUE THEN
125
               FAILED("IS_OPEN RETURNS TRUE AFTER DELETE");
126
          END IF;
127
     EXCEPTION
128
          WHEN USE_ERROR =>
129
               IF IS_OPEN (TEST_FILE_TWO) /= FALSE THEN
130
                    FAILED ("FILE OPEN AFTER USE_ERROR " &
131
                            "DURING DELETE");
132
               END IF;
133
     END;
134
 
135
     RESULT;
136
 
137
EXCEPTION
138
     WHEN INCOMPLETE =>
139
          RESULT;
140
 
141
END CE3107B;

powered by: WebSVN 2.1.0

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