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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 720 jeremybenn
-- CE3404D.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 2)  UNBOUNDED LINE LENGTH
31
 
32
-- APPLICABILITY CRITERIA:
33
--     THIS TEST IS APPLICABLE ONLY TO IMPLEMENTATIONS WHICH SUPPORT
34
--     TEXT FILES.
35
 
36
-- HISTORY:
37
--     GMT  09/22/87  CREATED ORIGINAL TEST.
38
 
39
WITH REPORT;  USE REPORT;
40
WITH TEXT_IO; USE TEXT_IO;
41
 
42
PROCEDURE CE3404D IS
43
     INCOMPLETE     : EXCEPTION;
44
     MY_FILE        : FILE_TYPE;
45
     ITEM_CHAR      : CHARACTER;
46
     CHAR           : CHARACTER := ('C');
47
     TEN            : POSITIVE_COUNT := POSITIVE_COUNT(IDENT_INT(10));
48
     BLANK_COUNTER  : NATURAL := 0;
49
 
50
BEGIN
51
 
52
     TEST ("CE3404D", "CHECK THAT END_OF_LINE RETURNS THE CORRECT " &
53
                      "VALUE WHEN POSITIONED AT THE BEGINNING AND " &
54
                      "THE END OF A LINE, AND WHEN POSITIONED JUST " &
55
                      "BEFORE THE FILE TERMINATOR");
56
 
57
--   CREATE AND INITIALIZE TEST FILE WITH BOUNDED LINE LENGTH
58
 
59
     BEGIN
60
          CREATE (MY_FILE, OUT_FILE, LEGAL_FILE_NAME);
61
     EXCEPTION
62
          WHEN USE_ERROR =>
63
               NOT_APPLICABLE ("USE_ERROR RAISED ON TEXT CREATE WITH " &
64
                               "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
     FOR I IN 1..5 LOOP
76
          PUT (MY_FILE, CHAR);
77
     END LOOP;
78
     NEW_LINE (MY_FILE);
79
     PUT (MY_FILE, 'B');
80
 
81
     CLOSE (MY_FILE);
82
 
83
     BEGIN
84
          OPEN (MY_FILE, IN_FILE, LEGAL_FILE_NAME);
85
     EXCEPTION
86
          WHEN USE_ERROR =>
87
               NOT_APPLICABLE ("USE_ERROR RAISED ON TEXT OPEN WITH " &
88
                               "IN_FILE MODE");
89
               RAISE INCOMPLETE;
90
     END;
91
 
92
--   BEGIN THE TEST
93
 
94
     IF END_OF_LINE (MY_FILE) THEN
95
          FAILED ("END_OF_LINE: INCORRECT VALUE AT FIRST POSITION - 5");
96
     END IF;
97
 
98
     IF COL (MY_FILE) /= 1 THEN
99
          FAILED ("EOL MODIFIED COL NUMBER - 6");
100
     END IF;
101
 
102
     FOR I IN 1..4 LOOP
103
          GET (MY_FILE,ITEM_CHAR);
104
     END LOOP;
105
 
106
     IF END_OF_LINE (MY_FILE) THEN
107
          FAILED ("END_OF_LINE: INCORRECT VALUE AT FIFTH POSITION - 7");
108
     END IF;
109
 
110
     GET (MY_FILE,ITEM_CHAR);
111
 
112
     WHILE NOT END_OF_LINE (MY_FILE) LOOP
113
          GET (MY_FILE, ITEM_CHAR);
114
          IF ITEM_CHAR = ' ' THEN
115
               FAILED ("STRING WAS PADDED WITH SOMETHING OTHER THAN " &
116
                       "BLANKS - 8");
117
          END IF;
118
     END LOOP;
119
 
120
     IF LINE (MY_FILE) /= 1 THEN
121
          FAILED ("EOL SKIPPED LINE TERMINATOR - 10");
122
     END IF;
123
 
124
     IF NOT END_OF_LINE (MY_FILE) THEN
125
          FAILED ("EOL SKIPPED LINE TERMINATOR - 11");
126
     END IF;
127
 
128
     SKIP_PAGE (MY_FILE);
129
 
130
     IF PAGE (MY_FILE) /= 2 THEN
131
          FAILED ("INCORRECT PAGE NUMBER");
132
     END IF;
133
 
134
     IF NOT END_OF_LINE (MY_FILE) THEN
135
          FAILED ("INCORRECT VALUE WHEN POSITIONED JUST BEFORE " &
136
                  "TERMINATOR");
137
     END IF;
138
 
139
     BEGIN
140
          DELETE (MY_FILE);
141
     EXCEPTION
142
          WHEN USE_ERROR =>
143
               NULL;
144
     END;
145
 
146
     RESULT;
147
 
148
EXCEPTION
149
     WHEN INCOMPLETE =>
150
          RESULT;
151
 
152
END CE3404D;

powered by: WebSVN 2.1.0

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