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

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

Line No. Rev Author Line
1 149 jeremybenn
-- CE3907A.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
-- CHECK THAT PUT FOR ENUMERATION TYPES CAN BE APPLIED TO A STRING.
26
-- CHECK THAT IT RAISES LAYOUT_ERROR WHEN THE ENUMERATION LITERAL TO BE
27
-- PLACED IN THE STRING IS LONGER THAN THE STRING.
28
 
29
-- SPS 10/11/82
30
-- JBG 2/22/84  CHANGED TO .ADA TEST 
31
 
32
WITH REPORT;
33
USE REPORT;
34
WITH TEXT_IO;
35
USE TEXT_IO;
36
 
37
PROCEDURE CE3907A IS
38
BEGIN
39
 
40
     TEST ("CE3907A", "CHECK THAT ENUMERATION_IO PUT OPERATES ON " &
41
                      "STRINGS CORRECTLY");
42
 
43
     DECLARE
44
          TYPE COLOR IS (RED, BLUE, GREEN);
45
          ST : STRING (1..4);
46
          PACKAGE COLOR_IO IS NEW ENUMERATION_IO (COLOR);
47
          USE COLOR_IO;
48
          CRAYON : COLOR := GREEN;
49
     BEGIN
50
          PUT (ST, RED);
51
          IF ST /= "RED " THEN
52
               FAILED ("PUT TO STRING, LENGTH LESS THAN STRING " &
53
                       "INCORRECT");
54
          END IF;
55
 
56
          PUT (ST, BLUE);
57
          IF ST /= "BLUE" THEN
58
               FAILED ("PUT TO STRING, LENGTH EQUAL TO STRING " &
59
                       "INCORRECT");
60
          END IF;
61
 
62
          BEGIN
63
               PUT (ST, CRAYON);
64
               FAILED ("LAYOUT_ERROR NOT RAISED");
65
          EXCEPTION
66
               WHEN LAYOUT_ERROR =>
67
                    NULL;
68
               WHEN OTHERS =>
69
                    FAILED ("WRONG EXCEPTION RAISED");
70
          END;
71
 
72
     END;
73
 
74
     RESULT;
75
END CE3907A;

powered by: WebSVN 2.1.0

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