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/] [ce3705b.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
-- CE3705B.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
--     IF WIDTH IS ZERO, CHECK THAT END_ERROR IS RAISED IF THE ONLY
27
--     REMAINING CHARACTERS IN THE FILE CONSIST OF LINE TERMINATORS,
28
--     PAGE TERMINATORS, SPACES, AND HORIZONTAL TABULATION CHARACTERS.
29
--     AFTER END_ERROR IS RAISED, THE FILE SHOULD BE POSITIONED BEFORE
30
--     THE FILE TERMINATOR AND END_OF_FILE SHOULD BE TRUE.
31
 
32
-- APPLICABILITY CRITERIA:
33
--     THIS TEST IS ONLY APPLICABLE TO IMPLEMENTATIONS THAT SUPPORT
34
--     TEXT FILES.
35
 
36
-- HISTORY:
37
--     JLH 07/15/88  CREATED ORIGINAL TEST.
38
 
39
WITH REPORT; USE REPORT;
40
WITH TEXT_IO; USE TEXT_IO;
41
 
42
PROCEDURE CE3705B IS
43
 
44
     PACKAGE IIO IS NEW INTEGER_IO (INTEGER);
45
     USE IIO;
46
 
47
     FILE : FILE_TYPE;
48
     ITEM : INTEGER;
49
     INCOMPLETE : EXCEPTION;
50
 
51
BEGIN
52
 
53
     TEST ("CE3705B", "IF WIDTH IS ZERO, CHECK THAT END_ERROR IS " &
54
                      "RAISED IF THE ONLY REMAINING CHARACTERS IN " &
55
                      "THE FILE CONSIST OF LINE TERMINATORS, PAGE " &
56
                      "TERMINATORS, SPACES, AND HORIZONTAL TAB " &
57
                      "CHARACTERS. AFTER END_ERROR IS RAISED, THE " &
58
                      "FILE SHOULD BE POSITIONED BEFORE THE FILE " &
59
                      "TERMINATOR AND END_OF_FILE SHOULD BE TRUE");
60
 
61
     BEGIN
62
 
63
          BEGIN
64
               CREATE (FILE, OUT_FILE, LEGAL_FILE_NAME);
65
          EXCEPTION
66
               WHEN USE_ERROR =>
67
                    NOT_APPLICABLE ("USE_ERROR RAISED ON CREATE " &
68
                                    "WITH MODE OUT_FILE");
69
                    RAISE INCOMPLETE;
70
               WHEN NAME_ERROR =>
71
                    NOT_APPLICABLE ("NAME_ERROR RAISED ON CREATE " &
72
                                    "WITH MODE OUT_FILE");
73
                    RAISE INCOMPLETE;
74
               WHEN OTHERS =>
75
                    FAILED ("UNEXPECTED EXCEPTION RAISED ON CREATE");
76
                    RAISE INCOMPLETE;
77
          END;
78
 
79
          PUT (FILE, 2);
80
          NEW_LINE (FILE);
81
          PUT (FILE, 3);
82
          NEW_LINE (FILE);
83
          NEW_PAGE (FILE);
84
          PUT (FILE, ASCII.HT);
85
          NEW_LINE (FILE);
86
          NEW_LINE (FILE);
87
          NEW_PAGE (FILE);
88
          PUT (FILE, ' ');
89
          PUT (FILE, ASCII.HT);
90
          PUT (FILE, ' ');
91
 
92
          CLOSE (FILE);
93
 
94
          BEGIN
95
               OPEN (FILE, IN_FILE, LEGAL_FILE_NAME);
96
          EXCEPTION
97
               WHEN USE_ERROR =>
98
                    NOT_APPLICABLE ("USE_ERROR RAISED ON OPEN WITH " &
99
                                    "MODE IN_FILE");
100
                    RAISE INCOMPLETE;
101
               WHEN OTHERS =>
102
                    FAILED ("UNEXPECTED EXCEPTION RAISED ON OPEN");
103
                    RAISE INCOMPLETE;
104
          END;
105
 
106
          GET (FILE, ITEM);
107
          IF ITEM /= 2 THEN
108
               FAILED ("INCORRECT VALUE READ - 1");
109
          END IF;
110
 
111
          GET (FILE, ITEM);
112
          IF ITEM /= 3 THEN
113
               FAILED ("INCORRECT VALUE READ - 2");
114
          END IF;
115
 
116
          BEGIN
117
               GET (FILE, ITEM, WIDTH => 0);
118
               FAILED ("END_ERROR NOT RAISED FOR GET");
119
          EXCEPTION
120
               WHEN END_ERROR =>
121
                    NULL;
122
               WHEN OTHERS =>
123
                    FAILED ("UNEXPECTED EXCEPTION RAISED ON GET");
124
          END;
125
 
126
          IF NOT END_OF_FILE(FILE) THEN
127
               FAILED ("END_OF_FILE NOT TRUE AFTER RAISING EXCEPTION");
128
          END IF;
129
 
130
          BEGIN
131
               DELETE (FILE);
132
          EXCEPTION
133
               WHEN USE_ERROR =>
134
                    NULL;
135
          END;
136
 
137
     EXCEPTION
138
          WHEN INCOMPLETE =>
139
               NULL;
140
     END;
141
 
142
     RESULT;
143
 
144
END CE3705B;

powered by: WebSVN 2.1.0

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