OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [ce/] [ce3901a.ada] - Blame information for rev 294

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- CE3901A.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 AND PUT FOR ENUMERATED TYPES RAISE STATUS ERROR
27
--     IF THE FILE IS NOT OPEN.
28
 
29
-- HISTORY:
30
--     SPS 10/07/82
31
--     JBG 02/22/84  CHANGED TO .ADA TEST
32
--     DWC 09/16/87  ADDED AN ATTEMPT TO CREATE A FILE AND THEN
33
--                   RETESTED OBJECTIVE.
34
--     BCB 10/03/90  ADDED NAME_ERROR AS A CHOICE TO THE EXCEPTION
35
--                   HANDLER FOR CREATE.
36
 
37
WITH REPORT;
38
USE REPORT;
39
WITH TEXT_IO;
40
USE TEXT_IO;
41
 
42
PROCEDURE CE3901A IS
43
BEGIN
44
 
45
     TEST ("CE3901A", "CHECK THAT GET AND PUT FOR ENUMERATED TYPES " &
46
                      "RAISE STATUS ERROR IF THE FILE IS NOT OPEN.");
47
 
48
     DECLARE
49
          TYPE COLOR IS (RED, BLUE, GREEN, ORANGE, YELLOW);
50
          FT : FILE_TYPE;
51
          PACKAGE COLOR_IO IS NEW ENUMERATION_IO (COLOR);
52
          USE COLOR_IO;
53
          X : COLOR;
54
     BEGIN
55
          BEGIN
56
               PUT (FT, RED);
57
               FAILED ("STATUS_ERROR NOT RAISED - PUT - 1");
58
          EXCEPTION
59
               WHEN STATUS_ERROR =>
60
                    NULL;
61
               WHEN OTHERS =>
62
                    FAILED ("WRONG EXCEPTION RAISED - PUT - 1");
63
          END;
64
 
65
          BEGIN
66
               GET (FT, X);
67
               FAILED ("STATUS_ERROR NOT RAISED - GET - 1");
68
          EXCEPTION
69
               WHEN STATUS_ERROR =>
70
                    NULL;
71
               WHEN OTHERS =>
72
                    FAILED ("WRONG EXCEPTION RAISED - GET - 1");
73
          END;
74
 
75
          BEGIN
76
               CREATE (FT, OUT_FILE, LEGAL_FILE_NAME);  -- THIS IS JUST
77
               CLOSE (FT);                   -- AN ATTEMPT TO CREATE A
78
          EXCEPTION                          -- FILE.  OBJECTIVE IS MET
79
               WHEN USE_ERROR                -- EITHER WAY.
80
                  | NAME_ERROR =>  NULL;
81
          END;
82
 
83
          BEGIN
84
               PUT (FT, RED);
85
               FAILED ("STATUS_ERROR NOT RAISED - PUT - 2");
86
          EXCEPTION
87
               WHEN STATUS_ERROR =>
88
                    NULL;
89
               WHEN OTHERS =>
90
                    FAILED ("WRONG EXCEPTION RAISED - PUT - 2");
91
          END;
92
 
93
          BEGIN
94
               GET (FT, X);
95
               FAILED ("STATUS_ERROR NOT RAISED - GET - 2");
96
          EXCEPTION
97
               WHEN STATUS_ERROR =>
98
                    NULL;
99
               WHEN OTHERS =>
100
                    FAILED ("WRONG EXCEPTION RAISED - GET - 2");
101
          END;
102
     END;
103
 
104
     RESULT;
105
 
106
END CE3901A;

powered by: WebSVN 2.1.0

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