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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [ce/] [ce3301a.ada] - Blame information for rev 294

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- CE3301A.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 WHEN THE LINE AND PAGE LENGTH ARE NONZERO, LINE AND
27
--     PAGE TERMINATORS ARE OUTPUT AT THE APPROPRIATE POINTS.
28
 
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.
37
 
38
WITH REPORT;
39
USE REPORT;
40
WITH TEXT_IO;
41
USE TEXT_IO;
42
 
43
PROCEDURE CE3301A IS
44
 
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);
52
 
53
BEGIN
54
 
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");
58
 
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;
74
 
75
     IF LINE_LENGTH (FILE) /= UNBOUNDED THEN
76
          FAILED ("LINE LENGTH NOT INITIALLY UNBOUNDED");
77
     END IF;
78
 
79
     IF PAGE_LENGTH (FILE) /= UNBOUNDED THEN
80
          FAILED ("PAGE LENGTH NOT INITIALLY UNBOUNDED");
81
     END IF;
82
 
83
     SET_LINE_LENGTH (FILE,TEN);
84
     SET_PAGE_LENGTH (FILE,TWO);
85
 
86
     FOR I IN 1 .. 30 LOOP
87
          PUT (FILE,'C');
88
     END LOOP;
89
 
90
     IF PAGE (FILE) /= 2 AND LINE (FILE) /= 1 THEN
91
          FAILED ("LINE AND PAGE LENGTHS WERE NOT BOUND " &
92
                  "CORRECTLY");
93
     END IF;
94
 
95
     SET_LINE_LENGTH (FILE, TWO);
96
     SET_PAGE_LENGTH (FILE, THREE);
97
     PUT (FILE, "DDDDDDD");
98
 
99
     CLOSE (FILE);
100
 
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;
109
 
110
     GET (FILE, ITEM1);
111
 
112
     IF NOT (END_OF_LINE (FILE)) THEN
113
          FAILED ("INCORRECT VALUE BEFORE LINE TERMINATOR");
114
     END IF;
115
 
116
     IF END_OF_PAGE (FILE) THEN
117
          FAILED ("PAGE TERMINATOR OUTPUT AT INAPPROPRIATE POINT");
118
     END IF;
119
 
120
     GET (FILE, ITEM1);
121
 
122
     IF ITEM1 /= "CCCCCCCCCC" THEN
123
          FAILED ("INCORRECT VALUE READ");
124
     END IF;
125
 
126
     IF NOT (END_OF_LINE(FILE)) THEN
127
          FAILED ("INCORRECT VALUE BEFORE LINE TERMINATOR");
128
     END IF;
129
 
130
     IF NOT (END_OF_PAGE(FILE)) THEN
131
          FAILED ("INCORRECT VALUE BEFORE PAGE TERMINATOR");
132
     END IF;
133
 
134
     GET (FILE, ITEM1);
135
     GET (FILE, ITEM2);
136
 
137
     IF ITEM2 /= "DD" THEN
138
          FAILED ("INCORRECT VALUE READ");
139
     END IF;
140
 
141
     IF NOT (END_OF_LINE(FILE)) THEN
142
          FAILED ("INCORRECT VALUE BEFORE LINE TERMINATOR");
143
     END IF;
144
 
145
     IF END_OF_PAGE (FILE) THEN
146
          FAILED ("PAGE TERMINATOR OUTPUT AT INAPPROPRIATE POINT");
147
     END IF;
148
 
149
     GET (FILE, ITEM2);
150
 
151
     IF ITEM2 /= "DD" THEN
152
          FAILED ("INCORRECT VALUE READ");
153
     END IF;
154
 
155
     IF NOT (END_OF_LINE(FILE)) THEN
156
          FAILED ("INCORRECT VALUE BEFORE LINE TERMINATOR");
157
     END IF;
158
 
159
     IF NOT (END_OF_PAGE(FILE)) THEN
160
          FAILED ("INCORRECT VALUE BEFORE PAGE TERMINATOR");
161
     END IF;
162
 
163
     BEGIN
164
          DELETE (FILE);
165
     EXCEPTION
166
          WHEN USE_ERROR =>
167
               NULL;
168
     END;
169
 
170
     RESULT;
171
 
172
EXCEPTION
173
     WHEN INCOMPLETE =>
174
          RESULT;
175
 
176
END CE3301A;

powered by: WebSVN 2.1.0

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