Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / ada / acats / tests / ce / ce3301a.ada
blob4766cb9c0a6ac939dae666038701da40e42158d9
1 -- CE3301A.ADA
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.
16 -- DISCLAIMER
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 WHEN THE LINE AND PAGE LENGTH ARE NONZERO, LINE AND
27 -- PAGE TERMINATORS ARE OUTPUT AT THE APPROPRIATE POINTS.
29 -- HISTORY:
30 -- ABW 08/26/82
31 -- SPS 09/22/82
32 -- SPS 11/15/82
33 -- TBN 11/04/86 REVISED TEST TO OUTPUT A NOT_APPLICABLE
34 -- RESULT WHEN FILES ARE NOT SUPPORTED.
35 -- JLH 08/27/87 COMPLETELY REVISED TEST.
36 -- LDC 05/26/88 ADDED "FILE" PARAMETERS.
38 WITH REPORT;
39 USE REPORT;
40 WITH TEXT_IO;
41 USE TEXT_IO;
43 PROCEDURE CE3301A IS
45 INCOMPLETE : EXCEPTION;
46 FILE : FILE_TYPE;
47 TWO : CONSTANT COUNT := COUNT(IDENT_INT(2));
48 TEN : CONSTANT COUNT := COUNT(IDENT_INT(10));
49 THREE : CONSTANT COUNT := COUNT(IDENT_INT(3));
50 ITEM1 : STRING (1..10);
51 ITEM2 : STRING (1..2);
53 BEGIN
55 TEST ("CE3301A", "CHECK THAT WHEN THE LINE AND PAGE LENGTH ARE " &
56 "NONZERO, LINE AND PAGE TERMINATORS ARE " &
57 "OUTPUT AT THE APPROPRIATE POINTS");
59 BEGIN
60 CREATE (FILE, OUT_FILE, LEGAL_FILE_NAME);
61 EXCEPTION
62 WHEN USE_ERROR =>
63 NOT_APPLICABLE ("USE_ERROR RAISED ON TEXT CREATE " &
64 "WITH OUT_FILE MODE");
65 RAISE INCOMPLETE;
66 WHEN NAME_ERROR =>
67 NOT_APPLICABLE ("NAME_ERROR RAISED ON TEXT CREATE " &
68 "WITH OUT_FILE MODE");
69 RAISE INCOMPLETE;
70 WHEN OTHERS =>
71 FAILED ("UNEXPECTED EXCEPTION RAISED ON TEXT CREATE");
72 RAISE INCOMPLETE;
73 END;
75 IF LINE_LENGTH (FILE) /= UNBOUNDED THEN
76 FAILED ("LINE LENGTH NOT INITIALLY UNBOUNDED");
77 END IF;
79 IF PAGE_LENGTH (FILE) /= UNBOUNDED THEN
80 FAILED ("PAGE LENGTH NOT INITIALLY UNBOUNDED");
81 END IF;
83 SET_LINE_LENGTH (FILE,TEN);
84 SET_PAGE_LENGTH (FILE,TWO);
86 FOR I IN 1 .. 30 LOOP
87 PUT (FILE,'C');
88 END LOOP;
90 IF PAGE (FILE) /= 2 AND LINE (FILE) /= 1 THEN
91 FAILED ("LINE AND PAGE LENGTHS WERE NOT BOUND " &
92 "CORRECTLY");
93 END IF;
95 SET_LINE_LENGTH (FILE, TWO);
96 SET_PAGE_LENGTH (FILE, THREE);
97 PUT (FILE, "DDDDDDD");
99 CLOSE (FILE);
101 BEGIN
102 OPEN (FILE, IN_FILE, LEGAL_FILE_NAME);
103 EXCEPTION
104 WHEN USE_ERROR =>
105 NOT_APPLICABLE ("USE_ERROR RAISED ON TEXT OPEN WITH " &
106 "IN_FILE MODE");
107 RAISE INCOMPLETE;
108 END;
110 GET (FILE, ITEM1);
112 IF NOT (END_OF_LINE (FILE)) THEN
113 FAILED ("INCORRECT VALUE BEFORE LINE TERMINATOR");
114 END IF;
116 IF END_OF_PAGE (FILE) THEN
117 FAILED ("PAGE TERMINATOR OUTPUT AT INAPPROPRIATE POINT");
118 END IF;
120 GET (FILE, ITEM1);
122 IF ITEM1 /= "CCCCCCCCCC" THEN
123 FAILED ("INCORRECT VALUE READ");
124 END IF;
126 IF NOT (END_OF_LINE(FILE)) THEN
127 FAILED ("INCORRECT VALUE BEFORE LINE TERMINATOR");
128 END IF;
130 IF NOT (END_OF_PAGE(FILE)) THEN
131 FAILED ("INCORRECT VALUE BEFORE PAGE TERMINATOR");
132 END IF;
134 GET (FILE, ITEM1);
135 GET (FILE, ITEM2);
137 IF ITEM2 /= "DD" THEN
138 FAILED ("INCORRECT VALUE READ");
139 END IF;
141 IF NOT (END_OF_LINE(FILE)) THEN
142 FAILED ("INCORRECT VALUE BEFORE LINE TERMINATOR");
143 END IF;
145 IF END_OF_PAGE (FILE) THEN
146 FAILED ("PAGE TERMINATOR OUTPUT AT INAPPROPRIATE POINT");
147 END IF;
149 GET (FILE, ITEM2);
151 IF ITEM2 /= "DD" THEN
152 FAILED ("INCORRECT VALUE READ");
153 END IF;
155 IF NOT (END_OF_LINE(FILE)) THEN
156 FAILED ("INCORRECT VALUE BEFORE LINE TERMINATOR");
157 END IF;
159 IF NOT (END_OF_PAGE(FILE)) THEN
160 FAILED ("INCORRECT VALUE BEFORE PAGE TERMINATOR");
161 END IF;
163 BEGIN
164 DELETE (FILE);
165 EXCEPTION
166 WHEN USE_ERROR =>
167 NULL;
168 END;
170 RESULT;
172 EXCEPTION
173 WHEN INCOMPLETE =>
174 RESULT;
176 END CE3301A;