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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- CE3409D.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, FOR FILES OF MODE IN_FILE, SET_COL READS UNTIL A
27
--     LINE FOUND HAVING A CHARACTER AT THE SPECIFIED COLUMN, SKIPPING
28
--     LINE AND PAGE TERMINATORS AS NECESSARY.
29
 
30
-- APPLICABILITY CRITERIA:
31
--     THIS TEST IS APPLICABLE ONLY TO IMPLEMENTATIONS WHICH SUPPORT
32
--     TEXT FILES.
33
 
34
-- HISTORY:
35
--     JBG 01/27/83
36
--     TBN 11/10/86  REVISED TEST TO OUTPUT A NOT_APPLICABLE
37
--                   RESULT WHEN FILES ARE NOT SUPPORTED.
38
--     JLH 08/31/87  REMOVED DEPENDENCE ON REST, REMOVED UNNECESSARY
39
--                   CODE, CHECKED FOR USE_ERROR ON DELETE, AND ADDED
40
--                   NEW CASES FOR SET_COL.
41
 
42
WITH REPORT; USE REPORT;
43
WITH TEXT_IO; USE TEXT_IO;
44
 
45
PROCEDURE CE3409D IS
46
 
47
     INCOMPLETE : EXCEPTION;
48
     FILE : FILE_TYPE;
49
     FOUR : POSITIVE_COUNT := POSITIVE_COUNT (IDENT_INT(4));
50
     ITEM_CHAR : CHARACTER;
51
 
52
BEGIN
53
 
54
     TEST ("CE3409D", "CHECK THAT SET_COL SKIPS LINE AND PAGE " &
55
                      "TERMINATORS WHEN NECESSARY");
56
 
57
     BEGIN
58
          CREATE (FILE, OUT_FILE, LEGAL_FILE_NAME);
59
     EXCEPTION
60
          WHEN USE_ERROR =>
61
               NOT_APPLICABLE ("USE_ERROR RAISED ON TEXT CREATE WITH " &
62
                               "MODE OUT_FILE");
63
               RAISE INCOMPLETE;
64
          WHEN NAME_ERROR =>
65
               NOT_APPLICABLE ("NAME_ERROR RAISED ON TEXT CREATE " &
66
                               "WITH MODE OUT_FILE");
67
               RAISE INCOMPLETE;
68
          WHEN OTHERS =>
69
               FAILED ("UNEXPECTED EXCEPTION RAISED ON TEXT CREATE");
70
               RAISE INCOMPLETE;
71
     END;
72
 
73
     PUT (FILE, "ABC");
74
     NEW_LINE (FILE);
75
     PUT (FILE, "DEFGHI");
76
     NEW_PAGE (FILE);
77
     PUT (FILE, "XYZ");
78
     NEW_PAGE (FILE);
79
     PUT (FILE, "IJKL");
80
 
81
     CLOSE (FILE);
82
 
83
     BEGIN
84
          OPEN (FILE, IN_FILE, LEGAL_FILE_NAME);
85
     EXCEPTION
86
          WHEN USE_ERROR =>
87
               NOT_APPLICABLE ("USE_ERROR RAISED ON TEXT OPEN WITH " &
88
                               "MODE IN_FILE");
89
               RAISE INCOMPLETE;
90
     END;
91
 
92
     SET_COL (FILE, FOUR);
93
     GET (FILE, ITEM_CHAR);
94
 
95
     IF ITEM_CHAR = ' ' THEN
96
          BEGIN
97
               COMMENT ("FILE PADS LINES WITH SPACES");
98
 
99
               SET_COL (FILE, FOUR);
100
               GET (FILE, ITEM_CHAR);
101
               IF ITEM_CHAR /= 'G' THEN
102
                    FAILED ("INCORRECT VALUE FROM SET_COL - 1");
103
               END IF;
104
 
105
               SET_COL (FILE, FOUR);
106
               GET (FILE, ITEM_CHAR);
107
               IF ITEM_CHAR /= ' ' THEN
108
                    FAILED ("LINES SHOULD STILL BE PADDED WITH BLANKS");
109
               END IF;
110
          END;
111
 
112
     ELSIF ITEM_CHAR /= 'G' THEN
113
          FAILED ("SET_COL DOESN'T SKIP LINE MARKS; " &
114
                  "ACTUALLY READ '" & ITEM_CHAR & "'");
115
     ELSE
116
          BEGIN
117
               SET_COL (FILE, FOUR);
118
               GET (FILE, ITEM_CHAR);
119
 
120
               IF ITEM_CHAR /= 'L' THEN
121
                    FAILED ("SET_COL DOESN'T SKIP PAGE MARKS; " &
122
                            "ACTUALLY READ '" & ITEM_CHAR & "'");
123
               END IF;
124
          END;
125
     END IF;
126
 
127
     BEGIN
128
          DELETE (FILE);
129
     EXCEPTION
130
          WHEN USE_ERROR =>
131
               NULL;
132
     END;
133
 
134
     RESULT;
135
 
136
EXCEPTION
137
     WHEN INCOMPLETE =>
138
          RESULT;
139
 
140
END CE3409D;

powered by: WebSVN 2.1.0

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