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

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

Line No. Rev Author Line
1 149 jeremybenn
-- CE3806B.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 PUT FOR FIXED_IO RAISES MODE_ERROR FOR FILES OF
27
--     MODE IN_FILE.
28
 
29
-- APPLICABILITY CRITERIA:
30
--     THIS TEST IS APPLICABLE ONLY TO IMPLEMENTATIONS WHICH SUPPORT
31
--     TEXT FILES.
32
 
33
-- HISTORY:
34
--     JLH 09/11/87  CREATED ORIGINAL TEST.
35
 
36
WITH REPORT; USE REPORT;
37
WITH TEXT_IO; USE TEXT_IO;
38
 
39
PROCEDURE CE3806B IS
40
 
41
BEGIN
42
     TEST ("CE3806B", "CHECK THAT PUT FOR FIXED_IO RAISES MODE_ERROR " &
43
                      "FOR FILES OF MODE IN_FILE");
44
 
45
     DECLARE
46
          FT1 : FILE_TYPE;
47
          TYPE FIXED IS DELTA 0.01 RANGE 0.0 .. 1.0;
48
          PACKAGE FX_IO IS NEW FIXED_IO (FIXED);
49
          USE FX_IO;
50
          INCOMPLETE : EXCEPTION;
51
          X : FIXED := 0.2;
52
 
53
     BEGIN
54
 
55
          BEGIN
56
               CREATE (FT1, OUT_FILE, LEGAL_FILE_NAME);
57
          EXCEPTION
58
               WHEN USE_ERROR =>
59
                    NOT_APPLICABLE ("USE_ERROR RAISED ON TEXT CREATE " &
60
                                    "WITH OUT_FILE MODE");
61
                    RAISE INCOMPLETE;
62
               WHEN NAME_ERROR =>
63
                    NOT_APPLICABLE ("NAME_ERROR RAISED ON TEXT " &
64
                                    "CREATE WITH OUT_FILE MODE");
65
                    RAISE INCOMPLETE;
66
          END;
67
 
68
          PUT (FT1, 'A');
69
          CLOSE (FT1);
70
 
71
          BEGIN
72
               OPEN (FT1, IN_FILE, LEGAL_FILE_NAME);
73
          EXCEPTION
74
               WHEN USE_ERROR =>
75
                    NOT_APPLICABLE ("USE_ERROR RAISED ON TEXT OPEN " &
76
                                    "WITH IN_FILE MODE");
77
                    RAISE INCOMPLETE;
78
          END;
79
 
80
          BEGIN
81
               PUT (FT1, X);
82
               FAILED ("MODE_ERROR NOT RAISED - 1");
83
          EXCEPTION
84
               WHEN MODE_ERROR =>
85
                    NULL;
86
               WHEN OTHERS =>
87
                    FAILED ("WRONG EXCEPTION RAISED - 1");
88
          END;
89
 
90
          BEGIN
91
               PUT (STANDARD_INPUT, X);
92
               FAILED ("MODE_ERROR NOT RAISED - 2");
93
           EXCEPTION
94
               WHEN MODE_ERROR =>
95
                    NULL;
96
               WHEN OTHERS =>
97
                    FAILED ("WRONG EXCEPTION RAISED - 2");
98
          END;
99
 
100
          BEGIN
101
               PUT (CURRENT_INPUT, X);
102
               FAILED ("MODE_ERROR NOT RAISED - 3");
103
          EXCEPTION
104
               WHEN MODE_ERROR =>
105
                    NULL;
106
               WHEN OTHERS =>
107
                    FAILED ("WRONG EXCEPTION RAISED - 3");
108
          END;
109
 
110
          BEGIN
111
               DELETE (FT1);
112
          EXCEPTION
113
               WHEN USE_ERROR =>
114
                    NULL;
115
          END;
116
 
117
     EXCEPTION
118
          WHEN INCOMPLETE =>
119
               NULL;
120
     END;
121
 
122
     RESULT;
123
 
124
END CE3806B;

powered by: WebSVN 2.1.0

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