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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- CE2201F.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 PRIVATE ELEMENT_TYPES.
28
 
29
-- APPLICABILITY CRITERIA:
30
--     THIS TEST IS APPLICABLE ONLY TO IMPLEMENTATIONS WHICH SUPPORT
31
--     SEQUENTIAL FILES WITH PRIVATE ELEMENT_TYPES.
32
 
33
-- HISTORY:
34
--     ABW 08/17/82
35
--     SPS 09/15/82
36
--     SPS 11/09/82
37
--     JBG 01/06/83
38
--     JBG 02/22/84  CHANGED TO .ADA TEST.
39
--     TBN 11/04/86  REVISED TEST TO OUTPUT A NOT_APPLICABLE
40
--                   RESULT WHEN FILES ARE NOT SUPPORTED.
41
--     JLH 08/03/87  REMOVED DEPENDENCE OF RESET AND CREATED EXTERNAL
42
--                   FILES RATHER THAN TEMPORARY FILES.
43
 
44
WITH REPORT;
45
USE REPORT;
46
WITH SEQUENTIAL_IO;
47
 
48
PROCEDURE CE2201F IS
49
 
50
     PACKAGE PKG IS
51
          TYPE PRIV IS PRIVATE;
52
          FUNCTION MAKE_PRIV (X : INTEGER) RETURN PRIV;
53
     PRIVATE
54
          TYPE PRIV IS NEW INTEGER;
55
     END PKG;
56
     USE PKG;
57
 
58
     PACKAGE BODY PKG IS
59
          FUNCTION MAKE_PRIV (X : INTEGER) RETURN PRIV IS
60
          BEGIN
61
               RETURN PRIV(X);
62
          END;
63
     END PKG;
64
 
65
BEGIN
66
 
67
     TEST ("CE2201F", "CHECK THAT READ, WRITE, AND " &
68
                      "END_OF_FILE ARE SUPPORTED FOR " &
69
                      "SEQUENTIAL FILES FOR PRIVATE TYPES");
70
 
71
     DECLARE
72
          PACKAGE SEQ_PRV IS NEW SEQUENTIAL_IO (PRIV);
73
          USE SEQ_PRV;
74
          PRV, ITEM_PRV : PRIV;
75
          FILE_PRV : FILE_TYPE;
76
          INCOMPLETE : EXCEPTION;
77
     BEGIN
78
          BEGIN
79
               CREATE (FILE_PRV, OUT_FILE, LEGAL_FILE_NAME);
80
          EXCEPTION
81
               WHEN USE_ERROR | NAME_ERROR =>
82
                    NOT_APPLICABLE ("CREATE OF SEQUENTIAL FILE WITH " &
83
                                    "MODE OUT_FILE NOT SUPPORTED");
84
                    RAISE INCOMPLETE;
85
          END;
86
 
87
          PRV := MAKE_PRIV(IDENT_INT(26));
88
 
89
          WRITE (FILE_PRV, PRV);
90
          CLOSE (FILE_PRV);
91
 
92
          BEGIN
93
               OPEN (FILE_PRV, IN_FILE, LEGAL_FILE_NAME);
94
          EXCEPTION
95
               WHEN USE_ERROR =>
96
                    NOT_APPLICABLE ("OPEN OF SEQUENTIAL FILE WITH " &
97
                                    "MODE IN_FILE NOT SUPPORTED");
98
                    RAISE INCOMPLETE;
99
          END;
100
 
101
          IF END_OF_FILE (FILE_PRV) THEN
102
               FAILED ("WRONG END_OF_FILE VALUE FOR PRIVATE TYPE");
103
          END IF;
104
 
105
          READ (FILE_PRV, ITEM_PRV);
106
 
107
          IF ITEM_PRV /= MAKE_PRIV (26) THEN
108
               FAILED ("READ WRONG VALUE");
109
          END IF;
110
 
111
          IF NOT END_OF_FILE (FILE_PRV) THEN
112
               FAILED ("NOT AT END OF FILE");
113
          END IF;
114
 
115
          BEGIN
116
               DELETE (FILE_PRV);
117
          EXCEPTION
118
               WHEN USE_ERROR =>
119
                    NULL;
120
          END;
121
 
122
     EXCEPTION
123
          WHEN INCOMPLETE =>
124
               NULL;
125
     END;
126
 
127
     RESULT;
128
 
129
END CE2201F;

powered by: WebSVN 2.1.0

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