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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- CE2201A.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 STRING.
28
 
29
-- APPLICABILITY CRITERIA:
30
--     THIS TEST IS APPLICABLE ONLY TO IMPLEMENTATIONS WHICH SUPPORT
31
--     SEQUENTIAL FILES.
32
 
33
-- HISTORY:
34
--     ABW 08/16/82
35
--     SPS 11/09/82
36
--     JBG 01/05/83
37
--     JBG 02/22/84  CHANGED TO .ADA TEST.
38
--     TBN 11/04/86  REVISED TEST TO OUTPUT A NOT_APPLICABLE
39
--                   RESULT WHEN FILES ARE NOT SUPPORTED.
40
--     JLH 07/28/87  REMOVED DEPENDENCE ON SUPPORT OF RESET.
41
 
42
WITH REPORT;
43
USE REPORT;
44
WITH SEQUENTIAL_IO;
45
 
46
PROCEDURE CE2201A IS
47
 
48
BEGIN
49
 
50
     TEST ("CE2201A", "CHECK THAT READ, WRITE, AND " &
51
                      "END_OF_FILE ARE SUPPORTED FOR " &
52
                      "SEQUENTIAL FILES - STRING TYPE");
53
 
54
     DECLARE
55
          SUBTYPE STRNG IS STRING (1..12);
56
          PACKAGE SEQ_STR IS NEW SEQUENTIAL_IO (STRNG);
57
          USE SEQ_STR;
58
          FILE_STR : FILE_TYPE;
59
          INCOMPLETE : EXCEPTION;
60
          STR : STRNG := "TEXT OF FILE";
61
          ITEM_STR : STRNG;
62
     BEGIN
63
          BEGIN
64
               CREATE (FILE_STR, OUT_FILE, LEGAL_FILE_NAME);
65
          EXCEPTION
66
               WHEN USE_ERROR | NAME_ERROR =>
67
                    NOT_APPLICABLE ("CREATE OF SEQUENTIAL FILE WITH " &
68
                                    "MODE OUT_FILE NOT SUPPORTED");
69
                    RAISE INCOMPLETE;
70
          END;
71
 
72
          WRITE (FILE_STR, STR);
73
          CLOSE (FILE_STR);
74
 
75
          BEGIN
76
               OPEN (FILE_STR, IN_FILE, LEGAL_FILE_NAME);
77
          EXCEPTION
78
               WHEN USE_ERROR =>
79
                    NOT_APPLICABLE ("OPEN OF SEQUENTIAL FILE WITH " &
80
                                    "MODE IN_FILE NOT SUPPORTED");
81
                    RAISE INCOMPLETE;
82
          END;
83
 
84
          IF END_OF_FILE (FILE_STR) THEN
85
               FAILED ("WRONG END_OF_FILE VALUE FOR TYPE STRING");
86
          END IF;
87
 
88
          READ (FILE => FILE_STR, ITEM => ITEM_STR);
89
 
90
          IF ITEM_STR /= STRNG (IDENT_STR("TEXT OF FILE")) THEN
91
               FAILED ("READ WRONG VALUE - STRING");
92
          END IF;
93
 
94
          IF NOT END_OF_FILE (FILE_STR) THEN
95
               FAILED ("END OF FILE NOT TRUE - STRING");
96
          END IF;
97
 
98
          BEGIN
99
               DELETE (FILE_STR);
100
          EXCEPTION
101
               WHEN USE_ERROR =>
102
                    NULL;
103
          END;
104
 
105
     EXCEPTION
106
          WHEN INCOMPLETE =>
107
               NULL;
108
     END;
109
 
110
     RESULT;
111
 
112
END CE2201A;

powered by: WebSVN 2.1.0

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