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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [ce/] [ce2206a.ada] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- CE2206A.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 READ FOR A SEQUENTIAL FILE RAISES END_ERROR WHEN
27
--     THERE ARE NO MORE ELEMENTS THAT CAN BE READ FROM THE GIVEN
28
--     FILE.  ALSO CHECK THAT END_OF_FILE CORRECTLY DETECTS THE END
29
--     OF A SEQUENTIAL FILE.
30
 
31
-- APPLICABILITY CRITERIA:
32
--     THIS TEST IS ONLY APPLICABLE TO IMPLEMENTATIONS WHICH SUPPORT
33
--     SEQUENTIAL FILES.
34
 
35
-- HISTORY:
36
--     JLH 08/22/88  CREATED ORIGINAL TEST.
37
 
38
WITH REPORT; USE REPORT;
39
WITH SEQUENTIAL_IO;
40
 
41
PROCEDURE CE2206A IS
42
 
43
     PACKAGE SEQ_IO IS NEW SEQUENTIAL_IO (CHARACTER);
44
     USE SEQ_IO;
45
 
46
     FILE : FILE_TYPE;
47
     ITEM : CHARACTER;
48
     INCOMPLETE : EXCEPTION;
49
 
50
BEGIN
51
 
52
     TEST ("CE2206A", "CHECK THAT READ FOR A SEQUENTIAL FILE RAISES " &
53
                      "END_ERROR WHEN THERE ARE NO MORE ELEMENTS " &
54
                      "THAT CAN BE READ FROM THE GIVEN FILE.  ALSO " &
55
                      "CHECK THAT END_OF_FILE CORRECTLY DETECTS THE " &
56
                      "END OF A SEQUENTIAL FILE");
57
 
58
     BEGIN
59
 
60
          BEGIN
61
               CREATE (FILE, OUT_FILE, LEGAL_FILE_NAME);
62
          EXCEPTION
63
               WHEN USE_ERROR =>
64
                    NOT_APPLICABLE ("USE_ERROR RAISED ON CREATE " &
65
                                    "WITH OUT_FILE MODE");
66
                    RAISE INCOMPLETE;
67
               WHEN NAME_ERROR =>
68
                    NOT_APPLICABLE ("NAME_ERROR RAISED ON CREATE " &
69
                                    "WITH OUT_FILE MODE");
70
                    RAISE INCOMPLETE;
71
               WHEN OTHERS =>
72
                    FAILED ("UNEXPECTED EXCEPTION RAISED ON CREATE");
73
                    RAISE INCOMPLETE;
74
          END;
75
 
76
          WRITE (FILE, 'A');
77
          WRITE (FILE, 'B');
78
 
79
          CLOSE (FILE);
80
 
81
          BEGIN
82
               OPEN (FILE, IN_FILE, LEGAL_FILE_NAME);
83
          EXCEPTION
84
               WHEN USE_ERROR =>
85
                    NOT_APPLICABLE ("USE_ERROR RAISED ON OPEN WITH " &
86
                                    "MODE IN_FILE");
87
                    RAISE INCOMPLETE;
88
               WHEN OTHERS =>
89
                    FAILED ("UNEXPECTED EXCEPTION RAISED ON OPEN");
90
                    RAISE INCOMPLETE;
91
          END;
92
 
93
          READ (FILE, ITEM);
94
          IF ITEM /= 'A' THEN
95
               FAILED ("INCORRECT VALUE READ");
96
          END IF;
97
 
98
          IF END_OF_FILE (FILE) THEN
99
               FAILED ("END_OF_FILE NOT DETECTED CORRECTLY - 1");
100
          END IF;
101
 
102
          READ (FILE, ITEM);
103
 
104
          IF NOT END_OF_FILE (FILE) THEN
105
               FAILED ("END_OF_FILE NOT DETECTED CORRECTLY - 2");
106
          END IF;
107
 
108
          BEGIN
109
               READ (FILE, ITEM);
110
               FAILED ("END_ERROR NOT RAISED FOR READ");
111
          EXCEPTION
112
               WHEN END_ERROR =>
113
                    NULL;
114
               WHEN OTHERS =>
115
                    FAILED ("UNEXPECTED EXCEPTION RAISED ON READ");
116
          END;
117
 
118
          BEGIN
119
               DELETE (FILE);
120
          EXCEPTION
121
               WHEN USE_ERROR =>
122
                    NULL;
123
          END;
124
 
125
     EXCEPTION
126
          WHEN INCOMPLETE =>
127
               NULL;
128
 
129
     END;
130
 
131
     RESULT;
132
 
133
END CE2206A;

powered by: WebSVN 2.1.0

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