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/] [ce3413b.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
-- CE3413B.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 PAGE RAISES LAYOUT_ERROR WHEN THE VALUE OF THE
27
--     PAGE NUMBER EXCEEDS COUNT'LAST.
28
 
29
-- APPLICABILITY CRITERIA:
30
--     THIS TEST IS APPLICABLE ONLY TO IMPLEMENTATIONS WHICH SUPPORT
31
--     TEXT FILES.
32
 
33
-- *** NOTE: This test has been modified since ACVC version 1.11 to    -- 9X
34
-- ***       remove incompatibilities associated with the transition   -- 9X
35
-- ***       to Ada 9X.                                                -- 9X
36
-- ***                                                                 -- 9X
37
 
38
-- HISTORY:
39
--     JLH 07/27/88  CREATED ORIGINAL TEST.
40
--     MRM 03/30/93  REMOVED NUMERIC_ERROR FOR 9X COMPATIBILITY
41
 
42
WITH REPORT; USE REPORT;
43
WITH TEXT_IO; USE TEXT_IO;
44
 
45
 
46
PROCEDURE CE3413B IS
47
 
48
     FILE : FILE_TYPE;
49
     INCOMPLETE, INAPPLICABLE : EXCEPTION;
50
     ITEM : STRING(1..3) := "ABC";
51
     LST : NATURAL;
52
 
53
BEGIN
54
 
55
     TEST ("CE3413B", "CHECK THAT PAGE RAISES LAYOUT_ERROR WHEN THE " &
56
                      "VALUE OF THE PAGE NUMBER EXCEEDS COUNT'LAST");
57
 
58
     BEGIN
59
 
60
          IF COUNT'LAST > 150000 THEN
61
               RAISE INAPPLICABLE;
62
          END IF;
63
 
64
          BEGIN
65
               CREATE (FILE, OUT_FILE, LEGAL_FILE_NAME);
66
          EXCEPTION
67
               WHEN USE_ERROR =>
68
                    NOT_APPLICABLE ("USE_ERROR RAISED ON TEXT CREATE " &
69
                                    "WITH OUT_FILE MODE");
70
                    RAISE INCOMPLETE;
71
               WHEN NAME_ERROR =>
72
                    NOT_APPLICABLE ("NAME_ERROR RAISED ON TEXT " &
73
                                    "CREATE WITH OUT_FILE MODE");
74
                    RAISE INCOMPLETE;
75
               WHEN OTHERS =>
76
                    FAILED ("UNEXPECTED EXCEPTION RAISED ON TEXT " &
77
                            "CREATE");
78
                    RAISE INCOMPLETE;
79
          END;
80
 
81
          FOR I IN 1 .. COUNT'LAST-1 LOOP
82
               NEW_PAGE (FILE);
83
          END LOOP;
84
 
85
          PUT (FILE, ITEM);
86
 
87
          NEW_PAGE (FILE);
88
          PUT (FILE, "DEF");
89
 
90
          BEGIN
91
               IF PAGE(FILE) <= POSITIVE_COUNT(COUNT'LAST) THEN
92
                    FAILED ("PAGE NUMBER INCORRECT AFTER PAGE SET - 1");
93
               END IF;
94
               FAILED ("LAYOUT_ERROR NOT RAISED FOR PAGE - 1");
95
          EXCEPTION
96
               WHEN LAYOUT_ERROR =>
97
                    NULL;
98
               WHEN CONSTRAINT_ERROR =>
99
                    FAILED ("CONSTRAINT_ERROR RAISED FOR PAGE - 1");
100
               WHEN OTHERS =>
101
                    FAILED ("UNEXPECTED EXCEPTION RAISED FOR PAGE - 1");
102
          END;
103
 
104
          CLOSE (FILE);
105
 
106
          BEGIN
107
               OPEN (FILE, IN_FILE, LEGAL_FILE_NAME);
108
          EXCEPTION
109
               WHEN USE_ERROR =>
110
                    NOT_APPLICABLE ("USE_ERROR RAISED ON TEXT OPEN " &
111
                                    "WITH IN_FILE MODE");
112
                    RAISE INCOMPLETE;
113
          END;
114
 
115
          FOR I IN 1 .. COUNT'LAST-1 LOOP
116
               SKIP_PAGE (FILE);
117
          END LOOP;
118
 
119
          IF PAGE(FILE) /= COUNT'LAST THEN
120
               FAILED ("INCORRECT PAGE NUMBER");
121
          END IF;
122
 
123
          GET_LINE (FILE, ITEM, LST);
124
          IF ITEM /= "ABC" THEN
125
               FAILED ("INCORRECT VALUE READ");
126
          END IF;
127
 
128
          SKIP_PAGE (FILE);
129
 
130
          BEGIN
131
               IF PAGE(FILE) <= POSITIVE_COUNT(COUNT'LAST) THEN
132
                    FAILED ("PAGE NUMBER INCORRECT AFTER PAGE SET - 2");
133
               END IF;
134
               FAILED ("LAYOUT_ERROR NOT RAISED FOR PAGE - 2");
135
          EXCEPTION
136
               WHEN LAYOUT_ERROR =>
137
                    NULL;
138
               WHEN CONSTRAINT_ERROR =>
139
                    FAILED ("CONSTRAINT_ERROR RAISED FOR PAGE - 2");
140
               WHEN OTHERS =>
141
                    FAILED ("UNEXPECTED EXCEPTION RAISED FOR PAGE - 2");
142
          END;
143
 
144
          BEGIN
145
               DELETE (FILE);
146
          EXCEPTION
147
               WHEN USE_ERROR =>
148
                    NULL;
149
          END;
150
 
151
     EXCEPTION
152
          WHEN INCOMPLETE =>
153
               NULL;
154
          WHEN INAPPLICABLE =>
155
               NOT_APPLICABLE ("THE VALUE OF COUNT'LAST IS GREATER " &
156
                               "THAN 150000.  THE CHECKING OF THIS " &
157
                               "OBJECTIVE IS IMPRACTICAL");
158
 
159
     END;
160
 
161
     RESULT;
162
 
163
END CE3413B;

powered by: WebSVN 2.1.0

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