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

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

Line No. Rev Author Line
1 149 jeremybenn
-- CE2102C.TST
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 NAME_ERROR IS RAISED WHEN THE NAME STRING DOES NOT
27
--     IDENTIFY AN EXTERNAL FILE FOR AN OPEN OR CREATE OPERATION FOR
28
--     SEQUENTIAL_IO.
29
 
30
-- APPLICABILITY CRITERIA:
31
--     THIS TEST IS APPLICABLE ONLY TO IMPLEMENTATIONS WHICH SUPPORT
32
--     CREATE WITH OUT_FILE MODE FOR SEQUENTIAL TEMPORARY FILES.
33
 
34
-- HISTORY:
35
--     SPS  08/26/82
36
--     JBG  02/22/84  CHANGED TO .ADA TEST.
37
--     JRK  11/30/84  CHANGED TO .TST TEST.
38
--     TBN  02/12/86  SPLIT TEST.  PUT DIRECT_IO INTO CE2102H-B.TST.
39
--     SPW  08/25/87  CORRECTED EXCEPTION HANDLING.
40
--     BCB  09/28/88  ADDED EXCEPTION HANDLERS FOR DELETE STATEMENTS.
41
 
42
WITH REPORT; USE REPORT;
43
WITH SEQUENTIAL_IO;
44
 
45
PROCEDURE CE2102C IS
46
 
47
     NAME1 : CONSTANT STRING := "$ILLEGAL_EXTERNAL_FILE_NAME1";
48
               -- AN ILLEGAL EXTERNAL FILE NAME THAT EITHER (PREFERABLY)
49
               -- CONTAINS INVALID CHARACTERS OR IS TOO LONG.
50
 
51
     NAME2 : CONSTANT STRING := "$ILLEGAL_EXTERNAL_FILE_NAME2";
52
               -- AN ILLEGAL EXTERNAL FILE NAME THAT EITHER (PREFERABLY)
53
               -- CONTAINS A WILD CARD CHARACTER OR IS TOO LONG.
54
 
55
BEGIN
56
 
57
     TEST ("CE2102C", "CHECK THAT NAME_ERROR IS RAISED BY OPEN AND " &
58
                      "CREATE WHEN NAME DOES NOT IDENTIFY AN " &
59
                      "EXTERNAL FILE FOR SEQUENTIAL_IO");
60
 
61
     DECLARE
62
          PACKAGE SEQ IS NEW SEQUENTIAL_IO (INTEGER);
63
          USE SEQ;
64
          FILE1 : FILE_TYPE;
65
          INCOMPLETE : EXCEPTION;
66
     BEGIN
67
 
68
-- CHECK WHETHER CREATE RAISES USE_ERROR
69
 
70
          BEGIN
71
               CREATE (FILE1);
72
          EXCEPTION
73
               WHEN USE_ERROR =>
74
                    NOT_APPLICABLE ("TEMPORARY SEQUENTIAL FILES WITH " &
75
                                    "OUT_FILE MODE NOT SUPPORTED");
76
                    RAISE INCOMPLETE;
77
               WHEN OTHERS =>
78
                    FAILED ("UNEXPECTED EXCEPTION RAISED FOR CREATE");
79
                    RAISE INCOMPLETE;
80
          END;
81
          CLOSE (FILE1);
82
 
83
          BEGIN
84
               CREATE(FILE1, OUT_FILE, NAME1);
85
               FAILED ("NAME_ERROR NOT RAISED - CREATE SEQ 1");
86
               BEGIN
87
                    DELETE (FILE1);
88
               EXCEPTION
89
                    WHEN USE_ERROR =>
90
                         NULL;
91
               END;
92
          EXCEPTION
93
               WHEN NAME_ERROR =>
94
                    NULL;
95
               WHEN USE_ERROR =>
96
                    FAILED ("USE_ERROR RAISED - CREATE SEQ 1");
97
               WHEN OTHERS =>
98
                    FAILED ("WRONG EXCEPTION RAISED - CREATE SEQ 1");
99
          END;
100
 
101
          BEGIN
102
               CREATE (FILE1, OUT_FILE, NAME2);
103
               FAILED("NAME_ERROR NOT RAISED - CREATE SEQ 2");
104
               BEGIN
105
                    DELETE (FILE1);
106
               EXCEPTION
107
                    WHEN USE_ERROR =>
108
                         NULL;
109
               END;
110
          EXCEPTION
111
               WHEN NAME_ERROR =>
112
                    NULL;
113
               WHEN USE_ERROR =>
114
                    FAILED ("USE_ERROR RAISED - CREATE SEQ 2");
115
               WHEN OTHERS =>
116
                    FAILED ("WRONG EXCEPTION RAISED - CREATE SEQ 2");
117
          END;
118
 
119
-- CHECK WHETHER OPEN RAISES NAME_ERROR IN THE CASE OF A LEGAL FILE
120
-- NAME BUT A NON-EXISTENT FILE.
121
 
122
          BEGIN
123
               OPEN (FILE1, IN_FILE, LEGAL_FILE_NAME);
124
               FAILED("NAME_ERROR NOT RAISED - OPEN SEQ");
125
          EXCEPTION
126
               WHEN NAME_ERROR =>
127
                    NULL;
128
               WHEN USE_ERROR =>
129
                    FAILED ("USE_ERROR RAISED - OPEN SEQ");
130
               WHEN OTHERS =>
131
                    FAILED ("WRONG EXCEPTION RAISED - OPEN SEQ");
132
          END;
133
 
134
     EXCEPTION
135
          WHEN INCOMPLETE =>
136
               NULL;
137
     END;
138
 
139
     RESULT;
140
END CE2102C;

powered by: WebSVN 2.1.0

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