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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 720 jeremybenn
-- CE3704D.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 INTEGER_IO GET READS AT MOST WIDTH CHARACTERS
27
--     OR UP TO THE NEXT TERMINATOR; INCLUDING LEADING BLANKS
28
--     AND HORIZONTAL TABULATION CHARACTERS, WHEN WIDTH IS
29
--     NONZERO.
30
 
31
--     CHECK THAT INPUT TERMINATES WHEN A LINE TERMINATOR IS
32
--     ENCOUNTERED AND THAT DATA_ERROR IS RAISED IF THE DATA
33
--     READ IS INVALID.
34
 
35
-- APPLICABILITY CRITERIA:
36
 
37
--     THIS TEST IS APPLICABLE ONLY TO IMPLEMENTATIONS WHICH
38
--     SUPPORT TEXT FILES.
39
 
40
-- HISTORY:
41
--     SPS 10/04/82
42
--     VKG 01/12/83
43
--     SPS 02/08/83
44
--     JBG 02/22/84  CHANGED TO .ADA TEST
45
--     RJW 11/04/86  REVISED TEST TO OUTPUT A NON_APPLICABLE
46
--                   RESULT WHEN FILES ARE NOT SUPPORTED.
47
--     DWC 09/09/87  ADDED CASES FOR TABS, REMOVED UNNECESSARY
48
--                   CODE, AND CHECKED FOR USE_ERROR ON DELETE.
49
 
50
WITH REPORT; USE REPORT;
51
WITH TEXT_IO; USE TEXT_IO;
52
 
53
PROCEDURE CE3704D IS
54
     INCOMPLETE : EXCEPTION;
55
 
56
BEGIN
57
 
58
     TEST ("CE3704D", "CHECK THAT INTEGER_IO GET READS AT MOST " &
59
                      "WIDTH CHARACTERS OR UP TO THE NEXT " &
60
                      "TERMINATOR; INCLUDING LEADING BLANKS AND " &
61
                      "HORIZONTAL TABULATION CHARACTERS, WHEN WIDTH " &
62
                      "IS NONZERO");
63
 
64
     DECLARE
65
          FT : FILE_TYPE;
66
          X : INTEGER;
67
          PACKAGE IIO IS NEW INTEGER_IO (INTEGER);
68
          USE IIO;
69
     BEGIN
70
 
71
-- CREATE AND INITIALIZE FILE
72
 
73
          BEGIN
74
               CREATE (FT, OUT_FILE, LEGAL_FILE_NAME);
75
          EXCEPTION
76
               WHEN USE_ERROR =>
77
                    NOT_APPLICABLE ("USE_ERROR RAISED; TEXT CREATE " &
78
                                    "WITH OUT_FILE MODE");
79
                    RAISE INCOMPLETE;
80
               WHEN NAME_ERROR =>
81
                    NOT_APPLICABLE ("NAME_ERROR RAISED; TEXT CREATE " &
82
                                    "WITH OUT_FILE MODE");
83
                    RAISE INCOMPLETE;
84
          END;
85
 
86
          PUT (FT, "  123");
87
          NEW_LINE (FT);
88
          PUT (FT, "-5678");
89
          NEW_LINE (FT);
90
          PUT (FT, "  ");
91
          NEW_PAGE (FT);
92
          PUT (FT, ASCII.HT & "9");
93
          NEW_PAGE (FT);
94
 
95
          CLOSE (FT);
96
 
97
          BEGIN
98
               OPEN (FT, IN_FILE, LEGAL_FILE_NAME);
99
          EXCEPTION
100
               WHEN USE_ERROR =>
101
                    NOT_APPLICABLE ("USE_ERROR RAISED; TEXT OPEN " &
102
                                    "WITH IN_FILE MODE");
103
                    RAISE INCOMPLETE;
104
          END;
105
 
106
-- BEGIN TEST
107
 
108
          GET (FT, X, 5);
109
          IF X /= IDENT_INT (123) THEN
110
               FAILED ("WIDTH CHARACTERS NOT READ - 1");
111
          ELSE
112
               BEGIN
113
                    GET (FT, X, 2);
114
                    FAILED ("DATA_ERROR NOT RAISED - 1");
115
               EXCEPTION
116
                    WHEN DATA_ERROR =>
117
                         NULL;
118
                    WHEN OTHERS =>
119
                         FAILED ("WRONG EXCEPTION RAISED -1");
120
               END;
121
               SKIP_LINE (FT);
122
               GET (FT, X, 6);
123
               IF X /= IDENT_INT (-5678) THEN
124
                    FAILED ("GET WITH WIDTH " &
125
                            "INCORRECT - 2");
126
               ELSE
127
                    BEGIN
128
                         GET (FT, X, 2);
129
                         FAILED ("DATA_ERROR NOT RAISED - 2");
130
                    EXCEPTION
131
                         WHEN DATA_ERROR =>
132
                              NULL;
133
                         WHEN OTHERS =>
134
                              FAILED ("WRONG EXCEPTION RAISED - 2");
135
                    END;
136
                    SKIP_LINE(FT);
137
                    BEGIN
138
                         GET (FT, X, 2);
139
                         FAILED ("DATA_ERROR NOT RAISED - 3");
140
                    EXCEPTION
141
                         WHEN DATA_ERROR =>
142
                              NULL;
143
                         WHEN OTHERS =>
144
                              FAILED ("WRONG EXCEPTION RAISED - 3");
145
                    END;
146
                    SKIP_LINE(FT);
147
                    GET (FT, X, 2);
148
                    IF X /= IDENT_INT (9) THEN
149
                         FAILED ("GET WITH WIDTH " &
150
                                 "INCORRECT - 3");
151
                    END IF;
152
               END IF;
153
          END IF;
154
 
155
          BEGIN
156
               DELETE (FT);
157
          EXCEPTION
158
               WHEN USE_ERROR =>
159
                    NULL;
160
          END;
161
 
162
     EXCEPTION
163
          WHEN INCOMPLETE =>
164
               NULL;
165
     END;
166
 
167
     RESULT;
168
 
169
END CE3704D;

powered by: WebSVN 2.1.0

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