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

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

Line No. Rev Author Line
1 149 jeremybenn
-- CE3905A.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 GET FOR ENUMERATION TYPES OPERATES ON FILE OF MODE
27
--     IN_FILE AND THAT WHEN NO FILE IS SPECIFIED IT OPERATES ON THE
28
--     CURRENT DEFAULT INPUT_FILE.
29
 
30
-- APPLICABILITY CRITERIA:
31
--     THIS TEST IS APPLICABLE ONLY TO IMPLEMENTATIONS WHICH
32
--     SUPPORT TEXT FILES.
33
 
34
-- HISTORY:
35
--     SPS 10/07/82
36
--     SPS 12/22/82
37
--     JBG 02/22/84  CHANGED TO .ADA TEST.
38
--     TBN 11/10/86  REVISED TEST TO OUTPUT A NON_APPLICABLE
39
--                   RESULT WHEN FILES ARE NOT SUPPORTED.
40
--     DWC 09/16/87  REMOVED DEPENDENCE ON RESET AND CORRECTED
41
--                   EXCEPTION HANDLING.
42
 
43
WITH REPORT;
44
USE REPORT;
45
WITH TEXT_IO;
46
USE TEXT_IO;
47
 
48
PROCEDURE CE3905A IS
49
     INCOMPLETE : EXCEPTION;
50
 
51
BEGIN
52
 
53
     TEST ("CE3905A", "CHECK THAT GET FOR ENUMERATION TYPES " &
54
                      "OPERATES ON FILE OF MODE IN_FILE AND THAT " &
55
                      "WHEN NO FILE IS SPECIFIED IT OPERATES ON " &
56
                      "THE CURRENT DEFAULT INPUT_FILE");
57
 
58
     DECLARE
59
          TYPE DAY IS (MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY);
60
          PACKAGE DAY_IO IS NEW ENUMERATION_IO (DAY);
61
          FT : FILE_TYPE;
62
          FILE : FILE_TYPE;
63
          USE DAY_IO;
64
          X : DAY;
65
     BEGIN
66
 
67
-- CREATE AND INITIALIZE DATA FILES.
68
 
69
          BEGIN
70
               CREATE (FT, OUT_FILE, LEGAL_FILE_NAME);
71
          EXCEPTION
72
               WHEN USE_ERROR =>
73
                    NOT_APPLICABLE ("USE_ERROR RAISED; TEXT CREATE " &
74
                                    "WITH OUT_FILE MODE - 1");
75
                    RAISE INCOMPLETE;
76
               WHEN NAME_ERROR =>
77
                    NOT_APPLICABLE ("NAME_ERROR RAISED; TEXT CREATE " &
78
                                    "WITH OUT_FILE MODE - 1");
79
                    RAISE INCOMPLETE;
80
          END;
81
 
82
          PUT (FT, "WEDNESDAY");
83
          NEW_LINE (FT);
84
          PUT (FT, "FRIDAY");
85
 
86
          CREATE (FILE, OUT_FILE, LEGAL_FILE_NAME(2));
87
 
88
          PUT (FILE, "TUESDAY");
89
          NEW_LINE (FILE);
90
          PUT (FILE, "THURSDAY");
91
 
92
          CLOSE (FT);
93
 
94
          BEGIN
95
               OPEN (FT, IN_FILE, LEGAL_FILE_NAME);
96
          EXCEPTION
97
               WHEN USE_ERROR =>
98
                    NOT_APPLICABLE ("USE_ERROR RAISED; TEXT OPEN " &
99
                                    "FOR IN_FILE MODE");
100
                    RAISE INCOMPLETE;
101
          END;
102
 
103
          CLOSE (FILE);
104
          OPEN (FILE, IN_FILE, LEGAL_FILE_NAME(2));
105
 
106
          SET_INPUT (FILE);
107
 
108
-- BEGIN TEST
109
 
110
          GET (FT, X);
111
          IF X /= WEDNESDAY THEN
112
               FAILED ("VALUE FROM FILE INCORRECT");
113
          END IF;
114
 
115
          GET (X);
116
          IF X /= TUESDAY THEN
117
               FAILED ("VALUE FROM DEFAULT INCORRECT");
118
          END IF;
119
 
120
          GET (FT, X);
121
          IF X /= FRIDAY THEN
122
               FAILED ("VALUE FROM FILE INCORRECT");
123
          END IF;
124
 
125
          GET (FILE, X);
126
          IF X /= THURSDAY THEN
127
               FAILED ("VALUE FROM DEFAULT INCORRECT");
128
          END IF;
129
 
130
          BEGIN
131
               DELETE (FT);
132
               DELETE (FILE);
133
          EXCEPTION
134
               WHEN USE_ERROR =>
135
                    NULL;
136
          END;
137
 
138
     EXCEPTION
139
          WHEN INCOMPLETE =>
140
               NULL;
141
     END;
142
 
143
     RESULT;
144
 
145
END CE3905A;

powered by: WebSVN 2.1.0

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