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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- CE3810A.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 FLOAT_IO PUT CAN OPERATE ON STRINGS.  ALSO CHECK THAT
27
--     LAYOUT_ERROR IS RAISED WHEN THE STRING IS INSUFFICIENTLY LONG.
28
 
29
-- HISTORY:
30
--     SPS 10/07/82
31
--     VKG 01/20/83
32
--     SPS 02/18/83
33
--     DWC 09/15/87  SPLIT CASE FOR FIXED_IO INTO CE3810B.ADA AND
34
--                   ADDED CASED FOR AFT AND EXP TO RAISE LAYOUT_ERROR.
35
 
36
WITH REPORT;
37
USE REPORT;
38
WITH TEXT_IO;
39
USE TEXT_IO;
40
 
41
PROCEDURE CE3810A IS
42
BEGIN
43
 
44
     TEST ("CE3810A", "CHECK THAT FLOAT_IO PUT " &
45
                      "OPERATES ON STRINGS CORRECTLY");
46
 
47
     DECLARE
48
          TYPE FL IS DIGITS 4;
49
          PACKAGE FLIO IS NEW FLOAT_IO (FL);
50
          USE FLIO;
51
          ST  : STRING (1 .. 2 + (FL'DIGITS-1) + 3 + 2);
52
          ST1 : STRING (1 .. 10) := " 2.345E+02";
53
          ST2 : STRING (1 .. 2);
54
     BEGIN
55
          PUT (ST, 234.5);
56
          IF ST /= ST1 THEN
57
               FAILED ("PUT FLOAT TO STRING INCORRECT; OUTPUT WAS """ &
58
                        ST & """");
59
          END IF;
60
 
61
          BEGIN
62
               PUT (ST(1 .. 8), 234.5);
63
               FAILED ("LAYOUT_ERROR NOT RAISED - FLOAT - 1");
64
          EXCEPTION
65
               WHEN LAYOUT_ERROR =>
66
                    NULL;
67
               WHEN OTHERS =>
68
                    FAILED ("WRONG EXCEPTION RAISED - FLOAT - 1");
69
          END;
70
 
71
          BEGIN
72
               PUT (ST, 2.3, 9, 0);
73
               FAILED ("LAYOUT_ERROR NOT RAISED - FLOAT - 2");
74
          EXCEPTION
75
               WHEN LAYOUT_ERROR =>
76
                    NULL;
77
               WHEN OTHERS =>
78
                    FAILED ("WRONG EXCEPTION RAISED - FLOAT - 2");
79
          END;
80
 
81
          BEGIN
82
               PUT (ST2, 2.0, 0, 0);
83
               FAILED ("LAYOUT_ERROR NOT RAISED - FLOAT - 3");
84
          EXCEPTION
85
               WHEN LAYOUT_ERROR =>
86
                    NULL;
87
               WHEN OTHERS =>
88
                    FAILED ("WRONG EXCEPTION RAISED - FLOAT - 3");
89
          END;
90
 
91
          BEGIN
92
               PUT (ST, 2.345, 6, 2);
93
               FAILED ("LAYOUT_ERROR NOT RAISED - FLOAT - 4");
94
          EXCEPTION
95
               WHEN LAYOUT_ERROR =>
96
                    NULL;
97
               WHEN OTHERS =>
98
                    FAILED ("WRONG EXCEPTION RAISED - FLOAT - 4");
99
          END;
100
 
101
          BEGIN
102
               PUT (ST, 2.0, 0, 7);
103
               FAILED ("LAYOUT_ERROR NOT RAISED - FLOAT - 5");
104
          EXCEPTION
105
               WHEN LAYOUT_ERROR =>
106
                    NULL;
107
               WHEN OTHERS =>
108
                    FAILED ("WRONG EXCEPTION RAISED - FLOAT - 5");
109
          END;
110
     END;
111
 
112
     RESULT;
113
 
114
END CE3810A;

powered by: WebSVN 2.1.0

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