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

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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