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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
-- CE3906B.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 ENUMERATION TYPES RAISES MODE_ERROR WHEN
27
--     APPLIED TO FILES OF MODE IN_FILE.
28
 
29
-- APPLICABILITY CRITERIA:
30
--     THIS TEST IS APPLICABLE ONLY TO IMPLEMENTATIONS WHICH
31
--     SUPPORT TEXT FILES.
32
 
33
-- HISTORY:
34
--     SPS 10/08/82
35
--     JBG 02/22/84  CHANGED TO .ADA TEST.
36
--     TBN 11/10/86  REVISED TEST TO OUTPUT A NON_APPLICABLE
37
--                   RESULT WHEN FILES ARE NOT SUPPORTED.
38
--     DWC 09/17/87  REMOVED DEPENDENCY ON RESET AND CORRECTED
39
--                   EXCEPTION HANDLERS.
40
 
41
WITH REPORT;
42
USE REPORT;
43
WITH TEXT_IO;
44
USE TEXT_IO;
45
 
46
PROCEDURE CE3906B IS
47
     INCOMPLETE : EXCEPTION;
48
 
49
BEGIN
50
 
51
     TEST ("CE3906B", "CHECK THAT PUT FOR ENUMERATION TYPES RAISES " &
52
                      "MODE_ERROR WHEN APPLIED TO FILES OF MODE " &
53
                      "IN_FILE");
54
 
55
     DECLARE
56
          FT : FILE_TYPE;
57
          TYPE FLOWER IS (ROSE, DAISY, SNAPDRAGON, VIOLET, CARNATION);
58
          PACKAGE FLOWER_IO IS NEW ENUMERATION_IO (FLOWER);
59
          USE FLOWER_IO;
60
          X : FLOWER := DAISY;
61
     BEGIN
62
 
63
          BEGIN
64
               CREATE (FT, OUT_FILE, LEGAL_FILE_NAME);
65
          EXCEPTION
66
               WHEN USE_ERROR =>
67
                    NOT_APPLICABLE ("USE_ERROR RAISED; TEXT CREATE " &
68
                                    "WITH OUT_FILE MODE");
69
                    RAISE INCOMPLETE;
70
               WHEN NAME_ERROR =>
71
                    NOT_APPLICABLE ("NAME_ERROR RAISED; TEXT CREATE " &
72
                                    "WITH OUT_FILE MODE");
73
                    RAISE INCOMPLETE;
74
          END;
75
 
76
          PUT (FT, X);
77
 
78
          CLOSE (FT);
79
 
80
          BEGIN
81
               OPEN (FT, IN_FILE, LEGAL_FILE_NAME);
82
          EXCEPTION
83
               WHEN USE_ERROR =>
84
                    NOT_APPLICABLE ("USE_ERROR RAISED; TEXT OPEN " &
85
                                    "WITH IN_FILE MODE");
86
                    RAISE INCOMPLETE;
87
          END;
88
 
89
          BEGIN
90
               PUT (FT, X);
91
               FAILED ("MODE_ERROR NOT RAISED - FILE");
92
          EXCEPTION
93
               WHEN MODE_ERROR =>
94
                    NULL;
95
               WHEN OTHERS =>
96
                    FAILED ("WRONG EXCEPTION RAISED - FILE");
97
          END;
98
 
99
          BEGIN
100
               PUT (STANDARD_INPUT, X);
101
               FAILED ("MODE_ERROR NOT RAISED - STANDARD_INPUT");
102
          EXCEPTION
103
               WHEN MODE_ERROR =>
104
                    NULL;
105
               WHEN OTHERS =>
106
                    FAILED ("WRONG EXCEPTION RAISED - STANDARD_INPUT");
107
          END;
108
 
109
          BEGIN
110
               PUT (CURRENT_INPUT, X);
111
               FAILED ("MODE_ERROR NOT RAISED - CURRENT_INPUT");
112
          EXCEPTION
113
               WHEN MODE_ERROR =>
114
                    NULL;
115
               WHEN OTHERS =>
116
                    FAILED ("WRONG EXCEPTION RAISED - CURRENT_INPUT");
117
          END;
118
 
119
          BEGIN
120
               DELETE (FT);
121
          EXCEPTION
122
               WHEN USE_ERROR =>
123
                    NULL;
124
          END;
125
 
126
     EXCEPTION
127
          WHEN INCOMPLETE =>
128
               NULL;
129
     END;
130
 
131
     RESULT;
132
 
133
END CE3906B;

powered by: WebSVN 2.1.0

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