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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- CE2408A.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 WRITE DOES NOT CAUSE AN EXCEPTION WHEN THE TO
27
--     PARAMETER IS GREATER THAN THE END POSITION.
28
 
29
--          1) FILE MODE IS OUT_FILE.
30
 
31
-- APPLICABILITY CRITERIA:
32
--     THIS TEST IS APPLICABLE ONLY TO IMPLEMENTATIONS WHICH SUPPORT
33
--     CREATION OF DIRECT FILES WITH MODE OUT_FILE.
34
 
35
-- HISTORY:
36
--     DLD 08/19/82
37
--     SPS 11/09/82
38
--     EG  05/16/85
39
--     GMT 08/05/87  ADDED A CHECK FOR USE_ERROR ON DELETE AND REMOVED
40
--                   THE OTHERS EXCEPTION AT THE BOTTOM OF THE FILE.
41
 
42
WITH REPORT; USE REPORT;
43
WITH DIRECT_IO;
44
 
45
PROCEDURE CE2408A IS
46
 
47
     PACKAGE DIR_IO IS NEW DIRECT_IO (INTEGER);
48
     USE DIR_IO;
49
 
50
     DIR_FILE   : FILE_TYPE;
51
     INCOMPLETE : EXCEPTION;
52
 
53
BEGIN
54
 
55
     TEST ("CE2408A", "FOR FILES OF MODE OUT_FILE, CHECK THAT " &
56
                      "WRITE DOES NOT CAUSE AN EXCEPTION  WHEN THE " &
57
                      """TO"" PARAMETER IS GREATER THAN THE END " &
58
                      "POSITION");
59
 
60
     -- CREATE TEST FILE
61
 
62
     BEGIN
63
          CREATE (DIR_FILE, OUT_FILE, LEGAL_FILE_NAME);
64
     EXCEPTION
65
          WHEN USE_ERROR =>
66
               NOT_APPLICABLE ("USE_ERROR RAISED ON CREATE WITH MODE " &
67
                               "OUT_FILE FOR DIR_IO - 1");
68
               RAISE INCOMPLETE;
69
          WHEN NAME_ERROR =>
70
               NOT_APPLICABLE ("NAME_ERROR RAISED ON CREATE WITH " &
71
                               "MODE OUT_FILE FOR DIR_IO - 2");
72
               RAISE INCOMPLETE;
73
          WHEN OTHERS =>
74
               FAILED ("UNEXPECTED EXCEPTION RAISED ON CREATE WITH " &
75
                       "MODE OUT_FILE FOR DIR_IO - 3");
76
               RAISE INCOMPLETE;
77
     END;
78
 
79
     -- FILL UP FILE
80
 
81
     WRITE (DIR_FILE, 3);
82
     WRITE (DIR_FILE, 4);
83
     WRITE (DIR_FILE, 5);
84
     WRITE (DIR_FILE, 6);
85
 
86
     -- WRITE WHERE TO IS LARGER THAN END OF FILE
87
 
88
     BEGIN
89
          WRITE (DIR_FILE, 9, 7);
90
     EXCEPTION
91
          WHEN OTHERS =>
92
               FAILED ("WRITE RAISED EXCEPTION WHEN TO " &
93
                       "PARAMETER WAS BEYOND END - 4");
94
     END;
95
 
96
     BEGIN
97
          SET_INDEX (DIR_FILE, 11);
98
          WRITE (DIR_FILE, 10);
99
     EXCEPTION
100
          WHEN OTHERS =>
101
               FAILED ("SET_INDEX/WRITE RAISED EXCEPTION WHEN TO " &
102
                       "PARAMETER EXCEEDS THE END POSITION - 5");
103
     END;
104
 
105
     -- DELETE TEST FILE
106
 
107
     BEGIN
108
          DELETE (DIR_FILE);
109
     EXCEPTION
110
          WHEN USE_ERROR =>
111
               NULL;
112
     END;
113
 
114
     RESULT;
115
 
116
EXCEPTION
117
     WHEN INCOMPLETE =>
118
          RESULT;
119
 
120
END CE2408A;

powered by: WebSVN 2.1.0

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