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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- CE2401J.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 DATA WRITTEN INTO A DIRECT FILE CAN BE READ
27
--     CORRECTLY.
28
 
29
-- APPLICABILITY CRITERIA:
30
--     THIS TEST IS ONLY APPLICABLE TO IMPLEMENTATIONS WHICH SUPPORT
31
--     CREATION WITH INOUT_FILE MODE AND OPENING WITH IN_FILE MODE FOR
32
--     DIRECT FILES.
33
 
34
-- HISTORY:
35
--     DWC 08/12/87  CREATE ORIGINAL TEST.
36
 
37
WITH REPORT; USE REPORT;
38
WITH DIRECT_IO;
39
 
40
PROCEDURE CE2401J IS
41
     END_SUBTEST: EXCEPTION;
42
BEGIN
43
 
44
     TEST ("CE2401J" , "CHECK THAT DATA WRITTEN INTO A DIRECT FILE " &
45
                       "CAN BE READ CORRECTLY");
46
 
47
     DECLARE
48
          PACKAGE DIR_IO IS NEW DIRECT_IO (INTEGER);
49
          USE DIR_IO;
50
          FILE : FILE_TYPE;
51
     BEGIN
52
          BEGIN
53
               CREATE (FILE, INOUT_FILE, LEGAL_FILE_NAME);
54
          EXCEPTION
55
               WHEN USE_ERROR | NAME_ERROR =>
56
                    NOT_APPLICABLE ("CREATE WITH INOUT FILE NOT " &
57
                                    "SUPPORTED");
58
                    RAISE END_SUBTEST;
59
               WHEN OTHERS =>
60
                    FAILED ("UNEXPECTED ERROR RAISED ON " &
61
                            "CREATE");
62
                    RAISE END_SUBTEST;
63
          END;
64
 
65
          DECLARE
66
               OUT_ITEM1 : INTEGER := 10;
67
               OUT_ITEM2 : INTEGER := 21;
68
               OUT_ITEM3 : INTEGER := 32;
69
               IN_ITEM   : INTEGER;
70
               ONE   : POSITIVE_COUNT := 1;
71
               THREE : POSITIVE_COUNT := 3;
72
               FIVE  : POSITIVE_COUNT := 5;
73
          BEGIN
74
               BEGIN
75
                    WRITE (FILE, OUT_ITEM1, ONE);
76
                    WRITE (FILE, OUT_ITEM2, THREE);
77
                    BEGIN
78
                         READ (FILE, IN_ITEM, ONE);
79
                         IF OUT_ITEM1 /= IN_ITEM THEN
80
                              FAILED ("INCORRECT INTEGER VALUE " &
81
                                      "READ - 1");
82
                         END IF;
83
                    END;
84
                    WRITE (FILE, OUT_ITEM3, FIVE);
85
               EXCEPTION
86
                    WHEN OTHERS =>
87
                         FAILED ("EXCEPTION RAISED ON WRITE");
88
                         RAISE END_SUBTEST;
89
               END;
90
 
91
               BEGIN
92
                    READ (FILE, IN_ITEM, THREE);
93
                    IF OUT_ITEM2 /= IN_ITEM THEN
94
                         FAILED ("INCORRECT INTEGER VALUE READ - 2");
95
                    END IF;
96
               END;
97
 
98
               BEGIN
99
                    RESET (FILE);
100
                    READ (FILE, IN_ITEM);
101
                    IF OUT_ITEM1 /= IN_ITEM THEN
102
                         FAILED ("INCORRECT INTEGER VALUE READ - 3");
103
                    END IF;
104
               EXCEPTION
105
                    WHEN USE_ERROR => NULL;
106
               END;
107
 
108
               CLOSE (FILE);
109
 
110
               BEGIN
111
                    OPEN (FILE, IN_FILE, LEGAL_FILE_NAME);
112
               EXCEPTION
113
                    WHEN USE_ERROR =>
114
                         RAISE END_SUBTEST;
115
               END;
116
 
117
               BEGIN
118
                    READ (FILE, IN_ITEM);
119
                    IF OUT_ITEM1 /= IN_ITEM THEN
120
                         FAILED ("INCORRECT INTEGER VALUE READ - 4");
121
                         RAISE END_SUBTEST;
122
                    END IF;
123
               EXCEPTION
124
                    WHEN OTHERS =>
125
                         FAILED ("READ IN IN_FILE MODE - 1");
126
               END;
127
 
128
               BEGIN
129
                    READ (FILE, IN_ITEM, ONE);
130
                    IF OUT_ITEM1 /= IN_ITEM THEN
131
                         FAILED ("INCORRECT INTEGER VALUE READ - 5");
132
                         RAISE END_SUBTEST;
133
                    END IF;
134
               EXCEPTION
135
                    WHEN OTHERS =>
136
                         FAILED ("READ IN IN_FILE MODE - 2");
137
               END;
138
 
139
               BEGIN
140
                    READ (FILE, IN_ITEM, FIVE);
141
                    IF OUT_ITEM3 /= IN_ITEM THEN
142
                         FAILED ("INCORRECT INTEGER VALUE READ - 6");
143
                         RAISE END_SUBTEST;
144
                    END IF;
145
               EXCEPTION
146
                    WHEN OTHERS =>
147
                         FAILED ("READ IN IN_FILE MODE - 3");
148
               END;
149
 
150
               BEGIN
151
                    READ (FILE, IN_ITEM, THREE);
152
                    IF OUT_ITEM2 /= IN_ITEM THEN
153
                         FAILED ("INCORRECT INTEGER VALUE READ - 7");
154
                         RAISE END_SUBTEST;
155
                    END IF;
156
               EXCEPTION
157
                    WHEN OTHERS =>
158
                         FAILED ("READ IN IN_FILE MODE - 4");
159
               END;
160
          END;
161
 
162
          BEGIN
163
               DELETE (FILE);
164
          EXCEPTION
165
               WHEN USE_ERROR =>
166
                    NULL;
167
          END;
168
 
169
     EXCEPTION
170
          WHEN END_SUBTEST =>
171
               NULL;
172
     END;
173
 
174
     RESULT;
175
 
176
END CE2401J;

powered by: WebSVN 2.1.0

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