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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- CE2111G.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 A SUPPLIED MODE PARAMETER IN A RESET CHANGES
27
--     THE MODE OF A GIVEN FILE.  IF NO PARAMETER IS SUPPLIED
28
--     THE MODE REMAINS THE SAME.
29
 
30
-- APPLICABILITY CRITERIA:
31
--     THIS TEST IS APPLICABLE ONLY TO IMPLEMENTATIONS WHICH SUPPORT
32
--     RESET FOR DIRECT FILES.
33
 
34
-- HISTORY:
35
--     DLD 08/16/82
36
--     SPS 11/09/82
37
--     JBG 03/24/83
38
--     EG  05/29/85
39
--     TBN 11/04/86  ADDED A RAISE INCOMPLETE STATEMENT WHEN FAILED
40
--                   IS CALLED FOR OPEN OR CREATE.
41
--     JLH 07/24/87  ADDED CHECKS FOR USE_ERR0R WHEN FILE IS RESET.
42
 
43
WITH REPORT; USE REPORT;
44
WITH DIRECT_IO;
45
 
46
PROCEDURE CE2111G IS
47
 
48
     PACKAGE DIR_IO IS NEW DIRECT_IO (INTEGER);
49
          USE DIR_IO;
50
     DIR_FILE : DIR_IO.FILE_TYPE;
51
     DIR_MODE : DIR_IO.FILE_MODE;
52
     INCOMPLETE : EXCEPTION;
53
     VAR1 : INTEGER := 5;
54
 
55
BEGIN
56
 
57
     TEST ("CE2111G", "CHECK THAT A SUPPLIED MODE PARAMETER SETS " &
58
                      "THE MODE OF THE GIVEN FILE APPROPRIATELY");
59
 
60
-- CREATE DIRECT TEST FILE
61
 
62
     BEGIN
63
          CREATE (DIR_FILE, INOUT_FILE, LEGAL_FILE_NAME);
64
          WRITE (DIR_FILE, VAR1);
65
     EXCEPTION
66
          WHEN USE_ERROR =>
67
               NOT_APPLICABLE ("USE_ERROR RAISED ON CREATE");
68
               RAISE INCOMPLETE;
69
          WHEN NAME_ERROR =>
70
               NOT_APPLICABLE ("NAME_ERROR RAISED ON CREATE");
71
               RAISE INCOMPLETE;
72
     END;
73
 
74
-- RESET TO DEFAULT
75
 
76
     BEGIN
77
          DIR_MODE := OUT_FILE;
78
          RESET (DIR_FILE);
79
          DIR_MODE := MODE (DIR_FILE);
80
          IF DIR_MODE /= INOUT_FILE THEN
81
               FAILED ("DEFAULT RESET CHANGED MODE - DIR");
82
          END IF;
83
     EXCEPTION
84
          WHEN USE_ERROR =>
85
               NOT_APPLICABLE ("RESET NOT SUPPORTED FOR DIR " &
86
                               "INOUT_FILES");
87
     END;
88
 
89
-- RESET TO OUT_FILE
90
 
91
     BEGIN
92
          DIR_MODE := IN_FILE;
93
          RESET (DIR_FILE, OUT_FILE);
94
          DIR_MODE := MODE (DIR_FILE);
95
          IF DIR_MODE /= OUT_FILE THEN
96
               FAILED ("RESET TO OUT_FILE FAILED - DIR");
97
          END IF;
98
     EXCEPTION
99
          WHEN USE_ERROR =>
100
               NOT_APPLICABLE ("RESET FROM INOUT_FILE TO OUT_FILE " &
101
                               "NOT SUPPORTED FOR DIR FILES");
102
     END;
103
 
104
-- RESET TO IN_FILE
105
 
106
     BEGIN
107
          DIR_MODE := OUT_FILE;
108
          RESET (DIR_FILE, IN_FILE);
109
          DIR_MODE := MODE (DIR_FILE);
110
          IF DIR_MODE /= IN_FILE THEN
111
               FAILED ("RESET TO IN_FILE FAILED - DIR");
112
          END IF;
113
     EXCEPTION
114
          WHEN USE_ERROR =>
115
               NOT_APPLICABLE ("RESET FROM OUT_FILE TO IN_FILE NOT " &
116
                               "SUPPORTED FOR DIR IN_FILE");
117
     END;
118
 
119
-- RESET TO INOUT_FILE
120
 
121
     BEGIN
122
          DIR_MODE := OUT_FILE;
123
          RESET (DIR_FILE, INOUT_FILE);
124
          DIR_MODE := MODE (DIR_FILE);
125
          IF DIR_MODE /= INOUT_FILE THEN
126
               FAILED ("RESET TO INOUT_FILE FAILED - DIR");
127
          END IF;
128
     EXCEPTION
129
          WHEN USE_ERROR =>
130
               NOT_APPLICABLE ("RESET FROM IN_FILE TO INOUT_FILE NOT " &
131
                               "SUPPORTED FOR DIR INOUT_FILES");
132
     END;
133
 
134
     BEGIN
135
          DELETE (DIR_FILE);
136
     EXCEPTION
137
          WHEN USE_ERROR =>
138
               NULL;
139
     END;
140
 
141
     RESULT;
142
 
143
EXCEPTION
144
     WHEN INCOMPLETE =>
145
          RESULT;
146
 
147
END CE2111G;

powered by: WebSVN 2.1.0

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