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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- CE3403F.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 SKIP_LINE RAISES END_ERROR IF AN ATTEMPT IS
27
--     MADE TO SKIP A FILE TERMINATOR.
28
 
29
-- APPLICABILITY CRITERIA:
30
--     THIS TEST IS APPLICABLE ONLY TO IMPLEMENTATIONS WHICH
31
--     SUPPORT TEXT FILES.
32
 
33
-- HISTORY:
34
--     ABW 08/26/82
35
--     SPS 11/11/82
36
--     SPS 12/14/82
37
--     TBN 11/04/86  REVISED TEST TO OUTPUT A NON_APPLICABLE
38
--                   RESULT WHEN FILES ARE NOT SUPPORTED.
39
--     DWC 09/09/87  REVISED TEST TO USE A FILE NAME, REMOVED
40
--                   DEPENDENCE ON RESET, AND ADDED ATTEMPT TO
41
--                   DELETE THE FILE.
42
 
43
WITH REPORT;
44
USE REPORT;
45
WITH TEXT_IO;
46
USE TEXT_IO;
47
 
48
PROCEDURE CE3403F IS
49
 
50
     INCOMPLETE : EXCEPTION;
51
     FILE : FILE_TYPE;
52
     CHAR : CHARACTER := ('C');
53
     ONE : POSITIVE_COUNT := POSITIVE_COUNT(IDENT_INT (1));
54
     TWO : POSITIVE_COUNT := POSITIVE_COUNT(IDENT_INT (2));
55
 
56
BEGIN
57
     TEST ("CE3403F" , "CHECK THAT SKIP_LINE RAISES END_ERROR " &
58
                       "IF AN ATTEMPT IS MADE TO SKIP A FILE " &
59
                       "TERMINATOR");
60
 
61
     BEGIN
62
          CREATE (FILE, OUT_FILE, LEGAL_FILE_NAME);
63
     EXCEPTION
64
          WHEN USE_ERROR =>
65
               NOT_APPLICABLE ("USE_ERROR RAISED; TEXT CREATE " &
66
                               "WITH OUT_FILE MODE");
67
               RAISE INCOMPLETE;
68
          WHEN NAME_ERROR =>
69
               NOT_APPLICABLE ("NAME_ERROR RAISED; TEXT CREATE " &
70
                               "WITH OUT_FILE MODE");
71
               RAISE INCOMPLETE;
72
          WHEN OTHERS =>
73
               FAILED ("UNEXPECTED EXCEPTION RAISED; TEXT CREATE");
74
               RAISE INCOMPLETE;
75
     END;
76
 
77
     FOR I IN 1..3
78
     LOOP
79
          PUT (FILE,CHAR);
80
     END LOOP;
81
 
82
      CLOSE (FILE);
83
 
84
     BEGIN
85
           OPEN (FILE, IN_FILE, LEGAL_FILE_NAME);
86
     EXCEPTION
87
          WHEN USE_ERROR =>
88
               NOT_APPLICABLE ("USE_ERROR RAISED; TEXT OPEN " &
89
                               "FOR IN_FILE MODE");
90
               RAISE INCOMPLETE;
91
     END;
92
 
93
     BEGIN
94
          GET (FILE, CHAR);
95
          IF CHAR /= 'C' THEN
96
               FAILED ("INCORRECT VALUE READ");
97
          END IF;
98
 
99
          SKIP_LINE (FILE);
100
          SKIP_LINE (FILE);
101
          FAILED ("END_ERROR NOT RAISED - 1");
102
     EXCEPTION
103
          WHEN END_ERROR =>
104
 
105
               IF COL (FILE) /= ONE THEN
106
                    FAILED ("COL NOT RESET CORRECTLY");
107
               END IF;
108
 
109
               IF NOT END_OF_FILE (FILE) THEN
110
                    FAILED ("NOT POSITIONED AT END OF FILE");
111
               END IF;
112
 
113
               IF PAGE (FILE) /= TWO THEN
114
                    FAILED ("PAGE NOT INCREMENTED");
115
               END IF;
116
 
117
               IF LINE (FILE) /= ONE THEN
118
                    FAILED ("LINE NOT RESET CORRECTLY");
119
               END IF;
120
 
121
               IF NOT END_OF_LINE (FILE) THEN
122
                    FAILED ("EOL FALSE AT FILE TERMINATOR");
123
               END IF;
124
 
125
               IF NOT END_OF_PAGE (FILE) THEN
126
                    FAILED ("EOP FALSE AT FILE TERMINATOR");
127
               END IF;
128
 
129
               BEGIN
130
                    SKIP_LINE (FILE);
131
                    FAILED ("END_ERROR NOT RAISED - 2");
132
               EXCEPTION
133
                    WHEN END_ERROR =>
134
                         NULL;
135
                    WHEN OTHERS =>
136
                         FAILED ("UNEXPECTED EXCEPTION RAISED - 1");
137
               END;
138
 
139
          WHEN OTHERS =>
140
               FAILED ("UNEXPECTED EXCEPTION RAISED - 2");
141
     END;
142
 
143
     BEGIN
144
          DELETE (FILE);
145
     EXCEPTION
146
          WHEN USE_ERROR =>
147
               NULL;
148
     END;
149
 
150
     RESULT;
151
 
152
EXCEPTION
153
     WHEN INCOMPLETE =>
154
          RESULT;
155
 
156
END CE3403F;

powered by: WebSVN 2.1.0

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