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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- CE2104D.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 NAME RETURNED BY NAME CAN BE USED IN A
27
--     SUBSEQUENT OPEN.
28
 
29
--          B) DIRECT FILES
30
 
31
-- APPLICABILITY CRITERIA:
32
--     THIS TEST IS APPLICABLE ONLY TO IMPLEMENTATIONS WHOSE
33
--     ENVIRONMENT SUPPORTS CREATE/OPEN FOR THE GIVEN MODE.
34
 
35
-- HISTORY:
36
--     DLD 08/11/82
37
--     SPS 11/09/82
38
--     JBG 03/24/83
39
--     EG  05/31/85
40
--     TBN 11/04/86  ADDED A RAISE INCOMPLETE STATEMENT WHEN FAILED IS
41
--                   CALLED FOR OPEN OR CREATE.
42
--     SPW 08/07/87  REMOVED UNNECESSARY CODE AND CORRECTED EXCEPTION
43
--                   HANDLING.
44
 
45
WITH DIRECT_IO;
46
WITH REPORT; USE REPORT;
47
 
48
PROCEDURE CE2104D IS
49
 
50
     PACKAGE DIR_IO IS NEW DIRECT_IO(INTEGER);
51
     USE DIR_IO;
52
     TYPE ACC_STR IS ACCESS STRING;
53
 
54
     DIR_FILE_ONE : DIR_IO.FILE_TYPE;
55
     DIR_FILE_TWO : DIR_IO.FILE_TYPE;
56
     DIR_FILE_NAME : ACC_STR;
57
     VAR : INTEGER;
58
     INCOMPLETE : EXCEPTION;
59
 
60
BEGIN
61
 
62
     TEST ("CE2104D", "CHECK THAT THE NAME RETURNED BY NAME " &
63
                      "CAN BE USED IN A SUBSEQUENT OPEN");
64
 
65
-- CREATE TEST FILE
66
 
67
     BEGIN
68
          CREATE (DIR_FILE_ONE, OUT_FILE, LEGAL_FILE_NAME);
69
     EXCEPTION
70
          WHEN USE_ERROR =>
71
               NOT_APPLICABLE ("USE_ERROR RAISED ON CREATE WITH " &
72
                               "OUT_FILE MODE");
73
               RAISE INCOMPLETE;
74
          WHEN NAME_ERROR =>
75
               NOT_APPLICABLE ("NAME_ERROR RAISED ON CREATE WITH " &
76
                               "OUT_FILE MODE");
77
               RAISE INCOMPLETE;
78
          WHEN OTHERS =>
79
               FAILED ("UNEXPECTED EXCEPTION RAISED ON CREATE");
80
               RAISE INCOMPLETE;
81
     END;
82
 
83
     WRITE (DIR_FILE_ONE, 3);
84
     DIR_FILE_NAME := NEW STRING'(NAME(DIR_FILE_ONE));
85
     CLOSE (DIR_FILE_ONE);
86
 
87
-- ATTEMPT TO RE-OPEN DIRECT TEST FILE USING RETURNED NAME VALUE
88
 
89
     BEGIN
90
          OPEN (DIR_FILE_TWO, IN_FILE, DIR_FILE_NAME.ALL);
91
     EXCEPTION
92
          WHEN DIR_IO.USE_ERROR =>
93
               NOT_APPLICABLE ("USE_ERROR RAISED ON OPEN WITH " &
94
                               "IN_FILE MODE");
95
               RAISE INCOMPLETE;
96
          WHEN DIR_IO.NAME_ERROR =>
97
               FAILED ("STRING NOT ACCEPTED AS NAME FOR FILE - DIR");
98
               RAISE INCOMPLETE;
99
          WHEN OTHERS =>
100
               FAILED ("FILE NOT RE-OPENED - DIR");
101
               RAISE INCOMPLETE;
102
 
103
     END;
104
 
105
     READ (DIR_FILE_TWO, VAR);
106
     IF VAR /= 3 THEN
107
          FAILED ("WRONG DATA RETURNED FROM READ - DIR");
108
     END IF;
109
 
110
-- DELETE TEST FILE
111
 
112
     BEGIN
113
          DELETE (DIR_FILE_TWO);
114
     EXCEPTION
115
          WHEN USE_ERROR =>
116
               COMMENT ("DELETION OF EXTERNAL FILE IS NOT SUPPORTED");
117
     END;
118
 
119
     RESULT;
120
 
121
EXCEPTION
122
 
123
     WHEN INCOMPLETE =>
124
          RESULT;
125
 
126
END CE2104D;

powered by: WebSVN 2.1.0

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