OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- CE3604A.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 GET_LINE MAY BE CALLED TO RETURN AN ENTIRE LINE.  ALSO
27
--     CHECK THAT GET_LINE MAY BE CALLED TO RETURN THE REMAINDER OF A
28
--     PARTLY READ LINE.  ALSO CHECK THAT GET_LINE RETURNS IN THE
29
--     PARAMETER LAST, THE INDEX VALUE OF THE LAST CHARACTER READ.
30
--     WHEN NO CHARACTERS ARE READ, LAST IS ONE LESS THAN ITEM'S LOWER
31
--     BOUND.
32
 
33
-- APPLICABILITY CRITERIA:
34
--     THIS TEST IS APPLICABLE ONLY TO IMPLEMENTATIONS WHICH SUPPORT
35
--     TEXT FILES.
36
 
37
-- HISTORY:
38
--     JLH 09/25/87  COMPLETELY REVISED TEST.
39
 
40
WITH REPORT; USE REPORT;
41
WITH TEXT_IO; USE TEXT_IO;
42
 
43
PROCEDURE CE3604A IS
44
 
45
BEGIN
46
 
47
     TEST ("CE3604A", "CHECK THAT GET_LINE READS LINES APPROPRIATELY " &
48
                      "AND CHECK THAT LAST RETURNS THE CORRECT INDEX " &
49
                      "VALUE");
50
 
51
     DECLARE
52
          FILE : FILE_TYPE;
53
          STR : STRING (1 .. 25);
54
          LAST : NATURAL;
55
          ITEM1 : STRING (2 .. 6);
56
          ITEM2 : STRING (3 .. 6);
57
          CH : CHARACTER;
58
          INCOMPLETE : EXCEPTION;
59
 
60
     BEGIN
61
          BEGIN
62
               CREATE (FILE, OUT_FILE, LEGAL_FILE_NAME);
63
          EXCEPTION
64
               WHEN USE_ERROR =>
65
                    NOT_APPLICABLE ("USE_ERROR RAISED ON TEXT CREATE " &
66
                                    "WITH OUT_FILE MODE");
67
                    RAISE INCOMPLETE;
68
               WHEN NAME_ERROR =>
69
                    NOT_APPLICABLE ("NAME_ERROR RAISED ON TEXT " &
70
                                    "CREATE WITH OUT_FILE MODE");
71
                    RAISE INCOMPLETE;
72
               WHEN OTHERS =>
73
                    FAILED ("UNEXPECTED EXCEPTION RAISED ON TEXT " &
74
                            "CREATE");
75
                    RAISE INCOMPLETE;
76
          END;
77
 
78
          PUT (FILE, "FIRST LINE OF INPUT");
79
          NEW_LINE (FILE);
80
          PUT (FILE, "SECOND LINE OF INPUT");
81
          NEW_LINE (FILE);
82
          PUT (FILE, "THIRD LINE OF INPUT");
83
          NEW_LINE (FILE);
84
          NEW_LINE (FILE);
85
 
86
          CLOSE (FILE);
87
 
88
          BEGIN
89
               OPEN (FILE, IN_FILE, LEGAL_FILE_NAME);
90
          EXCEPTION
91
               WHEN USE_ERROR =>
92
                    NOT_APPLICABLE ("USE_ERROR RAISED ON TEXT OPEN " &
93
                                    "WITH IN_FILE MODE");
94
                    RAISE INCOMPLETE;
95
          END;
96
 
97
          GET_LINE (FILE, STR, LAST);
98
 
99
          BEGIN
100
               IF STR(1..LAST) /= "FIRST LINE OF INPUT" THEN
101
                    FAILED ("GET_LINE - RETURN OF ENTIRE LINE");
102
               END IF;
103
          EXCEPTION
104
               WHEN CONSTRAINT_ERROR =>
105
                    FAILED ("CONSTRAINT_ERROR RAISED AFTER " &
106
                            "GET_LINE - 1");
107
          END;
108
 
109
          GET (FILE, ITEM1);
110
          GET_LINE (FILE, STR, LAST);
111
 
112
          BEGIN
113
               IF STR(1..LAST) /= "D LINE OF INPUT" THEN
114
                    FAILED ("GET_LINE - REMAINDER OF PARTLY READ LINE");
115
               END IF;
116
          EXCEPTION
117
               WHEN CONSTRAINT_ERROR =>
118
                    FAILED ("CONSTRAINT_ERROR RAISED AFTER " &
119
                            "GET_LINE - 2");
120
          END;
121
 
122
          GET_LINE (FILE, ITEM1, LAST);
123
          IF LAST /= 6 THEN
124
               FAILED ("INCORRECT VALUE FOR LAST PARAMETER - 1");
125
          END IF;
126
 
127
          WHILE NOT END_OF_LINE (FILE) LOOP
128
               GET (FILE, CH);
129
          END LOOP;
130
 
131
          GET_LINE (FILE, ITEM1, LAST);
132
          IF LAST /= 1 THEN
133
               FAILED ("INCORRECT VALUE FOR LAST PARAMETER - 2");
134
          END IF;
135
 
136
          IF NOT END_OF_LINE (FILE) THEN
137
               FAILED ("END_OF_LINE NOT TRUE");
138
          END IF;
139
 
140
          GET_LINE (FILE, ITEM2, LAST);
141
          IF LAST /= 2 THEN
142
               FAILED ("INCORRECT VALUE FOR LAST PARAMETER - 3");
143
          END IF;
144
 
145
          BEGIN
146
               DELETE (FILE);
147
          EXCEPTION
148
               WHEN USE_ERROR =>
149
                    NULL;
150
          END;
151
 
152
     EXCEPTION
153
          WHEN INCOMPLETE =>
154
               NULL;
155
 
156
     END;
157
 
158
     RESULT;
159
 
160
END CE3604A;

powered by: WebSVN 2.1.0

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