OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [ce/] [ce2401f.ada] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- CE2401F.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 (WITH AND WITHOUT PARAMETER FROM), WRITE (WITH
27
--     AND WITHOUT PARAMETER TO), SET_INDEX, INDEX, SIZE, AND
28
--     END_OF_FILE ARE SUPPORTED FOR DIRECT FILES WITH ELEMENT_TYPE
29
--     PRIVATE.
30
 
31
-- APPLICABILITY CRITERIA:
32
--
33
--     THIS TEST IS ONLY APPLICABLE TO IMPLEMENTATIONS WHICH SUPPORT
34
--     CREATION WITH INOUT_FILE MODE AND OPENING WITH IN_FILE MODE FOR
35
--     DIRECT FILES.
36
 
37
-- HISTORY:
38
--     ABW 08/18/82
39
--     SPS 09/15/82
40
--     SPS 11/09/82
41
--     JBG 02/22/84  CHANGE TO .ADA TEST
42
--     EG  11/19/85  CORRECT SO TEST CAN HANDLE IMPLEMENTATION WITH
43
--                   POSITIVE_COUNT'LAST=1; COVER POSSIBILITY OF CREATE
44
--                   RAISING USE_ERROR; ENSURE RESET DOESN'T RAISE
45
--                   EXCEPTION IF CREATE FAILS; CHECK THAT WE CAN READ
46
--                   DATA THAT HAS BEEN WRITTEN.
47
--     TBN 11/04/86  REVISED TEST TO OUTPUT A NON_APPLICABLE
48
--                   RESULT WHEN FILES ARE NOT SUPPORTED.
49
--     DWC 08/11/87  ISOLATED EXCEPTIONS.
50
 
51
WITH REPORT; USE REPORT;
52
WITH DIRECT_IO;
53
 
54
PROCEDURE CE2401F IS
55
 
56
     END_SUBTEST : EXCEPTION;
57
 
58
BEGIN
59
 
60
     TEST ("CE2401F", "CHECK THAT READ, WRITE, SET_INDEX, " &
61
                       "INDEX, SIZE, AND END_OF_FILE ARE " &
62
                       "SUPPORTED FOR DIRECT FILES WITH " &
63
                       "ELEMENT_TYPE PRIVATE");
64
 
65
     DECLARE
66
 
67
          PACKAGE PKG IS
68
               TYPE PRIV IS PRIVATE;
69
               FUNCTION ASSIGN RETURN PRIV;
70
          PRIVATE
71
               TYPE PRIV IS NEW INTEGER;
72
          END PKG;
73
 
74
          USE PKG;
75
 
76
          PACKAGE DIR_PRV IS NEW DIRECT_IO (PRIV);
77
          USE DIR_PRV;
78
          FILE_PRV : FILE_TYPE;
79
 
80
          PACKAGE BODY PKG IS
81
               FUNCTION ASSIGN RETURN PRIV IS
82
               BEGIN
83
                    RETURN (16);
84
               END;
85
          BEGIN
86
               NULL;
87
          END PKG;
88
 
89
     BEGIN
90
          BEGIN
91
               CREATE (FILE_PRV, INOUT_FILE, LEGAL_FILE_NAME);
92
          EXCEPTION
93
               WHEN USE_ERROR | NAME_ERROR =>
94
                    NOT_APPLICABLE ("USE_ERROR | NAME_ERROR RAISED " &
95
                                    "ON CREATE - PRIVATE");
96
                    RAISE END_SUBTEST;
97
               WHEN OTHERS =>
98
                    FAILED ("UNEXPECTED ERROR RAISED ON " &
99
                            "CREATE - PRIVATE");
100
                    RAISE END_SUBTEST;
101
          END;
102
 
103
          BEGIN
104
 
105
               DECLARE
106
 
107
                    PRV, ITEM_PRV : PRIV;
108
                    ONE_PRV : POSITIVE_COUNT := 1;
109
                    TWO_PRV : POSITIVE_COUNT := 2;
110
 
111
               BEGIN
112
 
113
                    PRV := ASSIGN;
114
 
115
                    BEGIN
116
                         WRITE (FILE_PRV, PRV);
117
                    EXCEPTION
118
                         WHEN OTHERS =>
119
                              FAILED ("EXCEPTION RAISED ON WRITE FOR " &
120
                                      "PRIVATE - 1");
121
                    END;
122
 
123
                    BEGIN
124
                         WRITE (FILE_PRV, PRV, TWO_PRV);
125
                    EXCEPTION
126
                         WHEN OTHERS =>
127
                              FAILED ("EXCEPTION RAISED ON WRITE FOR " &
128
                                      "PRIVATE - 2");
129
                    END;
130
 
131
                    BEGIN
132
                         IF SIZE (FILE_PRV) /= TWO_PRV THEN
133
                              FAILED ("SIZE FOR TYPE PRIVATE");
134
                         END IF;
135
                         IF NOT END_OF_FILE (FILE_PRV) THEN
136
                              FAILED ("WRONG END_OF_FILE VALUE FOR " &
137
                                      "PRIVATE TYPE");
138
                         END IF;
139
 
140
                         SET_INDEX (FILE_PRV, ONE_PRV);
141
 
142
                         IF INDEX (FILE_PRV) /= ONE_PRV THEN
143
                              FAILED ("WRONG INDEX VALUE FOR PRIVATE " &
144
                                      "TYPE");
145
                         END IF;
146
                    END;
147
 
148
                    CLOSE (FILE_PRV);
149
 
150
                    BEGIN
151
                         OPEN (FILE_PRV, IN_FILE, LEGAL_FILE_NAME);
152
                    EXCEPTION
153
                         WHEN USE_ERROR =>
154
                              NOT_APPLICABLE ("OPEN FOR IN_FILE NOT " &
155
                                       "SUPPORTED");
156
                              RAISE END_SUBTEST;
157
                    END;
158
 
159
                    BEGIN
160
                         READ (FILE_PRV, ITEM_PRV);
161
                         IF ITEM_PRV /= PRV THEN
162
                              FAILED ("INCORRECT PRIVATE TYPE VALUE " &
163
                                      "READ - 1");
164
                         END IF;
165
                    EXCEPTION
166
                         WHEN OTHERS =>
167
                              FAILED ("READ WITHOUT FROM FOR " &
168
                                      "PRIVATE TYPE");
169
                    END;
170
 
171
                    BEGIN
172
                         READ (FILE_PRV, ITEM_PRV, ONE_PRV);
173
                         IF ITEM_PRV /= PRV THEN
174
                              FAILED ("INCORRECT PRIVATE TYPE VALUE " &
175
                                      "READ - 2");
176
                         END IF;
177
                    EXCEPTION
178
                         WHEN OTHERS =>
179
                              FAILED ("READ WITH FROM FOR " &
180
                                      "PRIVATE TYPE");
181
                    END;
182
               END;
183
 
184
               BEGIN
185
                    DELETE (FILE_PRV);
186
               EXCEPTION
187
                    WHEN USE_ERROR =>
188
                         NULL;
189
               END;
190
 
191
          END;
192
 
193
     EXCEPTION
194
          WHEN END_SUBTEST =>
195
               NULL;
196
     END;
197
 
198
     RESULT;
199
 
200
END CE2401F;

powered by: WebSVN 2.1.0

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