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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- CE3411A.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 COL RETURNS THE VALUE OF THE CURRENT COLUMN NUMBER.
27
 
28
-- APPLICABILITY CRITERIA:
29
--     THIS TEST IS APPLICABLE ONLY TO IMPLEMENTATIONS WHICH SUPPORT
30
--     TEXT FILES.
31
 
32
-- HISTORY:
33
--     SPS 09/29/82
34
--     JBG 08/30/83
35
--     TBN 11/10/86  REVISED TEST TO OUTPUT A NOT_APPLICABLE
36
--                   RESULT WHEN FILES ARE NOT SUPPORTED.
37
--     JLH 09/02/87  REMOVED DEPENDENCE ON RESET AND CHECKED FOR
38
--                   USE_ERROR ON DELETE.
39
 
40
WITH REPORT;
41
USE REPORT;
42
WITH TEXT_IO;
43
USE TEXT_IO;
44
 
45
PROCEDURE CE3411A IS
46
     INCOMPLETE : EXCEPTION;
47
 
48
BEGIN
49
 
50
     TEST ("CE3411A", "CHECK THAT COL RETURNS THE VALUE OF THE " &
51
                      "CURRENT COLUMN NUMBER");
52
 
53
     DECLARE
54
          FT        : FILE_TYPE;
55
          X         : CHARACTER;
56
          NUM_CHARS : POSITIVE_COUNT;
57
     BEGIN
58
 
59
          BEGIN
60
               CREATE (FT, 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 " &
68
                                    "CREATE WITH OUT_FILE MODE");
69
                    RAISE INCOMPLETE;
70
               WHEN OTHERS =>
71
                    FAILED ("UNEXPECTED EXCEPTION RAISED ON TEXT " &
72
                            "CREATE");
73
                    RAISE INCOMPLETE;
74
          END;
75
 
76
          PUT (FT, "OUTPUT STRING");
77
          IF COL (FT) /= 14 THEN
78
               FAILED ("COL INCORRECT AFTER PUT; IS" &
79
                       COUNT'IMAGE(COL(FT)));
80
          END IF;
81
 
82
          NEW_LINE (FT);
83
          IF COL (FT) /= 1 THEN
84
               FAILED ("COL INCORRECT AFTER NEW_LINE; IS" &
85
                       COUNT'IMAGE(COL(FT)));
86
          END IF;
87
 
88
          PUT (FT, "MORE OUTPUT");
89
          NEW_PAGE (FT);
90
          IF COL (FT) /= 1 THEN
91
               FAILED ("COL INCORRECT AFTER NEW_PAGE; IS" &
92
                       COUNT'IMAGE(COL(FT)));
93
          END IF;
94
 
95
          PUT (FT, "FINAL");
96
 
97
          CLOSE (FT);
98
 
99
          BEGIN
100
               OPEN (FT, IN_FILE, LEGAL_FILE_NAME);
101
          EXCEPTION
102
               WHEN USE_ERROR =>
103
                    NOT_APPLICABLE ("USE_ERROR RAISED ON TEXT OPEN " &
104
                                    "WITH IN_FILE MODE");
105
                    RAISE INCOMPLETE;
106
          END;
107
 
108
          IF COL (FT) /= 1 THEN
109
               FAILED ("COL INCORRECT AFTER REOPEN; IS" &
110
                       COUNT'IMAGE(COL(FT)));
111
          END IF;
112
 
113
          FOR I IN 1 .. 4 LOOP
114
               GET (FT, X);
115
          END LOOP;
116
          IF COL (FT) /= 5 THEN
117
               FAILED ("COL INCORRECT AFTER GET; IS" &
118
                       COUNT'IMAGE(COL(FT)));
119
          END IF;
120
 
121
          NUM_CHARS := COL(FT);
122
          WHILE NOT END_OF_LINE(FT) LOOP
123
               GET (FT, X);
124
               NUM_CHARS := NUM_CHARS + 1;
125
          END LOOP;
126
 
127
          IF COL(FT) /= NUM_CHARS THEN
128
               FAILED ("COL INCORRECT BEFORE END OF LINE; IS" &
129
                       COUNT'IMAGE(COL(FT)));
130
          END IF;
131
 
132
          SKIP_LINE (FT);
133
          IF COL(FT) /= 1 THEN
134
               FAILED ("COL INCORRECT AFTER SKIP_LINE; IS" &
135
                       COUNT'IMAGE(COL(FT)));
136
          END IF;
137
 
138
          SET_COL (FT, 2);
139
          IF COL (FT) /= 2 THEN
140
               FAILED ("COL INCORRECT AFTER SET_COL; IS" &
141
                       COUNT'IMAGE(COL(FT)));
142
          END IF;
143
 
144
          SKIP_PAGE (FT);
145
          IF COL(FT) /= 1 THEN
146
               FAILED ("COL INCORRECT AFTER SKIP_PAGE; IS" &
147
                       COUNT'IMAGE(COL(FT)));
148
          END IF;
149
 
150
          BEGIN
151
               DELETE (FT);
152
          EXCEPTION
153
               WHEN USE_ERROR =>
154
                    NULL;
155
          END;
156
 
157
     END;
158
 
159
     RESULT;
160
 
161
EXCEPTION
162
     WHEN INCOMPLETE =>
163
          RESULT;
164
END CE3411A;

powered by: WebSVN 2.1.0

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