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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [ce/] [ce3902b.ada] - Blame information for rev 720

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 720 jeremybenn
-- CE3902B.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 THE OPERATIONS IN GENERIC PACKAGE ENUMERATION_IO
27
--     ALL HAVE THE CORRECT PARAMETER NAMES.
28
 
29
-- HISTORY:
30
--     JLH 08/25/88  CREATED ORIGINAL TEST.
31
--     RJW 02/28/90  ADDED CODE TO PREVENT MODE_ERROR FROM BEING RAISED.
32
 
33
WITH REPORT; USE REPORT;
34
WITH TEXT_IO; USE TEXT_IO;
35
 
36
PROCEDURE CE3902B IS
37
 
38
     TYPE COLOR IS (RED, BLUE, GREEN);
39
     PACKAGE COLOR_IO IS NEW ENUMERATION_IO (COLOR);
40
     USE COLOR_IO;
41
 
42
     FILE1 : FILE_TYPE;
43
     CRAYON : COLOR := RED;
44
     INDEX : POSITIVE;
45
     NUM : FIELD := 5;
46
     COLOR_STRING : STRING (1..5);
47
     INCOMPLETE : EXCEPTION;
48
 
49
BEGIN
50
 
51
     TEST ("CE3902B", "CHECK THAT THE OPERATIONS IN GENERIC PACKAGE " &
52
                      "ENUMERATION_IO ALL HAVE THE CORRECT PARAMETER " &
53
                      "NAMES");
54
 
55
     BEGIN
56
 
57
          BEGIN
58
               CREATE (FILE1, OUT_FILE, LEGAL_FILE_NAME);
59
          EXCEPTION
60
               WHEN USE_ERROR =>
61
                    NOT_APPLICABLE ("USE_ERROR RAISED ON CREATE " &
62
                                    "WITH OUT_FILE MODE");
63
                    RAISE INCOMPLETE;
64
               WHEN NAME_ERROR =>
65
                    NOT_APPLICABLE ("NAME_ERROR RAISED ON CREATE " &
66
                                    "WITH OUT_FILE MODE");
67
                    RAISE INCOMPLETE;
68
               WHEN OTHERS =>
69
                    FAILED ("UNEXPECTED EXCEPTION RAISED ON CREATE");
70
                    RAISE INCOMPLETE;
71
          END;
72
 
73
          SET_OUTPUT (FILE1);
74
 
75
          PUT (FILE => FILE1, ITEM => CRAYON, WIDTH => NUM,
76
               SET => UPPER_CASE);
77
 
78
          PUT (ITEM => GREEN, WIDTH => 5, SET => LOWER_CASE);
79
 
80
          PUT (TO => COLOR_STRING, ITEM => BLUE, SET => UPPER_CASE);
81
 
82
          CLOSE (FILE1);
83
 
84
          SET_OUTPUT (STANDARD_OUTPUT);
85
 
86
          BEGIN
87
               OPEN (FILE1, IN_FILE, LEGAL_FILE_NAME);
88
          EXCEPTION
89
               WHEN USE_ERROR =>
90
                    NOT_APPLICABLE ("USE_ERROR RAISED ON OPEN WITH " &
91
                                    "MODE IN_FILE");
92
                    RAISE INCOMPLETE;
93
          END;
94
 
95
          SET_INPUT (FILE1);
96
 
97
          GET (FILE => FILE1, ITEM => CRAYON);
98
 
99
          GET (ITEM => CRAYON);
100
 
101
          GET (FROM => COLOR_STRING, ITEM => CRAYON, LAST => INDEX);
102
 
103
          BEGIN
104
               DELETE (FILE1);
105
          EXCEPTION
106
               WHEN USE_ERROR =>
107
                    NULL;
108
          END;
109
 
110
     EXCEPTION
111
          WHEN INCOMPLETE =>
112
               NULL;
113
     END;
114
 
115
     RESULT;
116
 
117
END CE3902B;

powered by: WebSVN 2.1.0

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