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

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

Line No. Rev Author Line
1 149 jeremybenn
-- CE2102M.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 TO SEE THAT STATUS_ERROR IS RAISED WHEN PERFORMING ILLEGAL
27
--     OPERATIONS ON OPENED OR UNOPENED FILES OF TYPE DIRECT_IO.
28
 
29
--          B) UNOPENED FILES
30
 
31
-- HISTORY:
32
--     SPW 02/24/87  CREATED ORIGINAL TEST.
33
 
34
WITH REPORT; USE REPORT;
35
WITH DIRECT_IO;
36
 
37
PROCEDURE CE2102M IS
38
 
39
     PACKAGE DIR_IO IS NEW DIRECT_IO(INTEGER);
40
     USE DIR_IO;
41
 
42
     TEST_FILE_ONE : DIR_IO.FILE_TYPE;
43
     STR : STRING (1 .. 10);
44
     FL_MODE : DIR_IO.FILE_MODE ;
45
 
46
BEGIN
47
 
48
     TEST ("CE2102M", "CHECK THAT STATUS_ERROR IS RAISED WHEN " &
49
                      "PERFORMING ILLEGAL OPERATIONS ON UNOPENED " &
50
                      "FILES OF TYPE DIRECT_IO");
51
 
52
-- CHECK TO SEE THAT PROPER EXCEPTIONS ARE RAISED WHEN
53
-- PERFORMING OPERATIONS ON AN UNOPENED FILE
54
 
55
-- CLOSE AN UNOPENED FILE
56
 
57
     BEGIN
58
          CLOSE (TEST_FILE_ONE);
59
          FAILED ("STATUS_ERROR NOT RAISED WHEN AN UNOPENED FILE " &
60
                  "IS USED IN A CLOSE OPERATION");
61
     EXCEPTION
62
          WHEN STATUS_ERROR =>
63
               NULL;
64
          WHEN OTHERS =>
65
               FAILED ("WRONG EXCEPTION RAISED ON CLOSE");
66
     END;
67
 
68
-- DELETE AN UNOPENED FILE
69
 
70
     BEGIN
71
          DELETE (TEST_FILE_ONE);
72
          FAILED ("STATUS_ERROR NOT RAISED WHEN AN UNOPENED FILE " &
73
                  "IS USED IN A DELETE OPERATION");
74
     EXCEPTION
75
          WHEN STATUS_ERROR =>
76
               NULL;
77
          WHEN OTHERS =>
78
               FAILED ("WRONG EXCEPTION RAISED ON DELETE");
79
     END;
80
 
81
-- RESET UNOPENED FILE
82
 
83
     BEGIN
84
          RESET (TEST_FILE_ONE);
85
          FAILED ("STATUS_ERROR NOT RAISED WHEN AN UNOPENED FILE " &
86
                  "IS USED IN A RESET");
87
     EXCEPTION
88
          WHEN STATUS_ERROR =>
89
               NULL;
90
          WHEN OTHERS =>
91
               FAILED ("WRONG EXCEPTION RAISED ON RESET");
92
     END;
93
 
94
     BEGIN
95
          RESET (TEST_FILE_ONE, IN_FILE);
96
          FAILED ("STATUS_ERROR NOT RAISED WHEN AN UNOPENED FILE " &
97
                  "IS USED IN A RESET WITH MODE PARAMETER");
98
     EXCEPTION
99
          WHEN STATUS_ERROR =>
100
               NULL;
101
          WHEN OTHERS =>
102
               FAILED ("WRONG EXCEPTION RAISED ON RESET WITH " &
103
                       "MODE PARAMETER");
104
     END;
105
 
106
-- ATTEMPT TO DETERMINE MODE OF UNOPENED FILE
107
 
108
     BEGIN
109
          FL_MODE := MODE (TEST_FILE_ONE);
110
          FAILED ("STATUS_ERROR NOT RAISED WHEN AN UNOPENED FILE " &
111
                  "IS USED IN A MODE OPERATION");
112
     EXCEPTION
113
          WHEN STATUS_ERROR =>
114
               NULL;
115
          WHEN OTHERS =>
116
               FAILED ("WRONG EXCEPTION RAISED ON MODE");
117
     END;
118
 
119
-- ATTEMPT TO DETERMINE NAME OF UNOPENED FILE
120
 
121
     BEGIN
122
          STR := NAME (TEST_FILE_ONE);
123
          FAILED ("STATUS_ERROR NOT RAISED WHEN AN UNOPENED FILE " &
124
                  "IS USED IN A NAME OPERATION");
125
     EXCEPTION
126
          WHEN STATUS_ERROR =>
127
               NULL;
128
          WHEN OTHERS =>
129
               FAILED ("WRONG EXCEPTION RAISED ON NAME");
130
     END;
131
 
132
--ATTEMPT TO DETERMINE FORM OF UNOPENED FILE
133
 
134
     BEGIN
135
          STR := FORM (TEST_FILE_ONE);
136
          FAILED ("STATUS_ERROR NOT RAISED WHEN AN UNOPENED FILE " &
137
                  "IS USED IN A FORM OPERATION");
138
     EXCEPTION
139
          WHEN STATUS_ERROR =>
140
               NULL;
141
          WHEN OTHERS =>
142
               FAILED ("WRONG EXCEPTION RAISED ON FORM");
143
     END;
144
 
145
     RESULT;
146
END CE2102M;

powered by: WebSVN 2.1.0

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