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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 720 jeremybenn
-- CE3804E.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 FIXED_IO GET RAISES DATA_ERROR WHEN THE DATA READ IS
27
--     OUT-OF-RANGE CHECK THAT ITEM IS LEFT UNAFFECTED AND THAT
28
--     READING MAY CONTINUE AFTER THE EXCEPTION HAS BEEN HANDLED.
29
 
30
-- APPLICABILITY CRITERIA:
31
--     THIS TEST IS APPLICABLE ONLY TO IMPLEMENTATIONS WHICH
32
--     SUPPORT TEXT FILES.
33
 
34
-- HISTORY:
35
--     SPS 09/07/82
36
--     SPS 02/10/83
37
--     JBG 08/30/83
38
--     EG  11/02/84
39
--     RJW 11/04/86  REVISED TEST TO OUTPUT A NON_APPLICABLE
40
--                   RESULT WHEN FILES ARE NOT SUPPORTED.
41
--     DWC 09/11/87  REMOVED UNNECESSARY CODE AND CORRECTED
42
--                   EXCEPTION HANDLING.
43
 
44
WITH REPORT;
45
USE REPORT;
46
WITH TEXT_IO;
47
USE TEXT_IO;
48
 
49
PROCEDURE CE3804E IS
50
     INCOMPLETE : EXCEPTION;
51
 
52
BEGIN
53
 
54
     TEST ("CE3804E", "FIXED_IO GET RAISES DATA_ERROR FOR " &
55
                      "OUT-OF-RANGE DATA");
56
 
57
     DECLARE
58
          FT : FILE_TYPE;
59
     BEGIN
60
 
61
-- CREATE AND INITIALIZE TEST FILE
62
 
63
          BEGIN
64
               CREATE (FT, OUT_FILE, LEGAL_FILE_NAME);
65
          EXCEPTION
66
               WHEN USE_ERROR =>
67
                    NOT_APPLICABLE ("USE_ERROR RAISED; TEXT CREATE " &
68
                                    "WITH OUT_FILE MODE");
69
                    RAISE INCOMPLETE;
70
               WHEN NAME_ERROR =>
71
                    NOT_APPLICABLE ("NAME_ERROR RAISED; TEXT CREATE " &
72
                                    "WITH OUT_FILE MODE");
73
                    RAISE INCOMPLETE;
74
          END;
75
 
76
          PUT (FT, "1.25");
77
          NEW_LINE (FT);
78
          PUT (FT, "-7.5");
79
          NEW_LINE (FT);
80
          PUT (FT, "3.5");
81
          NEW_LINE (FT);
82
          PUT (FT, "2.5");
83
          NEW_LINE (FT);
84
          CLOSE (FT);
85
 
86
-- BEGIN TEST
87
 
88
          DECLARE
89
               TYPE FX IS DELTA 0.001 RANGE 1.0 .. 3.0;
90
               PACKAGE FX_IO IS NEW FIXED_IO (FX);
91
               X : FX;
92
               USE FX_IO;
93
          BEGIN
94
 
95
               BEGIN
96
                    OPEN (FT, IN_FILE, LEGAL_FILE_NAME);
97
               EXCEPTION
98
                    WHEN USE_ERROR =>
99
                         NOT_APPLICABLE ("USE_ERROR RAISED; TEXT " &
100
                                         "OPEN WITH IN_FILE MODE");
101
                         RAISE INCOMPLETE;
102
               END;
103
 
104
               GET (FT, X, 0);
105
 
106
               BEGIN
107
                    GET (FT, X, 0);
108
                    FAILED ("DATA_ERROR NOT RAISED - 1");
109
               EXCEPTION
110
                    WHEN DATA_ERROR =>
111
                         IF X /= 1.25 THEN
112
                              FAILED ("ITEM ALTERED WHEN DATA_ERROR " &
113
                                      "IS RAISED - 1");
114
                         END IF;
115
                    WHEN OTHERS =>
116
                         FAILED ("WRONG EXCEPTION RAISED - 1");
117
               END;
118
 
119
               BEGIN
120
                    GET (FT, X, 0);
121
                    FAILED ("DATA_ERROR NOT RAISED - 2");
122
               EXCEPTION
123
                    WHEN DATA_ERROR =>
124
                         IF X /= 1.25 THEN
125
                              FAILED ("ITEM ALTERED WHEN DATA_ERROR " &
126
                                      "IS RAISED - 2");
127
                         END IF;
128
                    WHEN OTHERS =>
129
                         FAILED ("WRONG EXCEPTION RAISED - 2");
130
               END;
131
 
132
               GET (FT, X, 0);
133
               IF X /= 2.5 THEN
134
                    FAILED ("READING NOT CONTINUED CORRECTLY " &
135
                            "AFTER DATA_ERROR");
136
               END IF;
137
 
138
               BEGIN
139
                    DELETE (FT);
140
               EXCEPTION
141
                    WHEN USE_ERROR =>
142
                         NULL;
143
               END;
144
 
145
          END;
146
 
147
     EXCEPTION
148
          WHEN INCOMPLETE =>
149
               NULL;
150
     END;
151
 
152
     RESULT;
153
 
154
END CE3804E;

powered by: WebSVN 2.1.0

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