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

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

Line No. Rev Author Line
1 149 jeremybenn
-- CE2111C.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 SEQUENTIAL 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
--     JLH 07/23/87  ADDED CHECKS FOR USE_ERROR WHEN FILE IS RESET.
40
 
41
WITH REPORT; USE REPORT;
42
WITH SEQUENTIAL_IO;
43
 
44
PROCEDURE CE2111C IS
45
 
46
     PACKAGE SEQ_IO IS NEW SEQUENTIAL_IO (INTEGER);
47
          USE SEQ_IO;
48
     SEQ_FILE : SEQ_IO.FILE_TYPE;
49
     SEQ_MODE : SEQ_IO.FILE_MODE;
50
     INCOMPLETE : EXCEPTION;
51
     VAR1 : INTEGER := 5;
52
 
53
BEGIN
54
 
55
     TEST ("CE2111C", "CHECK THAT A SUPPLIED MODE PARAMETER SETS " &
56
                      "THE MODE OF THE GIVEN FILE APPROPRIATELY");
57
 
58
-- CREATE SEQUENTIAL TEST FILE
59
 
60
     BEGIN
61
          CREATE (SEQ_FILE, OUT_FILE, LEGAL_FILE_NAME);
62
          WRITE (SEQ_FILE, VAR1);
63
          CLOSE (SEQ_FILE);
64
     EXCEPTION
65
          WHEN USE_ERROR =>
66
               NOT_APPLICABLE ("USE_ERROR RAISED ON CREATE");
67
               RAISE INCOMPLETE;
68
          WHEN NAME_ERROR =>
69
               NOT_APPLICABLE ("NAME_ERROR RAISED ON CREATE");
70
               RAISE INCOMPLETE;
71
     END;
72
 
73
     BEGIN
74
          OPEN (SEQ_FILE, IN_FILE, LEGAL_FILE_NAME);
75
     EXCEPTION
76
          WHEN USE_ERROR =>
77
               NOT_APPLICABLE ("SEQUENTIAL FILES WITH IN_FILE MODE " &
78
                               "NOT SUPPORTED");
79
               RAISE INCOMPLETE;
80
     END;
81
 
82
-- RESET TO DEFAULT
83
 
84
     BEGIN
85
          SEQ_MODE := OUT_FILE;
86
          RESET (SEQ_FILE);
87
          SEQ_MODE := MODE (SEQ_FILE);
88
          IF SEQ_MODE /= IN_FILE THEN
89
               FAILED ("DEFAULT RESET CHANGED MODE - SEQ");
90
          END IF;
91
     EXCEPTION
92
          WHEN USE_ERROR =>
93
               NOT_APPLICABLE ("RESET NOT SUPPORTED FOR SEQ IN_FILE " &
94
                               "MODE");
95
               RAISE INCOMPLETE;
96
     END;
97
 
98
-- RESET TO OUT_FILE
99
 
100
     BEGIN
101
          SEQ_MODE := IN_FILE;
102
          RESET (SEQ_FILE, OUT_FILE);
103
          SEQ_MODE := MODE (SEQ_FILE);
104
          IF SEQ_MODE /= OUT_FILE THEN
105
               FAILED ("RESET TO OUT_FILE FAILED - SEQ");
106
          END IF;
107
     EXCEPTION
108
          WHEN USE_ERROR =>
109
               NOT_APPLICABLE ("RESET FROM IN_FILE TO OUT_FILE MODE " &
110
                               "NOT SUPPORTED FOR SEQ FILES");
111
               RAISE INCOMPLETE;
112
     END;
113
 
114
     BEGIN
115
          DELETE (SEQ_FILE);
116
     EXCEPTION
117
          WHEN USE_ERROR =>
118
               NULL;
119
     END;
120
 
121
     RESULT;
122
 
123
EXCEPTION
124
     WHEN INCOMPLETE =>
125
          RESULT;
126
 
127
END CE2111C;

powered by: WebSVN 2.1.0

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