OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [ce/] [ce2104b.ada] - Blame information for rev 294

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- CE2104B.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
--          A) SEQUENTIAL 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 SEQUENTIAL_IO;
46
WITH REPORT; USE REPORT;
47
 
48
PROCEDURE CE2104B IS
49
 
50
     PACKAGE SEQ_IO IS NEW SEQUENTIAL_IO(INTEGER);
51
     USE SEQ_IO;
52
     TYPE ACC_STR IS ACCESS STRING;
53
 
54
     SEQ_FILE_ONE : SEQ_IO.FILE_TYPE;
55
     SEQ_FILE_TWO : SEQ_IO.FILE_TYPE;
56
     SEQ_FILE_NAME : ACC_STR;
57
     VAR : INTEGER;
58
     INCOMPLETE : EXCEPTION;
59
 
60
BEGIN
61
 
62
     TEST ("CE2104B", "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(SEQ_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 (SEQ_FILE_ONE, 14);
84
     SEQ_FILE_NAME := NEW STRING'(NAME(SEQ_FILE_ONE));
85
     CLOSE (SEQ_FILE_ONE);
86
 
87
-- ATTEMPT TO RE-OPEN SEQUENTIAL TEST FILE USING RETURNED NAME VALUE
88
 
89
     BEGIN
90
          OPEN (SEQ_FILE_TWO, IN_FILE, SEQ_FILE_NAME.ALL);
91
     EXCEPTION
92
          WHEN SEQ_IO.USE_ERROR =>
93
               NOT_APPLICABLE ("USE_ERROR RAISED ON OPEN WITH " &
94
                               "IN_FILE MODE");
95
               RAISE INCOMPLETE;
96
          WHEN SEQ_IO.NAME_ERROR =>
97
               FAILED ("STRING NOT ACCEPTED AS NAME FOR FILE - SEQ");
98
               RAISE INCOMPLETE;
99
          WHEN OTHERS =>
100
               FAILED ("FILE NOT RE-OPENED - SEQ");
101
               RAISE INCOMPLETE;
102
     END;
103
 
104
     READ (SEQ_FILE_TWO, VAR);
105
     IF VAR /= 14 THEN
106
          FAILED ("WRONG DATA RETURNED FROM READ -SEQ");
107
     END IF;
108
 
109
-- DELETE TEST FILE
110
 
111
     BEGIN
112
          DELETE (SEQ_FILE_TWO);
113
     EXCEPTION
114
          WHEN USE_ERROR =>
115
               COMMENT ("DELETION OF EXTERNAL FILE IS NOT SUPPORTED");
116
     END;
117
 
118
     RESULT;
119
 
120
EXCEPTION
121
 
122
     WHEN INCOMPLETE =>
123
          RESULT;
124
 
125
END CE2104B;

powered by: WebSVN 2.1.0

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