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

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

Line No. Rev Author Line
1 149 jeremybenn
-- CE2102A.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 TO SEE THAT STATUS_ERROR IS RAISED WHEN PERFORMING ILLEGAL
27
--     OPERATIONS ON OPENED OR UNOPENED FILES OF TYPE SEQUENTIAL_IO.
28
 
29
--          A) OPENED FILES
30
 
31
-- APPLICABILITY CRITERIA:
32
--     THIS TEST IS APPLICABLE ONLY TO IMPLEMENTATIONS WHICH SUPPORT
33
--     CREATE WITH OUT_FILE MODE FOR SEQUENTIAL FILES.
34
 
35
-- HISTORY:
36
--     DLD 08/10/82
37
--     JBG 02/22/84
38
--     SPW 07/29/87  SPLIT CASE FOR UNOPENED FILES INTO CE2102L.ADA.
39
 
40
WITH REPORT; USE REPORT;
41
WITH SEQUENTIAL_IO;
42
 
43
PROCEDURE CE2102A IS
44
 
45
     PACKAGE SEQ_IO IS NEW SEQUENTIAL_IO(INTEGER);
46
     USE SEQ_IO;
47
     TEST_FILE_ONE : SEQ_IO.FILE_TYPE;
48
 
49
BEGIN
50
 
51
     TEST ("CE2102A", "CHECK THAT STATUS_ERROR IS RAISED WHEN " &
52
                      "PERFORMING ILLEGAL OPERATIONS ON OPENED FILES " &
53
                      "OF TYPE SEQUENTIAL_IO");
54
 
55
     BEGIN
56
          CREATE (TEST_FILE_ONE, OUT_FILE, LEGAL_FILE_NAME);
57
 
58
-- CHECK THAT OPEN STATEMENT RAISES EXCEPTION WHEN FILE IS ALREADY OPEN
59
 
60
          BEGIN
61
               OPEN (TEST_FILE_ONE, OUT_FILE, LEGAL_FILE_NAME);
62
               FAILED ("STATUS_ERROR NOT RAISED WHEN FILE IS " &
63
                       "ALREADY OPEN - 1");
64
          EXCEPTION
65
               WHEN STATUS_ERROR =>
66
                    NULL;
67
               WHEN OTHERS =>
68
                    FAILED ("WRONG EXCEPTION RAISED ON OPEN - 1");
69
          END;
70
 
71
          BEGIN
72
               OPEN (TEST_FILE_ONE, IN_FILE, LEGAL_FILE_NAME);
73
               FAILED ("STATUS_ERROR NOT RAISED WHEN FILE IS " &
74
                       "ALREADY OPEN - 2");
75
          EXCEPTION
76
               WHEN STATUS_ERROR =>
77
                    NULL;
78
               WHEN OTHERS =>
79
                    FAILED ("WRONG EXCEPTION RAISED ON OPEN - 2");
80
          END;
81
 
82
-- CHECK THAT CREATE STATEMENT RAISES EXCEPTION WHEN FILE
83
-- IS ALREADY OPEN
84
 
85
          BEGIN
86
               CREATE (TEST_FILE_ONE, IN_FILE, LEGAL_FILE_NAME);
87
               FAILED ("STATUS_ERROR NOT RAISED WHEN AN OPEN " &
88
                       "FILE IS USED IN A CREATE - 1");
89
          EXCEPTION
90
               WHEN STATUS_ERROR =>
91
                    NULL;
92
               WHEN OTHERS =>
93
                    FAILED ("WRONG EXCEPTION RAISED ON CREATE - 1");
94
          END;
95
 
96
          BEGIN
97
               CREATE (TEST_FILE_ONE, OUT_FILE, LEGAL_FILE_NAME);
98
               FAILED ("STATUS_ERROR NOT RAISED WHEN AN OPEN " &
99
                       "FILE IS USED IN A CREATE - 2");
100
          EXCEPTION
101
               WHEN STATUS_ERROR =>
102
                    NULL;
103
               WHEN OTHERS =>
104
                    FAILED ("WRONG EXCEPTION RAISED ON CREATE - 2");
105
          END;
106
 
107
--DELETE TEST FILE
108
 
109
          BEGIN
110
               DELETE (TEST_FILE_ONE);
111
          EXCEPTION
112
               WHEN USE_ERROR =>
113
                    COMMENT ("DELETION OF EXTERNAL FILE APPEARS NOT " &
114
                             "TO BE SUPPORTED");
115
 
116
               WHEN OTHERS =>
117
                    FAILED ("UNEXPECTED EXCEPTION RAISED " &
118
                            "FOR DELETE");
119
          END;
120
 
121
     EXCEPTION
122
          WHEN USE_ERROR =>
123
               NOT_APPLICABLE ("USE_ERROR RAISED FOR CREATE " &
124
                               "WITH OUT_FILE MODE");
125
          WHEN NAME_ERROR =>
126
               NOT_APPLICABLE ("NAME_ERROR RAISED FOR CREATE " &
127
                               "WITH OUT_FILE MODE");
128
          WHEN OTHERS =>
129
               FAILED ("OTHER EXCEPTION RAISED FOR CREATE");
130
     END;
131
 
132
     RESULT;
133
END CE2102A;

powered by: WebSVN 2.1.0

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