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

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

Line No. Rev Author Line
1 149 jeremybenn
-- CE3708A.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 INTEGER_IO PUT RAISES LAYOUT_ERROR WHEN THE MINIMUM
27
--     WIDTH REQUIRED FOR THE OUTPUT VALUE IS GREATER THAN THE LENGTH
28
--     OF THE STRING.  ALSO CHECK THAT INTEGER_IO PUT PADS THE OUTPUT
29
--     ON THE LEFT WITH SPACES IF THE LENGTH OF THE STRING IS GREATER
30
--     THAN THE MINIMUM WIDTH REQUIRED.
31
 
32
-- HISTORY:
33
--     SPS 10/05/82
34
--     CPP 07/30/84
35
--     JLH 09/11/87  ADDED CASES FOR PADDING OF OUTPUT STRING.
36
 
37
WITH REPORT; USE REPORT;
38
WITH TEXT_IO; USE TEXT_IO;
39
 
40
PROCEDURE CE3708A IS
41
BEGIN
42
 
43
     TEST ("CE3708A", "CHECK THAT INTEGER_IO PUT RAISES LAYOUT_ERROR " &
44
                      "WHEN THE MINIMUM WIDTH REQUIRED FOR THE " &
45
                      "OUTPUT VALUE IS GREATER THAN THE LENGTH OF " &
46
                      "THE STRING.  ALSO CHECK THAT INTEGER_IO PUT " &
47
                      "PADS THE OUTPUT ON THE LEFT WITH SPACES IF " &
48
                      "THE LENGTH OF THE STRING IS GREATER THAN THE " &
49
                      "MINIMUM WIDTH REQUIRED.");
50
 
51
     DECLARE
52
          PACKAGE IIO IS NEW INTEGER_IO (INTEGER);
53
          USE IIO;
54
          ST1 : STRING (1 .. 4);
55
          ST2 : STRING (1 .. 4);
56
          ST : STRING (1 .. 4) := "6382";
57
     BEGIN
58
          PUT (ST1, IDENT_INT(6382));
59
          IF ST1 /= ST THEN
60
               FAILED ("PUT TO STRING INCORRECT");
61
          END IF;
62
 
63
          BEGIN
64
               PUT (ST2, IDENT_INT(12345));
65
               FAILED ("LAYOUT_ERROR NOT RAISED");
66
          EXCEPTION
67
               WHEN LAYOUT_ERROR =>
68
                    NULL;
69
               WHEN OTHERS =>
70
                    FAILED ("WRONG EXCEPTION RAISED");
71
          END;
72
 
73
          PUT (ST1, IDENT_INT(123));
74
          IF ST1 /= " 123" THEN
75
               FAILED ("PUT DID NOT PAD WITH BLANKS - 1");
76
          END IF;
77
 
78
          PUT (ST2, IDENT_INT(-2));
79
          IF ST2 /= "  -2" THEN
80
               FAILED ("PUT DID NOT PAD WITH BLANKS - 2");
81
          END IF;
82
 
83
     END;
84
 
85
     RESULT;
86
 
87
END CE3708A;

powered by: WebSVN 2.1.0

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