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/] [ce3706f.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
-- CE3706F.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 NUMBER OF
27
--     CHARACTERS TO BE OUTPUT EXCEEDS THE MAXIMUM LINE LENGTH.  CHECK
28
--     THAT IT IS NOT RAISED WHEN THE NUMBER OF CHARACTERS TO BE OUTPUT
29
--     ADDED TO THE CURRENT COLUMN NUMBER EXCEEDS THE MAXIMUM LINE
30
--     LENGTH.
31
 
32
-- APPLICABILITY CRITERIA:
33
--     THIS TEST IS APPLICABLE ONLY TO IMPLEMENTATIONS WHICH SUPPORT
34
--     CREATION OF TEMPORARY TEXT FILES WITH OUT_FILE MODE.
35
 
36
-- HISTORY:
37
--     SPS 10/05/82
38
--     VKG 01/14/83
39
--     SPS 02/18/83
40
--     JBG 08/30/83
41
--     EG  05/22/85
42
--     RJW 11/04/86  REVISED TEST TO OUTPUT A NOT_APPLICABLE
43
--                   RESULT WHEN FILES ARE NOT SUPPORTED.
44
--     JLH 09/10/87  REMOVED UNNECESSARY CODE, CORRECTED EXCEPTION
45
--                   HANDLING, AND ADDED CASE USING WIDTH OF FIVE.
46
 
47
WITH REPORT; USE REPORT;
48
WITH TEXT_IO; USE TEXT_IO;
49
WITH CHECK_FILE;
50
 
51
PROCEDURE CE3706F IS
52
 
53
BEGIN
54
 
55
     TEST ("CE3706F", "CHECK THAT LAYOUT_ERROR IS RAISED CORRECTLY");
56
 
57
     DECLARE
58
          FT : FILE_TYPE;
59
          PACKAGE IIO IS NEW INTEGER_IO (INTEGER);
60
          USE IIO;
61
          INCOMPLETE : EXCEPTION;
62
     BEGIN
63
 
64
          BEGIN
65
               CREATE (FT);
66
          EXCEPTION
67
               WHEN USE_ERROR =>
68
                    NOT_APPLICABLE ("USE_ERROR RAISED ON TEXT CREATE " &
69
                                    "FOR TEMPORARY FILE WITH " &
70
                                    "OUT_FILE MODE");
71
                    RAISE INCOMPLETE;
72
          END;
73
 
74
          SET_LINE_LENGTH (FT, 4);
75
 
76
          BEGIN
77
               PUT (FT, 32_000, WIDTH => 0);
78
               FAILED ("LAYOUT_ERROR NOT RAISED - 1");
79
          EXCEPTION
80
               WHEN LAYOUT_ERROR =>
81
                    NULL;
82
               WHEN OTHERS =>
83
                    FAILED ("WRONG EXCEPTION RAISED - 1");
84
          END;
85
 
86
          BEGIN
87
               PUT (FT, 32_000, WIDTH => 5);
88
               FAILED ("LAYOUT_ERROR NOT RAISED - 2");
89
          EXCEPTION
90
               WHEN LAYOUT_ERROR =>
91
                    NULL;
92
               WHEN OTHERS =>
93
                    FAILED ("WRONG EXCEPTION RAISED - 2");
94
          END;
95
 
96
          PUT (FT, 123, WIDTH => 0);  -- "123"
97
 
98
          BEGIN
99
               PUT (FT, 457, WIDTH => 0);  -- "123#457"
100
               IF LINE (FT) /= 2 THEN
101
                    FAILED ("OUTPUT INCORRECT");
102
               END IF;
103
          EXCEPTION
104
               WHEN LAYOUT_ERROR =>
105
                    FAILED ("LAYOUT_ERROR RAISED INCORRECTLY");
106
          END;
107
 
108
          CHECK_FILE (FT, "123#457#@%");
109
 
110
          CLOSE (FT);
111
 
112
     EXCEPTION
113
          WHEN INCOMPLETE =>
114
               NULL;
115
     END;
116
 
117
     RESULT;
118
 
119
END CE3706F;

powered by: WebSVN 2.1.0

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