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/] [ce2111f.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
-- CE2111F.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 A SUCCESSFUL RESET POSITIONS THE FILE CORRECTLY
27
--     TO THE START OF THE FILE FOR SEQUENTIAL IO.
28
 
29
-- APPLICABILITY CRITERIA:
30
--     THIS TEST IS APPLICABLE ONLY TO IMPLEMENTATIONS WHICH SUPPORT
31
--     RESET FOR SEQUENTIAL FILES.
32
 
33
-- HISTORY:
34
--     JLH 08/03/87 CREATED ORIGINAL TEST.
35
 
36
WITH REPORT; USE REPORT;
37
WITH SEQUENTIAL_IO;
38
 
39
PROCEDURE CE2111F IS
40
 
41
     PACKAGE SEQ_IO IS NEW SEQUENTIAL_IO (INTEGER);
42
          USE SEQ_IO;
43
     TEST_FILE_ONE : SEQ_IO.FILE_TYPE;
44
     DATUM : INTEGER;
45
     INCOMPLETE : EXCEPTION;
46
 
47
BEGIN
48
     TEST ("CE2111F", "CHECK THAT SUCCESSFUL RESET POSITIONS THE " &
49
                      "FILE CORRECTLY");
50
 
51
-- CREATE AND INITIALIZE TEST FILE
52
 
53
     BEGIN
54
          CREATE (TEST_FILE_ONE, OUT_FILE, LEGAL_FILE_NAME);
55
     EXCEPTION
56
          WHEN USE_ERROR =>
57
               NOT_APPLICABLE ("USE_ERROR RAISED ON CREATE");
58
               RAISE INCOMPLETE;
59
          WHEN NAME_ERROR =>
60
               NOT_APPLICABLE ("NAME_ERROR RAISED ON CREATE");
61
               RAISE INCOMPLETE;
62
     END;
63
 
64
     WRITE (TEST_FILE_ONE, 5);
65
     WRITE (TEST_FILE_ONE, 6);
66
 
67
-- CHECK THAT RESET POSITIONS INDEX CORRECTLY FOR OUT_FILE
68
 
69
     BEGIN
70
          RESET (TEST_FILE_ONE);
71
     EXCEPTION
72
          WHEN USE_ERROR =>
73
               NOT_APPLICABLE ("RESET NOT SUPPORTED FOR OUT_FILE");
74
               RAISE INCOMPLETE;
75
     END;
76
 
77
-- WRITE MORE DATA
78
 
79
     WRITE (TEST_FILE_ONE, 2);
80
     CLOSE (TEST_FILE_ONE);
81
 
82
-- NOW CHECK TO SEE THAT RESET WORKED FOR OUT_FILE
83
 
84
     BEGIN
85
          OPEN (TEST_FILE_ONE, IN_FILE, LEGAL_FILE_NAME);
86
     EXCEPTION
87
          WHEN USE_ERROR =>
88
               NOT_APPLICABLE ("SEQ_IO NOT SUPPORTED FOR IN_FILE OPEN");
89
               RAISE INCOMPLETE;
90
     END;
91
 
92
     READ (TEST_FILE_ONE, DATUM);
93
 
94
     IF DATUM /= 2 THEN
95
          FAILED ("RESET INCORRECTLY POSITIONED FILE FOR OUT_FILE");
96
     END IF;
97
 
98
 
99
-- RESET IN_FILE
100
 
101
     BEGIN
102
          RESET (TEST_FILE_ONE);
103
     EXCEPTION
104
          WHEN USE_ERROR =>
105
               NOT_APPLICABLE ("RESET NOT SUPPORTED FOR IN_FILE");
106
               RAISE INCOMPLETE;
107
     END;
108
 
109
-- VALIDATE IN_FILE RESET
110
 
111
     READ (TEST_FILE_ONE, DATUM);
112
 
113
     IF DATUM /= 2 THEN
114
          FAILED ("RESET INCORRECTLY POSITIONED FILE FOR IN_FILE");
115
     END IF;
116
 
117
-- DELETE TEST FILE
118
 
119
     BEGIN
120
          DELETE (TEST_FILE_ONE);
121
     EXCEPTION
122
          WHEN USE_ERROR =>
123
               NULL;
124
     END;
125
 
126
     RESULT;
127
 
128
EXCEPTION
129
     WHEN INCOMPLETE =>
130
          RESULT;
131
 
132
END CE2111F;

powered by: WebSVN 2.1.0

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