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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [ce/] [ce2401i.ada] - Blame information for rev 720

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 720 jeremybenn
-- CE2401I.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
--     FIXED POINT.
30
 
31
-- APPLICABILITY CRITERIA:
32
--     THIS TEST IS ONLY FOR IMPLEMENTATIONS WHICH SUPPORT CREATION OF
33
--     DIRECT FILES WITH INOUT_FILE MODE AND OPENING OF DIRECT FILES
34
--     WITH IN_FILE MODE.
35
 
36
-- HISTORY:
37
--     DWC 08/10/87  CREATED ORIGINAL VERSION.
38
 
39
WITH REPORT; USE REPORT;
40
WITH DIRECT_IO;
41
 
42
PROCEDURE CE2401I IS
43
 
44
     END_SUBTEST : EXCEPTION;
45
 
46
BEGIN
47
 
48
     TEST ("CE2401I", "CHECK THAT READ, WRITE, SET_INDEX, " &
49
                       "INDEX, SIZE, AND END_OF_FILE ARE " &
50
                       "SUPPORTED FOR DIRECT FILES WITH " &
51
                       "ELEMENT_TYPE FIXED");
52
 
53
     DECLARE
54
 
55
          TYPE FIX_TYPE IS DELTA 0.5 RANGE 0.0 .. 255.0;
56
          PACKAGE DIR_FIX IS NEW DIRECT_IO (FIX_TYPE);
57
          USE DIR_FIX;
58
          FILE_FIX : FILE_TYPE;
59
 
60
     BEGIN
61
          BEGIN
62
               CREATE (FILE_FIX, INOUT_FILE, LEGAL_FILE_NAME);
63
          EXCEPTION
64
               WHEN USE_ERROR | NAME_ERROR =>
65
                    NOT_APPLICABLE ("USE_ERROR | NAME_ERROR RAISED " &
66
                                    "ON CREATE - FIXED POINT");
67
                    RAISE END_SUBTEST;
68
               WHEN OTHERS =>
69
                    FAILED ("UNEXPECTED ERROR RAISED ON " &
70
                            "CREATE - FIXED POINT");
71
                    RAISE END_SUBTEST;
72
          END;
73
 
74
          DECLARE
75
               FIX : FIX_TYPE := 16.0;
76
               ITEM_FIX : FIX_TYPE;
77
               ONE_FIX : POSITIVE_COUNT := 1;
78
               TWO_FIX : POSITIVE_COUNT := 2;
79
 
80
          BEGIN
81
               BEGIN
82
                    WRITE (FILE_FIX, FIX);
83
               EXCEPTION
84
                    WHEN OTHERS =>
85
                         FAILED ("EXCEPTION RAISED ON WRITE FOR " &
86
                                 "FIXED POINT - 1");
87
               END;
88
 
89
               BEGIN
90
                    WRITE (FILE_FIX, FIX, TWO_FIX);
91
               EXCEPTION
92
                    WHEN OTHERS =>
93
                         FAILED ("EXCEPTION RAISED ON WRITE FOR " &
94
                                 "FIXED POINT - 2");
95
               END;
96
 
97
               BEGIN
98
                    IF SIZE (FILE_FIX) /= TWO_FIX THEN
99
                         FAILED ("SIZE FOR TYPE FIXED POINT");
100
                    END IF;
101
 
102
                    IF NOT END_OF_FILE (FILE_FIX) THEN
103
                         FAILED ("WRONG END_OF_FILE VALUE FOR " &
104
                                 "FIXED POINT");
105
                    END IF;
106
 
107
                    SET_INDEX (FILE_FIX, ONE_FIX);
108
 
109
                    IF INDEX (FILE_FIX) /= ONE_FIX THEN
110
                         FAILED ("WRONG INDEX VALUE FOR FIXED " &
111
                                 "POINT");
112
                    END IF;
113
               END;
114
 
115
               CLOSE (FILE_FIX);
116
 
117
               BEGIN
118
                    OPEN (FILE_FIX, IN_FILE, LEGAL_FILE_NAME);
119
               EXCEPTION
120
                    WHEN USE_ERROR =>
121
                         NOT_APPLICABLE ("OPEN FOR IN_FILE MODE " &
122
                                         "NOT SUPPORTED");
123
                         RAISE END_SUBTEST;
124
               END;
125
 
126
               BEGIN
127
                    READ (FILE_FIX, ITEM_FIX);
128
                    IF ITEM_FIX /= FIX THEN
129
                        FAILED ("WRONG VALUE READ FOR FIXED POINT");
130
                    END IF;
131
               EXCEPTION
132
                    WHEN OTHERS =>
133
                         FAILED ("READ WITHOUT FROM FOR FIXED " &
134
                                 "POINT");
135
               END;
136
 
137
               BEGIN
138
                    READ (FILE_FIX, ITEM_FIX, ONE_FIX);
139
                    IF ITEM_FIX /= FIX THEN
140
                        FAILED ("WRONG VALUE READ WITH INDEX " &
141
                                "FOR FIXED POINT");
142
                    END IF;
143
               EXCEPTION
144
                    WHEN OTHERS =>
145
                         FAILED ("READ WITH FROM FOR FIXED POINT");
146
               END;
147
 
148
               BEGIN
149
                    DELETE (FILE_FIX);
150
               EXCEPTION
151
                    WHEN USE_ERROR =>
152
                         NULL;
153
               END;
154
          END;
155
 
156
     EXCEPTION
157
          WHEN END_SUBTEST =>
158
               NULL;
159
     END;
160
 
161
     RESULT;
162
 
163
END CE2401I;

powered by: WebSVN 2.1.0

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