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/] [ce3404b.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
-- CE3404B.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 END_OF_LINE OPERATES ON THE CURRENT DEFAULT INPUT FILE
27
--     IF NO FILE IS SPECIFIED.
28
 
29
-- APPLICABILITY CRITERIA:
30
--     THIS TEST IS APPLICABLE ONLY TO IMPLEMENTATIONS WHICH SUPPORT
31
--     TEXT FILES.
32
 
33
-- HISTORY:
34
--     ABW  08/26/82
35
--     SPS  09/17/82
36
--     SPS  11/11/82
37
--     TBN  11/04/86  REVISED TEST TO OUTPUT A NON_APPLICABLE
38
--                    RESULT WHEN FILES ARE NOT SUPPORTED.
39
--     GMT  09/22/87  CREATED A NON-TEMP FILE, REMOVED DEPENDENCE ON
40
--                    RESET, AND CHECKED THE VALUE OF THE CHAR READ.
41
 
42
WITH REPORT;  USE REPORT;
43
WITH TEXT_IO; USE TEXT_IO;
44
 
45
PROCEDURE CE3404B IS
46
 
47
     INCOMPLETE : EXCEPTION;
48
     MY_FILE    : FILE_TYPE;
49
     LOOP_COUNT : INTEGER := 0;
50
     BOOL       : BOOLEAN;
51
     CHAR       : CHARACTER := ('C');
52
 
53
BEGIN
54
 
55
     TEST ("CE3404B", "CHECK THAT END_OF_LINE OPERATES ON THE " &
56
                      "CURRENT DEFAULT INPUT FILE IF NO FILE " &
57
                      "IS SPECIFIED");
58
 
59
--   CREATE AND INITIALIZE THE FILE
60
 
61
     BEGIN
62
          CREATE (MY_FILE, OUT_FILE, LEGAL_FILE_NAME);
63
     EXCEPTION
64
          WHEN USE_ERROR =>
65
               NOT_APPLICABLE ("USE_ERROR RAISED ON TEXT CREATE " &
66
                               "WITH OUT_FILE MODE - 1");
67
               RAISE INCOMPLETE;
68
          WHEN NAME_ERROR =>
69
               NOT_APPLICABLE ("NAME_ERROR RAISED; TEXT CREATE " &
70
                               "WITH OUT_FILE MODE - 2");
71
               RAISE INCOMPLETE;
72
          WHEN OTHERS =>
73
               FAILED ("UNEXPECTED EXCEPTION RAISED; TEXT CREATE - 3");
74
               RAISE INCOMPLETE;
75
     END;
76
 
77
     FOR I IN 1..3 LOOP
78
          PUT (MY_FILE,CHAR);
79
     END LOOP;
80
     NEW_LINE (MY_FILE);
81
     PUT (MY_FILE,CHAR);
82
 
83
     CLOSE (MY_FILE);
84
 
85
     BEGIN
86
          OPEN (MY_FILE, IN_FILE, LEGAL_FILE_NAME);
87
     EXCEPTION
88
          WHEN USE_ERROR =>
89
               NOT_APPLICABLE ("USE ERROR RAISED ON ATTEMPT TO " &
90
                               "RE-OPEN WITH MODE OF IN_FILE - 4");
91
               RAISE INCOMPLETE;
92
     END;
93
 
94
     SET_INPUT (MY_FILE);
95
 
96
--   START THE TEST
97
 
98
     LOOP
99
          GET (CHAR);
100
          IF CHAR /= 'C' THEN
101
               FAILED ("CHAR READ FROM FILE HAS WRONG VALUE - 5");
102
               RAISE INCOMPLETE;
103
          END IF;
104
     EXIT WHEN END_OF_LINE;
105
          LOOP_COUNT := LOOP_COUNT + 1;
106
          IF LOOP_COUNT > IDENT_INT (3) THEN
107
               FAILED ("END_OF_LINE ON DEFAULT INCORRECT - 6");
108
               EXIT;
109
          END IF;
110
     END LOOP;
111
 
112
     GET (CHAR);
113
     IF CHAR /= 'C' THEN
114
          FAILED ("FINAL CHAR READ FROM FILE HAS WRONG VALUE - 7");
115
     END IF;
116
 
117
     BEGIN
118
          DELETE (MY_FILE);
119
     EXCEPTION
120
          WHEN OTHERS =>
121
               NULL;
122
     END;
123
 
124
     RESULT;
125
 
126
EXCEPTION
127
     WHEN INCOMPLETE =>
128
          RESULT;
129
 
130
END CE3404B;

powered by: WebSVN 2.1.0

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