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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- CE3804D.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 FLOAT_IO GET RAISES DATA_ERROR WHEN THE DATA
27
--     READ IS OUT-OF-RANGE.  CHECK THAT ITEM IS LEFT UNAFFECTED
28
--     AND THAT READING MAY CONTINUE AFTER THE EXCEPTION HAS
29
--     BEEN HANDLED.
30
 
31
-- APPLICABILITY CRITERIA:
32
--     THIS TEST IS APPLICABLE ONLY TO IMPLEMENTATIONS WHICH
33
--     SUPPORT TEXT FILES.
34
 
35
-- HISTORY:
36
--     SPS 09/07/82
37
--     SPS 02/10/83
38
--     JBG 08/30/83
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 CE3804D IS
50
     INCOMPLETE : EXCEPTION;
51
 
52
BEGIN
53
 
54
     TEST ("CE3804D", "FLOAT_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 FL IS NEW FLOAT RANGE 1.0 .. 3.0;
90
               PACKAGE FL_IO IS NEW FLOAT_IO (FL);
91
               X : FL;
92
               USE FL_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);
105
 
106
               BEGIN
107
                    GET (FT, X);
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);
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);
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
          END;
145
 
146
     EXCEPTION
147
          WHEN INCOMPLETE =>
148
               NULL;
149
     END;
150
 
151
     RESULT;
152
 
153
END CE3804D;

powered by: WebSVN 2.1.0

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