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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- CE3805A.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 MAY READ THE LAST CHARACTER IN THE FILE
27
--     WITHOUT RAISNG END_ERROR AND THAT SUBSEQUENT READING WILL RAISE
28
--     END_ERROR.
29
 
30
-- APPLICABILITY CRITERIA:
31
--     THIS TEST IS APPLICABLE ONLY TO IMPLEMENTATAIONS WHICH SUPPORT
32
--     TEXT FILES.
33
 
34
-- HISTORY:
35
--     SPS 09/08/82
36
--     JBG 02/22/84  CHANGED TO .ADA TEST
37
--     RJW 11/04/86  REVISED TEST TO OUTPUT A NOT_APPLICABLE
38
--                   RESULT WHEN FILES ARE NOT SUPPORTED.
39
--     JLH 09/15/87  REMOVED UNNECESSARY CODE AND CORRECTED EXCEPTION
40
--                   HANDLING.
41
 
42
WITH REPORT;
43
USE REPORT;
44
WITH TEXT_IO;
45
USE TEXT_IO;
46
 
47
PROCEDURE CE3805A IS
48
 
49
BEGIN
50
 
51
     TEST ("CE3805A", "CHECK THAT FLOAT_IO GET MAY READ THE LAST " &
52
                      "CHARACTER IN THE FILE WITHOUT RAISING " &
53
                      "END_ERROR AND THAT SUBSEQUENT READING WILL " &
54
                      "RAISE END_ERROR");
55
 
56
     DECLARE
57
          FT1, FT2 : FILE_TYPE;
58
          PACKAGE FL_IO IS NEW FLOAT_IO (FLOAT);
59
          X : FLOAT;
60
          USE FL_IO;
61
          INCOMPLETE : EXCEPTION;
62
 
63
     BEGIN
64
 
65
-- CREATE AND INITIALIZE TEST FILES
66
 
67
          BEGIN
68
               CREATE (FT1, OUT_FILE, LEGAL_FILE_NAME);
69
          EXCEPTION
70
               WHEN USE_ERROR =>
71
                    NOT_APPLICABLE ("USE_ERROR RAISED ON TEXT CREATE " &
72
                                    "WITH OUT_FILE MODE");
73
                    RAISE INCOMPLETE;
74
               WHEN NAME_ERROR =>
75
                    NOT_APPLICABLE ("NAME_ERROR RAISED ON TEXT " &
76
                                    "CREATE WITH OUT_FILE MODE");
77
                    RAISE INCOMPLETE;
78
          END;
79
 
80
          CREATE (FT2, OUT_FILE, LEGAL_FILE_NAME(2));
81
 
82
          PUT (FT1, "2.25");
83
          CLOSE (FT1);
84
 
85
          PUT (FT2, "2.50");
86
          NEW_LINE (FT2, 3);
87
          NEW_PAGE (FT2);
88
          NEW_LINE (FT2, 3);
89
          CLOSE (FT2);
90
 
91
-- BEGIN TEST
92
 
93
          BEGIN
94
               OPEN (FT1, IN_FILE, LEGAL_FILE_NAME);
95
          EXCEPTION
96
               WHEN USE_ERROR =>
97
                    NOT_APPLICABLE ("USE_ERROR RAISED ON TEXT " &
98
                                    "OPEN WITH IN_FILE MODE");
99
                    RAISE INCOMPLETE;
100
          END;
101
 
102
          OPEN (FT2, IN_FILE, LEGAL_FILE_NAME(2));
103
 
104
          BEGIN
105
               GET (FT1, X);
106
               IF X /= 2.25 THEN
107
                    FAILED ("INCORRECT VALUE READ");
108
               END IF;
109
               BEGIN
110
                    GET (FT1, X);
111
                    FAILED ("END_ERROR NOT RAISED - 1");
112
               EXCEPTION
113
                    WHEN END_ERROR =>
114
                         NULL;
115
                    WHEN  OTHERS =>
116
                         FAILED ("WRONG EXCEPTION RAISED - 1");
117
               END;
118
          EXCEPTION
119
               WHEN END_ERROR =>
120
                    FAILED ("END_ERROR RAISED PREMATURELY - 1");
121
               WHEN OTHERS =>
122
                    FAILED ("UNEXPECTED ERROR RAISED - 1");
123
          END;
124
 
125
          BEGIN
126
               GET (FT2, X);
127
               IF X /= 2.50 THEN
128
                    FAILED ("INCORRECT VALUE READ");
129
               END IF;
130
               BEGIN
131
                    GET (FT2, X);
132
                    FAILED ("END_ERROR NOT RAISED - 2");
133
               EXCEPTION
134
                    WHEN END_ERROR =>
135
                         NULL;
136
                    WHEN  OTHERS =>
137
                         FAILED ("WRONG EXCEPTION RAISED - 2");
138
               END;
139
          EXCEPTION
140
               WHEN END_ERROR =>
141
                    FAILED ("END_ERROR RAISED PREMATURELY - 2");
142
               WHEN OTHERS =>
143
                    FAILED ("UNEXPECTED ERROR RAISED - 2");
144
          END;
145
 
146
          BEGIN
147
               DELETE (FT1);
148
               DELETE (FT2);
149
          EXCEPTION
150
               WHEN USE_ERROR =>
151
                    NULL;
152
          END;
153
 
154
     EXCEPTION
155
          WHEN INCOMPLETE =>
156
               NULL;
157
 
158
     END;
159
 
160
     RESULT;
161
 
162
END CE3805A;

powered by: WebSVN 2.1.0

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