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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- CE2202A.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 READ, WRITE, AND END_OF_FILE RAISE STATUS_ERROR
27
--     WHEN APPLIED TO A NON-OPEN SEQUENTIAL FILE.  USE_ERROR IS
28
--     NOT PERMITTED.
29
 
30
-- HISTORY:
31
--     ABW 08/17/82
32
--     SPS 09/13/82
33
--     SPS 11/09/82
34
--     EG  11/26/84
35
--     EG  05/16/85
36
--     GMT 07/24/87  REPLACED CALL TO REPORT.COMMENT WITH "NULL;".
37
 
38
WITH REPORT; USE REPORT;
39
WITH SEQUENTIAL_IO;
40
 
41
PROCEDURE CE2202A IS
42
 
43
     PACKAGE SEQ IS NEW SEQUENTIAL_IO (INTEGER);
44
     USE SEQ;
45
     FILE1, FILE2 : FILE_TYPE;
46
     CNST : CONSTANT INTEGER := 101;
47
     IVAL : INTEGER;
48
     BOOL : BOOLEAN;
49
 
50
BEGIN
51
     TEST ("CE2202A","CHECK THAT READ, WRITE, AND "    &
52
                     "END_OF_FILE RAISE STATUS_ERROR " &
53
                     "WHEN APPLIED TO A NON-OPEN "     &
54
                     "SEQUENTIAL FILE");
55
     BEGIN
56
          BEGIN
57
               WRITE (FILE1,CNST);
58
               FAILED ("STATUS_ERROR NOT RAISED WHEN WRITE APPLIED " &
59
                       "TO NON-EXISTENT FILE");
60
          EXCEPTION
61
               WHEN STATUS_ERROR =>
62
                    NULL;
63
               WHEN OTHERS =>
64
                    FAILED ("WRONG EXCEPTION RAISED WHEN WRITE " &
65
                            "APPLIED TO NON-EXISTENT FILE");
66
          END;
67
 
68
          BEGIN
69
               READ (FILE1,IVAL);
70
               FAILED ("STATUS_ERROR NOT RAISED WHEN READ APPLIED " &
71
                       "TO NON-EXISTENT FILE");
72
          EXCEPTION
73
               WHEN STATUS_ERROR =>
74
                    NULL;
75
               WHEN OTHERS =>
76
                    FAILED ("WRONG EXCEPTION RAISED WHEN READ " &
77
                            "APPLIED TO NON-EXISTENT FILE");
78
          END;
79
 
80
          BEGIN
81
               BOOL := END_OF_FILE (FILE1);
82
               FAILED ("STATUS_ERROR NOT RAISED WHEN END_OF_FILE " &
83
                       "APPLIED TO NON-EXISTENT FILE");
84
          EXCEPTION
85
               WHEN STATUS_ERROR =>
86
                    NULL;
87
               WHEN OTHERS =>
88
                    FAILED ("WRONG EXCEPTION RAISED WHEN END_OF_FILE " &
89
                            "APPLIED TO NON-EXISTENT FILE");
90
          END;
91
     END;
92
 
93
     BEGIN
94
          BEGIN
95
               CREATE (FILE2);
96
               CLOSE (FILE2);
97
          EXCEPTION
98
               WHEN USE_ERROR =>
99
                    NULL; -- IF FILE2 CANNOT BE CREATED THEN WE WILL
100
                          -- BE REPEATING EARLIER TESTS, BUT THAT'S OK.
101
          END;
102
 
103
          BEGIN
104
               WRITE (FILE2,CNST);
105
               FAILED ("STATUS_ERROR NOT RAISED WHEN WRITE APPLIED " &
106
                       "TO FILE2");
107
          EXCEPTION
108
               WHEN STATUS_ERROR =>
109
                    NULL;
110
               WHEN OTHERS =>
111
                    FAILED ("WRONG EXCEPTION RAISED WHEN WRITE " &
112
                            "APPLIED TO FILE2");
113
          END;
114
 
115
          BEGIN
116
               READ (FILE2,IVAL);
117
               FAILED ("STATUS_ERROR NOT RAISED WHEN READ APPLIED " &
118
                       "TO FILE2");
119
          EXCEPTION
120
               WHEN STATUS_ERROR =>
121
                    NULL;
122
               WHEN OTHERS =>
123
                    FAILED ("WRONG EXCEPTION RAISED WHEN READ " &
124
                            "APPLIED TO FILE2");
125
          END;
126
 
127
          BEGIN
128
               BOOL := END_OF_FILE (FILE2);
129
               FAILED ("STATUS_ERROR NOT RAISED WHEN END_OF_FILE " &
130
                       "APPLIED TO FILE2");
131
          EXCEPTION
132
               WHEN STATUS_ERROR =>
133
                    NULL;
134
               WHEN OTHERS =>
135
                    FAILED ("WRONG EXCEPTION RAISED WHEN END_OF_FILE " &
136
                            "APPLIED TO FILE2");
137
          END;
138
 
139
     END;
140
 
141
     RESULT;
142
 
143
END CE2202A;

powered by: WebSVN 2.1.0

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