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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- CE3404C.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 END_OF_LINE RETURNS THE CORRECT VALUE WHEN POSITIONED
27
--     AT THE BEGINNING AND THE END OF A LINE, AND WHEN POSITIONED JUST
28
--     BEFORE THE FILE TERMINATOR.
29
 
30
--          CASE 1)  BOUNDED LINE LENGTH
31
 
32
-- APPLICABILITY CRITERIA:
33
--     THIS TEST IS APPLICABLE ONLY TO IMPLEMENTATIONS WHICH SUPPORT
34
--     TEXT FILES.
35
 
36
-- HISTORY:
37
--     ABW 08/26/82
38
--     SPS 09/17/82
39
--     TBN 11/04/86  REVISED TEST TO OUTPUT A NON_APPLICABLE
40
--                   RESULT WHEN FILES ARE NOT SUPPORTED.
41
--     GMT 09/22/87  REMOVED DEPENDENCE ON RESET AND MOVED THE CHECK
42
--                   FOR UNBOUNDED LINE_LENGTH TO CE3404D.ADA.
43
 
44
WITH REPORT;  USE REPORT;
45
WITH TEXT_IO; USE TEXT_IO;
46
 
47
PROCEDURE CE3404C IS
48
     INCOMPLETE     : EXCEPTION;
49
     MY_FILE        : FILE_TYPE;
50
     ITEM_CHAR      : CHARACTER;
51
     CHAR           : CHARACTER := ('C');
52
     TEN            : POSITIVE_COUNT := POSITIVE_COUNT(IDENT_INT(10));
53
     BLANK_COUNTER  : NATURAL := 0;
54
 
55
BEGIN
56
 
57
     TEST ("CE3404C", "CHECK THAT END_OF_LINE RETURNS THE CORRECT " &
58
                      "VALUE WHEN POSITIONED AT THE BEGINNING " &
59
                      "AND THE END OF A LINE, AND WHEN POSITIONED " &
60
                      "JUST BEFORE THE FILE TERMINATOR");
61
 
62
--   CREATE AND INITIALIZE TEST FILE WITH BOUNDED LINE LENGTH
63
 
64
     BEGIN
65
          CREATE (MY_FILE, OUT_FILE, LEGAL_FILE_NAME);
66
     EXCEPTION
67
          WHEN USE_ERROR =>
68
               NOT_APPLICABLE ("USE_ERROR RAISED ON TEXT CREATE WITH " &
69
                               "OUT_FILE MODE");
70
               RAISE INCOMPLETE;
71
          WHEN NAME_ERROR =>
72
               NOT_APPLICABLE ("NAME_ERROR RAISED ON TEXT CREATE " &
73
                               "WITH OUT_FILE MODE");
74
               RAISE INCOMPLETE;
75
          WHEN OTHERS =>
76
               FAILED ("UNEXPECTED EXCEPTION RAISED ON TEXT CREATE");
77
               RAISE INCOMPLETE;
78
     END;
79
 
80
     SET_LINE_LENGTH (MY_FILE,TEN);
81
 
82
     FOR I IN 1..5 LOOP
83
          PUT (MY_FILE, CHAR);
84
     END LOOP;
85
     NEW_LINE (MY_FILE);
86
     PUT (MY_FILE, 'B');
87
 
88
     CLOSE (MY_FILE);
89
 
90
     BEGIN
91
          OPEN (MY_FILE, IN_FILE, LEGAL_FILE_NAME);
92
     EXCEPTION
93
          WHEN USE_ERROR =>
94
               NOT_APPLICABLE ("USE_ERROR RAISED ON TEXT OPEN WITH " &
95
                               "IN_FILE MODE");
96
               RAISE INCOMPLETE;
97
     END;
98
 
99
--   BEGIN THE TEST
100
 
101
     IF END_OF_LINE (MY_FILE) THEN
102
          FAILED ("END_OF_LINE: INCORRECT VALUE AT FIRST POSITION - 5");
103
     END IF;
104
 
105
     IF COL (MY_FILE) /= 1 THEN
106
          FAILED ("EOL MODIFIED COL NUMBER - 6");
107
     END IF;
108
 
109
     FOR I IN 1..4 LOOP
110
          GET (MY_FILE,ITEM_CHAR);
111
     END LOOP;
112
 
113
     IF END_OF_LINE (MY_FILE) THEN
114
          FAILED ("END_OF_LINE: INCORRECT VALUE AT FIFTH POSITION - 7");
115
     END IF;
116
 
117
     GET (MY_FILE,ITEM_CHAR);
118
 
119
     WHILE NOT END_OF_LINE (MY_FILE) LOOP
120
          GET (MY_FILE, ITEM_CHAR);
121
          IF ITEM_CHAR = ' ' THEN
122
               BLANK_COUNTER := BLANK_COUNTER + 1;
123
          ELSE
124
               FAILED ("STRING WAS PADDED WITH SOMETHING OTHER THAN " &
125
                       "BLANKS - 8");
126
          END IF;
127
     END LOOP;
128
 
129
     IF BLANK_COUNTER > 5 THEN
130
          FAILED ("TOO MANY BLANKS WERE USED FOR PADDING - 9");
131
     END IF;
132
 
133
     IF LINE (MY_FILE) /= 1 THEN
134
          FAILED ("EOL SKIPPED LINE TERMINATOR - 10");
135
     END IF;
136
 
137
     IF NOT END_OF_LINE (MY_FILE) THEN
138
          FAILED ("EOL SKIPPED LINE TERMINATOR - 11");
139
     END IF;
140
 
141
     SKIP_PAGE (MY_FILE);
142
 
143
     IF PAGE (MY_FILE) /= 2 THEN
144
          FAILED ("INCORRECT PAGE NUMBER");
145
     END IF;
146
 
147
     IF NOT END_OF_LINE (MY_FILE) THEN
148
          FAILED ("INCORRECT VALUE WHEN POSITIONED JUST BEFORE FILE " &
149
                  "TERMINATOR");
150
     END IF;
151
 
152
     BEGIN
153
          DELETE (MY_FILE);
154
     EXCEPTION
155
          WHEN USE_ERROR =>
156
               NULL;
157
     END;
158
 
159
     RESULT;
160
 
161
EXCEPTION
162
     WHEN INCOMPLETE =>
163
          RESULT;
164
 
165
END CE3404C;

powered by: WebSVN 2.1.0

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