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/] [ce3810b.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
-- CE3810B.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 FIXED_IO PUT CAN OPERATE ON STRINGS.  ALSO CHECK THAT
27
--     LAYOUT_ERROR IS RAISED WHEN THE STRING IS INSUFFICIENTLY LONG.
28
 
29
-- HISTORY:
30
--     DWC 09/15/87  CREATE ORIGINAL TEST.
31
--     JRL 02/28/96  Changed upper bound of type FX from 1000.0 to 250.0.
32
 
33
WITH REPORT;
34
USE REPORT;
35
WITH TEXT_IO;
36
USE TEXT_IO;
37
 
38
PROCEDURE CE3810B IS
39
BEGIN
40
 
41
     TEST ("CE3810B", "CHECK THAT FIXED_IO PUT CAN OPERATE ON " &
42
                      "STRINGS.  ALSO CHECK THAT LAYOUT_ERROR IS " &
43
                      "RAISED WHEN THE STRING IS INSUFFICIENTLY LONG");
44
 
45
     DECLARE
46
          TYPE FX IS DELTA 0.0001 RANGE 0.0 .. 250.0;
47
          PACKAGE FXIO IS NEW FIXED_IO (FX);
48
          USE FXIO;
49
          ST1 : CONSTANT STRING  := "  234.5000";
50
          ST : STRING (ST1'RANGE);
51
          ST2 : STRING (1 .. 2);
52
 
53
     BEGIN
54
          BEGIN
55
               PUT (ST, 234.5);
56
          EXCEPTION
57
               WHEN LAYOUT_ERROR =>
58
                    FAILED ("LAYOUT_ERROR RAISED ON PUT" &
59
                            "TO STRING - FIXED");
60
               WHEN OTHERS =>
61
                    FAILED ("SOME EXCEPTION RAISED ON PUT" &
62
                            "TO STRING -FIXED");
63
          END;
64
 
65
          IF ST /= ST1 THEN
66
               FAILED ("PUT FIXED TO STRING INCORRECT; OUTPUT " &
67
                       "WAS """ & ST & """");
68
          END IF;
69
 
70
          BEGIN
71
               PUT (ST (1..7), 234.5000);
72
               FAILED ("LAYOUT_ERROR NOT RAISED - FIXED - 1");
73
          EXCEPTION
74
               WHEN LAYOUT_ERROR =>
75
                    NULL;
76
               WHEN OTHERS =>
77
                    FAILED ("WRONG EXCEPTION RAISED - FIXED - 1");
78
          END;
79
 
80
          BEGIN
81
               PUT (ST, 2.3, 9, 0);
82
               FAILED ("LAYOUT_ERROR NOT RAISED - FIXED - 2");
83
          EXCEPTION
84
               WHEN LAYOUT_ERROR =>
85
                    NULL;
86
               WHEN OTHERS =>
87
                    FAILED ("WRONG EXCEPTION RAISED - FIXED - 2");
88
          END;
89
 
90
          BEGIN
91
               PUT (ST2, 2.0, 0, 0);
92
               FAILED ("LAYOUT_ERROR NOT RAISED - FIXED - 3");
93
          EXCEPTION
94
               WHEN LAYOUT_ERROR =>
95
                    NULL;
96
               WHEN OTHERS =>
97
                    FAILED ("WRONG EXCEPTION RAISED - FIXED - 3");
98
          END;
99
 
100
          BEGIN
101
               PUT (ST, 2.345, 6, 2);
102
               FAILED ("LAYOUT_ERROR NOT RAISED - FIXED - 4");
103
          EXCEPTION
104
               WHEN LAYOUT_ERROR =>
105
                    NULL;
106
               WHEN OTHERS =>
107
                    FAILED ("WRONG EXCEPTION RAISED - FIXED - 4");
108
          END;
109
 
110
          BEGIN
111
               PUT (ST, 2.0, 0, 7);
112
               FAILED ("LAYOUT_ERROR NOT RAISED - FIXED - 5");
113
          EXCEPTION
114
               WHEN LAYOUT_ERROR =>
115
                    NULL;
116
               WHEN OTHERS =>
117
                    FAILED ("WRONG EXCEPTION RAISED - FIXED - 5");
118
          END;
119
     END;
120
 
121
     RESULT;
122
END CE3810B;

powered by: WebSVN 2.1.0

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