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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [ce/] [ce2201n.ada] - Blame information for rev 720

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 720 jeremybenn
-- CE2201N.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 READ, WRITE, AND END_OF_FILE ARE SUPPORTED FOR
27
--     SEQUENTIAL FILES WITH ELEMENT_TYPE CONSTRAINED RECORD TYPES.
28
 
29
-- APPLICABILITY CRITERIA:
30
--     THIS TEST IS APPLICABLE ONLY TO IMPLEMENTATIONS WHICH SUPPORT
31
--     SEQUENTIAL FILES WITH ELEMENT_TYPE CONSTRAINED RECORD TYPES.
32
 
33
-- HISTORY:
34
--     ABW 08/17/82
35
--     SPS 09/15/82
36
--     SPS 11/09/82
37
--     JBG 05/02/83
38
--     EG  05/08/85
39
--     TBN 11/04/86  REVISED TEST TO OUTPUT A NOT_APPLICABLE
40
--                   RESULT WHEN FILES ARE NOT SUPPORTED.
41
--     JLH 07/28/87  REMOVED THE DEPENDENCE OF RESET BEING SUPPORTED
42
--                   AND CREATED EXTERNAL FILES RATHER THAN TEMPORARY
43
--                   FILES.
44
 
45
WITH REPORT;
46
USE REPORT;
47
WITH SEQUENTIAL_IO;
48
 
49
PROCEDURE CE2201N IS
50
 
51
BEGIN
52
 
53
     TEST ("CE2201N", "CHECK THAT READ, WRITE, AND " &
54
                      "END_OF_FILE ARE SUPPORTED FOR " &
55
                      "SEQUENTIAL FILES - CONSTRAINED RECORDS");
56
 
57
     DECLARE
58
          TYPE REC_DEF (DISCR : INTEGER := 18) IS
59
               RECORD
60
                    ONE : INTEGER := 1;
61
                    TWO : INTEGER := 2;
62
                    THREE : INTEGER := 17;
63
                    FOUR : INTEGER := 2;
64
               END RECORD;
65
          SUBTYPE REC_DEF_2 IS REC_DEF(2);
66
          PACKAGE SEQ_REC_DEF IS NEW SEQUENTIAL_IO (REC_DEF_2);
67
          USE SEQ_REC_DEF;
68
          FILE_REC_DEF : FILE_TYPE;
69
          INCOMPLETE : EXCEPTION;
70
          REC3 : REC_DEF(2);
71
          ITEM_REC3 : REC_DEF(2);
72
     BEGIN
73
          BEGIN
74
               CREATE (FILE_REC_DEF, OUT_FILE, LEGAL_FILE_NAME);
75
          EXCEPTION
76
               WHEN USE_ERROR | NAME_ERROR =>
77
                    NOT_APPLICABLE ("CREATE OF SEQUENTIAL FILE WITH " &
78
                                    "MODE OUT_FILE NOT SUPPORTED");
79
                    RAISE INCOMPLETE;
80
          END;
81
 
82
          WRITE (FILE_REC_DEF, REC3);
83
          CLOSE (FILE_REC_DEF);
84
 
85
          BEGIN
86
               OPEN (FILE_REC_DEF, IN_FILE, LEGAL_FILE_NAME);
87
          EXCEPTION
88
               WHEN USE_ERROR =>
89
                    NOT_APPLICABLE ("OPEN OF SEQUENTIAL FILE WITH " &
90
                                    "MODE IN_FILE NOT SUPPORTED");
91
                    RAISE INCOMPLETE;
92
          END;
93
 
94
          IF END_OF_FILE (FILE_REC_DEF) THEN
95
               FAILED ("WRONG END_OF_FILE VALUE FOR RECORD" &
96
                       "WITH DEFAULT");
97
          END IF;
98
 
99
          READ (FILE_REC_DEF, ITEM_REC3);
100
 
101
          IF ITEM_REC3 /= (2, IDENT_INT(1),2,17,2) THEN
102
               FAILED ("READ WRONG VALUE - RECORD WITH DEFAULT");
103
          END IF;
104
 
105
          IF NOT END_OF_FILE (FILE_REC_DEF) THEN
106
               FAILED ("END OF FILE NOT TRUE - RECORD WITH DEFAULT");
107
          END IF;
108
 
109
          BEGIN
110
               DELETE (FILE_REC_DEF);
111
          EXCEPTION
112
               WHEN USE_ERROR =>
113
                    NULL;
114
          END;
115
 
116
     EXCEPTION
117
          WHEN INCOMPLETE =>
118
               NULL;
119
     END;
120
 
121
     RESULT;
122
 
123
END CE2201N;

powered by: WebSVN 2.1.0

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