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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- CE3605D.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 PUT DOES NOT RAISE LAYOUT_ERROR WHEN THE NUMBER OF
27
--     CHARACTERS TO BE OUTPUT EXCEEDS THE LINE LENGTH.
28
--     CHECK THAT PUT HAS THE EFFECT OF NEW_LINE (AS WELL AS
29
--     OUTPUTTING THE ITEM) WHEN THE NUMBER OF CHARACTERS TO BE OUTPUT
30
--     OVERFLOWS A BOUNDED LINE LENGTH.
31
--     CHECK THAT PUT WITH A NULL STRING PERFORMS NO OPERATION.
32
 
33
-- APPLICABILITY CRITERIA:
34
--     THIS TEST IS APPLICABLE ONLY TO IMPLEMENTATIONS WHICH SUPPORT
35
--     TEXT FILES.
36
 
37
-- HISTORY:
38
--     SPS 09/02/82
39
--     JBG 12/28/82
40
--     RJW 11/04/86  REVISED TEST TO OUTPUT A NOT_APPLICABLE
41
--                   RESULT WHEN FILES ARE NOT SUPPORTED.
42
--     JLH 09/08/87  CORRECTED EXCEPTION HANDLING.
43
 
44
WITH REPORT; USE REPORT;
45
WITH TEXT_IO; USE TEXT_IO;
46
WITH CHECK_FILE;
47
PROCEDURE CE3605D IS
48
     INCOMPLETE : EXCEPTION;
49
 
50
BEGIN
51
 
52
     TEST ("CE3605D", "CHECK THAT LAYOUT_ERROR IS NOT RAISED BY PUT " &
53
                      "FOR STRING");
54
 
55
     DECLARE
56
          FT : FILE_TYPE;
57
          LC : POSITIVE_COUNT;
58
     BEGIN
59
 
60
          BEGIN
61
               CREATE (FT, OUT_FILE, LEGAL_FILE_NAME);
62
          EXCEPTION
63
               WHEN USE_ERROR =>
64
                    NOT_APPLICABLE ("USE_ERROR RAISED ON TEXT CREATE " &
65
                                    "WITH OUT_FILE MODE");
66
                    RAISE INCOMPLETE;
67
               WHEN NAME_ERROR =>
68
                    NOT_APPLICABLE ("NAME_ERROR RAISED ON TEXT " &
69
                                    "CREATE WITH OUT_FILE MODE");
70
                    RAISE INCOMPLETE;
71
               WHEN OTHERS =>
72
                    FAILED ("UNEXPECTED EXCEPTION RAISED ON " &
73
                            "TEXT CREATE");
74
                    RAISE INCOMPLETE;
75
          END;
76
 
77
          SET_LINE_LENGTH (FT, 5);
78
 
79
          BEGIN
80
               PUT (FT, "STRING");
81
 
82
               IF LINE(FT) /= 2 THEN
83
                    FAILED ("LINE COUNT WAS" & COUNT'IMAGE(LINE(FT)) &
84
                            " INSTEAD OF 2");
85
               END IF;
86
 
87
               IF COL(FT) /= 2 THEN
88
                    FAILED ("COLUMN COUNT WAS" & COUNT'IMAGE(COL(FT)) &
89
                            " INSTEAD OF 2");
90
               END IF;
91
 
92
          EXCEPTION
93
               WHEN LAYOUT_ERROR =>
94
                    FAILED ("LAYOUT_ERROR RAISED - 1");
95
               WHEN OTHERS =>
96
                    FAILED ("UNEXPECTED EXCEPTION RAISED - 1");
97
 
98
          END;
99
 
100
          PUT (FT, "NEW");
101
 
102
          IF LINE(FT) /= 2 THEN
103
               FAILED ("LINE COUNT WRONG - 2; WAS" &
104
                       COUNT'IMAGE(LINE(FT)) &
105
                       " INSTEAD OF 2");
106
          END IF;
107
 
108
          IF COL(FT) /= 5 THEN
109
               FAILED ("COL COUNT WRONG - 2; WAS" &
110
                       COUNT'IMAGE(COL(FT)) &
111
                       " INSTEAD OF 5");
112
          END IF;
113
 
114
          BEGIN
115
               PUT (FT, "STR");
116
               IF LINE (FT) /= 3 THEN
117
                    FAILED ("PUT STRING WHEN IN MIDDLE OF " &
118
                            "LINE DOES NOT HAVE EFFECT OF " &
119
                            "NEW_LINE; LINE COUNT IS" &
120
                            COUNT'IMAGE(LINE(FT)));
121
               END IF;
122
 
123
               IF COL(FT) /= 3 THEN
124
                    FAILED ("COL COUNT WRONG - 3; WAS" &
125
                            COUNT'IMAGE(COL(FT)) &
126
                            " INSTEAD OF 3");
127
               END IF;
128
 
129
          EXCEPTION
130
               WHEN LAYOUT_ERROR =>
131
                    FAILED ("LAYOUT_ERROR RAISED - 2");
132
               WHEN OTHERS =>
133
                    FAILED ("UNEXPECTED EXCEPTION RAISED - 2");
134
          END;
135
 
136
          PUT (FT, "ING");
137
 
138
          IF LINE(FT) /= 3 THEN
139
               FAILED ("LINE COUNT WRONG - 3; WAS" &
140
                       COUNT'IMAGE(LINE(FT)) &
141
                       " INSTEAD OF 3");
142
          END IF;
143
 
144
          IF COL(FT) /= 6 THEN
145
               FAILED ("COL COUNT WRONG - 3;  WAS" &
146
                       COUNT'IMAGE(COL(FT)) &
147
                       " INSTEAD OF 6");
148
          END IF;
149
 
150
          BEGIN
151
               PUT (FT, "");
152
 
153
               IF LINE(FT) /= 3 THEN
154
                    FAILED ("LINE COUNT WRONG - 3; WAS" &
155
                            COUNT'IMAGE(LINE(FT)) &
156
                            " INSTEAD OF 3");
157
               END IF;
158
 
159
               IF COL(FT) /= 6 THEN
160
                    FAILED ("COL COUNT WRONG - 3;  WAS" &
161
                            COUNT'IMAGE(COL(FT)) &
162
                            " INSTEAD OF 6");
163
               END IF;
164
 
165
          EXCEPTION
166
               WHEN LAYOUT_ERROR =>
167
                    FAILED ("LAYOUT_ERROR RAISED - 3");
168
               WHEN OTHERS =>
169
                    FAILED ("UNEXPECTED EXCEPTION RAISED - 3");
170
          END;
171
 
172
          CHECK_FILE (FT,
173
                      "STRIN#" &
174
                      "GNEWS#" &
175
                      "TRING#@%");
176
 
177
          BEGIN
178
               DELETE (FT);
179
          EXCEPTION
180
               WHEN USE_ERROR =>
181
                    NULL;
182
          END;
183
 
184
     EXCEPTION
185
          WHEN INCOMPLETE =>
186
               NULL;
187
 
188
     END;
189
 
190
     RESULT;
191
 
192
END CE3605D;

powered by: WebSVN 2.1.0

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