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

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- CE3805B.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 MAY READ THE LAST CHARACTER IN THE FILE
27
--     WITHOUT RAISING END_ERROR AND THAT SUBSEQUENT READING WILL RAISE
28
--     END_ERROR.
29
 
30
-- APPLICABILITY CRITERIA:
31
--     THIS TEST IS APPLICABLE ONLY TO IMPLEMENTATIONS 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 CE3805B IS
48
 
49
BEGIN
50
 
51
     TEST ("CE3805B", "CHECK THAT FIXED_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
          TYPE FIXED IS DELTA 0.02 RANGE 0.0 .. 50.0;
59
          PACKAGE FX_IO IS NEW FIXED_IO (FIXED);
60
          X : FIXED;
61
          USE FX_IO;
62
          INCOMPLETE : EXCEPTION;
63
 
64
     BEGIN
65
 
66
-- CREATE AND INITIALIZE TEST FILES
67
 
68
          BEGIN
69
               CREATE (FT1, OUT_FILE, LEGAL_FILE_NAME);
70
          EXCEPTION
71
               WHEN USE_ERROR =>
72
                    NOT_APPLICABLE ("USE_ERROR RAISED ON TEXT CREATE " &
73
                                    "WITH OUT_FILE MODE");
74
                    RAISE INCOMPLETE;
75
               WHEN NAME_ERROR =>
76
                    NOT_APPLICABLE ("NAME_ERROR RAISED ON TEXT " &
77
                                    "CREATE WITH OUT_FILE MODE");
78
                    RAISE INCOMPLETE;
79
          END;
80
 
81
          CREATE (FT2, OUT_FILE, LEGAL_FILE_NAME(2));
82
 
83
          PUT (FT1, "2.25");
84
          CLOSE (FT1);
85
 
86
          PUT (FT2, "2.50");
87
          NEW_LINE (FT2, 3);
88
          NEW_PAGE (FT2);
89
          NEW_LINE (FT2, 3);
90
          CLOSE (FT2);
91
 
92
-- BEGIN TEST
93
 
94
          BEGIN
95
               OPEN (FT1, IN_FILE, LEGAL_FILE_NAME);
96
          EXCEPTION
97
               WHEN USE_ERROR =>
98
                    NOT_APPLICABLE ("USE_ERROR RAISED ON TEXT OPEN " &
99
                                    "FOR IN_FILE MODE");
100
                    RAISE INCOMPLETE;
101
          END;
102
 
103
          OPEN (FT2, IN_FILE, LEGAL_FILE_NAME(2));
104
 
105
          BEGIN
106
               GET (FT1, X);
107
               IF X /= 2.25 THEN
108
                    FAILED ("INCORRECT VALUE READ");
109
               END IF;
110
               BEGIN
111
                    GET (FT1, X);
112
                    FAILED ("END_ERROR NOT RAISED - 1");
113
               EXCEPTION
114
                    WHEN END_ERROR =>
115
                         NULL;
116
                    WHEN  OTHERS =>
117
                         FAILED ("WRONG EXCEPTION RAISED - 1");
118
               END;
119
          EXCEPTION
120
               WHEN END_ERROR =>
121
                    FAILED ("END_ERROR RAISED PREMATURELY - 1");
122
               WHEN OTHERS =>
123
                    FAILED ("UNEXPECTED ERROR RAISED - 1");
124
          END;
125
 
126
          BEGIN
127
               GET (FT2, X);
128
               IF X /= 2.50 THEN
129
                    FAILED ("INCORRECT VALUE READ");
130
               END IF;
131
               BEGIN
132
                    GET (FT2, X);
133
                    FAILED ("END_ERROR NOT RAISED - 2");
134
               EXCEPTION
135
                    WHEN END_ERROR =>
136
                         NULL;
137
                    WHEN  OTHERS =>
138
                         FAILED ("WRONG EXCEPTION RAISED - 2");
139
               END;
140
          EXCEPTION
141
               WHEN END_ERROR =>
142
                    FAILED ("END_ERROR RAISED PREMATURELY - 2");
143
               WHEN OTHERS =>
144
                    FAILED ("UNEXPECTED ERROR RAISED - 2");
145
          END;
146
 
147
          BEGIN
148
               DELETE (FT1);
149
               DELETE (FT2);
150
          EXCEPTION
151
               WHEN USE_ERROR =>
152
                    NULL;
153
          END;
154
 
155
     EXCEPTION
156
          WHEN INCOMPLETE =>
157
               NULL;
158
 
159
     END;
160
 
161
     RESULT;
162
 
163
END CE3805B;

powered by: WebSVN 2.1.0

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