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/] [ce2204a.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
-- CE2204A.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 WRITE IS FORBIDDEN FOR SEQUENTIAL FILES OF
27
--     MODE IN_FILE.
28
 
29
--          A)  CHECK NON-TEMPORARY FILES.
30
 
31
-- APPLICABILITY CRITERIA:
32
--     THIS TEST IS APPLICABLE ONLY TO IMPLEMENTATIONS WHICH SUPPORT
33
--     SEQUENTIAL FILES.
34
 
35
-- HISTORY:
36
--     DLD 08/17/82
37
--     SPS 08/24/82
38
--     SPS 11/09/82
39
--     JBG 02/22/84  CHANGE TO .ADA TEST.
40
--     JBG 03/30/84
41
--     TBN 11/04/86  REVISED TEST TO OUTPUT A NON_APPLICABLE
42
--                   RESULT WHEN FILES ARE NOT SUPPORTED.
43
--     GMT 07/27/87  SPLIT THIS TEST BY MOVING THE CODE FOR CHECKING
44
--                   TEMPORARY FILES INTO CE2204C.ADA.
45
 
46
WITH REPORT; USE REPORT;
47
WITH SEQUENTIAL_IO;
48
 
49
PROCEDURE CE2204A IS
50
     INCOMPLETE : EXCEPTION;
51
BEGIN
52
     TEST ("CE2204A", "CHECK THAT MODE_ERROR IS RAISED BY WRITE " &
53
                      "WHEN THE MODE IS IN_FILE AND THE FILE " &
54
                      "IS A NON-TEMPORARY FILE");
55
     DECLARE
56
          PACKAGE SEQ_IO IS NEW SEQUENTIAL_IO (INTEGER);
57
          USE SEQ_IO;
58
          SEQ_FILE : FILE_TYPE;
59
          VAR1     : INTEGER := 5;
60
     BEGIN
61
          BEGIN
62
               CREATE (SEQ_FILE, OUT_FILE,
63
                       LEGAL_FILE_NAME (1, "CE2204A"));
64
               WRITE (SEQ_FILE, VAR1);
65
               CLOSE (SEQ_FILE);
66
          EXCEPTION
67
               WHEN USE_ERROR =>
68
                    NOT_APPLICABLE ("USE_ERROR RAISED; " &
69
                                    "SEQUENTIAL CREATE");
70
                    RAISE INCOMPLETE;
71
               WHEN NAME_ERROR =>
72
                    NOT_APPLICABLE ("NAME_ERROR RAISED; " &
73
                                    "SEQUENTIAL CREATE");
74
                    RAISE INCOMPLETE;
75
               WHEN OTHERS =>
76
                    FAILED ("UNEXPECTED EXCEPTION RAISED; " &
77
                            "SEQUENTIAL CREATE");
78
                    RAISE INCOMPLETE;
79
          END;
80
 
81
          BEGIN
82
               OPEN (SEQ_FILE, IN_FILE,
83
                     LEGAL_FILE_NAME (1, "CE2204A"));
84
          EXCEPTION
85
               WHEN USE_ERROR =>
86
                    NOT_APPLICABLE ("USE_ERROR  RAISED ON THE " &
87
                                    "OPENING OF A SEQUENTIAL " &
88
                                    "NON-TEMPORARY FILE");
89
                    RAISE INCOMPLETE;
90
          END;
91
 
92
          BEGIN
93
               WRITE (SEQ_FILE, 3);
94
               FAILED ("MODE_ERROR NOT RAISED - NAMED FILE");
95
          EXCEPTION
96
               WHEN MODE_ERROR =>
97
                    NULL;
98
               WHEN OTHERS =>
99
                    FAILED ("WRONG EXCEPTION RAISED - NAMED FILE");
100
          END;
101
 
102
          BEGIN
103
               DELETE (SEQ_FILE);
104
          EXCEPTION
105
               WHEN USE_ERROR =>
106
                    NULL;
107
          END;
108
 
109
     END;
110
 
111
     RESULT;
112
 
113
EXCEPTION
114
     WHEN INCOMPLETE =>
115
          RESULT;
116
 
117
END CE2204A;

powered by: WebSVN 2.1.0

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