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

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- CE3705C.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 THE LAST CHARACTER IN A FILE MAY BE READ WITHOUT
27
--     RAISING END_ERROR, AND THAT AFTER THE LAST CHARACTER OF THE
28
--     FILE HAS BEEN READ, ANY ATTEMPT TO READ FURTHER CHARACTERS
29
--     WILL RAISE END_ERROR.
30
 
31
-- APPLICABILITY CRITERIA:
32
--     THIS TEST IS ONLY APPLICABLE TO IMPLEMENTATIONS WHICH SUPPORT
33
--     TEXT FILES.
34
 
35
-- HISTORY:
36
--     JLH 07/18/88  CREATED ORIGINAL TEST.
37
 
38
WITH REPORT; USE REPORT;
39
WITH TEXT_IO; USE TEXT_IO;
40
 
41
PROCEDURE CE3705C IS
42
 
43
     PACKAGE IIO IS NEW INTEGER_IO (INTEGER);
44
     USE IIO;
45
 
46
     FILE : FILE_TYPE;
47
     ITEM : INTEGER;
48
     INCOMPLETE : EXCEPTION;
49
 
50
BEGIN
51
 
52
     TEST ("CE3705C", "CHECK THAT THE LAST CHARACTER IN A FILE MAY " &
53
                      "BE READ WITHOUT RAISING END_ERROR, AND THAT " &
54
                      "AFTER THE LAST CHARACTER OF THE FILE HAS BEEN " &
55
                      "READ, ANY ATTEMPT TO READ FURTHER CHARACTERS " &
56
                      "WILL RAISE END_ERROR");
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 MODE OUT_FILE");
66
                    RAISE INCOMPLETE;
67
               WHEN NAME_ERROR =>
68
                    NOT_APPLICABLE ("NAME_ERROR RAISED ON CREATE " &
69
                                    "WITH MODE OUT_FILE");
70
                    RAISE INCOMPLETE;
71
               WHEN OTHERS =>
72
                    FAILED ("UNEXPECTED EXCEPTION RAISED ON CREATE");
73
                    RAISE INCOMPLETE;
74
          END;
75
 
76
 
77
          PUT (FILE, 2);
78
          PUT (FILE, 3);
79
          NEW_LINE (FILE);
80
          NEW_PAGE (FILE);
81
          PUT (FILE, 5);
82
 
83
          CLOSE (FILE);
84
 
85
          BEGIN
86
               OPEN (FILE, IN_FILE, LEGAL_FILE_NAME);
87
          EXCEPTION
88
               WHEN USE_ERROR =>
89
                    NOT_APPLICABLE ("USE_ERROR RAISED ON OPEN WITH " &
90
                                    "MODE IN_FILE");
91
                    RAISE INCOMPLETE;
92
               WHEN OTHERS =>
93
                    FAILED ("UNEXPECTED EXCEPTION RAISED ON OPEN");
94
                    RAISE INCOMPLETE;
95
          END;
96
 
97
          GET (FILE, ITEM);
98
          GET (FILE, ITEM);
99
 
100
          BEGIN
101
               GET (FILE, ITEM);
102
               IF ITEM /= 5 THEN
103
                    FAILED ("INCORRECT VALUE READ");
104
               END IF;
105
               BEGIN
106
                    GET (FILE, ITEM);
107
                    FAILED ("END_ERROR NOT RAISED AFTER LAST " &
108
                            "CHARACTER OF FILE HAS BEEN READ");
109
               EXCEPTION
110
                    WHEN END_ERROR =>
111
                         NULL;
112
                    WHEN OTHERS =>
113
                         FAILED ("UNEXPECTED EXCEPTION RAISED ON GET");
114
               END;
115
          EXCEPTION
116
               WHEN END_ERROR =>
117
                    FAILED ("END_ERROR RAISED WHEN READING LAST " &
118
                            "CHARACTER OF FILE");
119
               WHEN OTHERS =>
120
                    FAILED ("UNEXPECTED EXCEPTION RAISED ON GET - 2");
121
          END;
122
 
123
          BEGIN
124
               DELETE (FILE);
125
          EXCEPTION
126
               WHEN USE_ERROR =>
127
                    NULL;
128
          END;
129
 
130
     EXCEPTION
131
          WHEN INCOMPLETE =>
132
               NULL;
133
     END;
134
 
135
     RESULT;
136
 
137
END CE3705C;

powered by: WebSVN 2.1.0

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