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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 294 jeremybenn
-- CE2401L.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 REWRITING AN ELEMENT DOES NOT CHANGE THE SIZE OF
27
--     THE FILE.
28
 
29
-- APPLICABILITY CRITERIA:
30
--     THIS TEST IS ONLY APPLICABLE TO IMPLEMENTATIONS WHICH SUPPORT
31
--     CREATE WITH INOUT_FILE MODE FOR DIRECT FILES.
32
 
33
-- HISTORY:
34
--     DWC 08/12/87  CREATED ORIGINAL TEST.
35
 
36
WITH REPORT; USE REPORT;
37
WITH DIRECT_IO;
38
 
39
PROCEDURE CE2401L IS
40
     END_SUBTEST: EXCEPTION;
41
BEGIN
42
 
43
     TEST ("CE2401L" , "CHECK THAT REWRITING AN ELEMENT DOES NOT " &
44
                       "CHANGE THE SIZE OF THE FILE");
45
 
46
     DECLARE
47
          PACKAGE DIR_IO IS NEW DIRECT_IO (INTEGER);
48
          USE DIR_IO;
49
          FILE : FILE_TYPE;
50
     BEGIN
51
          BEGIN
52
               CREATE (FILE, INOUT_FILE, LEGAL_FILE_NAME);
53
          EXCEPTION
54
               WHEN USE_ERROR | NAME_ERROR =>
55
                    NOT_APPLICABLE ("CREATE WITH INOUT_FILE MODE " &
56
                                    "NOT SUPPORTED");
57
                    RAISE END_SUBTEST;
58
               WHEN OTHERS =>
59
                    FAILED ("UNEXPECTED ERROR RAISED ON " &
60
                            "CREATE");
61
                    RAISE END_SUBTEST;
62
          END;
63
 
64
          DECLARE
65
               OUT_ITEM1 : INTEGER := 10;
66
               OUT_ITEM2 : INTEGER := 21;
67
               OUT_ITEM4 : INTEGER := 43;
68
               IN_ITEM   : INTEGER;
69
               ONE  : POSITIVE_COUNT := 1;
70
               TWO  : POSITIVE_COUNT := 2;
71
               FOUR : POSITIVE_COUNT := 4;
72
               OLD_FILE_SIZE : POSITIVE_COUNT;
73
          BEGIN
74
               BEGIN
75
                    WRITE (FILE, OUT_ITEM1, ONE);
76
                    WRITE (FILE, OUT_ITEM4, FOUR);
77
               EXCEPTION
78
                    WHEN OTHERS =>
79
                         FAILED ("EXCEPTION RAISED ON WRITE " &
80
                                 "IN INOUT_FILE MODE");
81
                         RAISE END_SUBTEST;
82
               END;
83
 
84
               OLD_FILE_SIZE := SIZE (FILE);
85
 
86
               WRITE (FILE, OUT_ITEM1, ONE);
87
               WRITE (FILE, OUT_ITEM4, FOUR);
88
 
89
               IF OLD_FILE_SIZE /= SIZE (FILE) THEN
90
                    FAILED ("FILE SIZE CHANGED DURING REWRITE - 1");
91
                    RAISE END_SUBTEST;
92
               END IF;
93
 
94
               WRITE (FILE, OUT_ITEM1, ONE);
95
               WRITE (FILE, OUT_ITEM2, TWO);
96
               WRITE (FILE, OUT_ITEM4, FOUR);
97
 
98
               OLD_FILE_SIZE := SIZE (FILE);
99
 
100
               WRITE (FILE, OUT_ITEM1, FOUR);
101
 
102
               IF OLD_FILE_SIZE /= SIZE (FILE) THEN
103
                    FAILED ("FILE SIZE CHANGED DURING REWRITE - 2");
104
                    RAISE END_SUBTEST;
105
               END IF;
106
          EXCEPTION
107
               WHEN END_SUBTEST =>
108
                    NULL;
109
          END;
110
 
111
          BEGIN
112
               DELETE (FILE);
113
          EXCEPTION
114
               WHEN USE_ERROR =>
115
                    NULL;
116
          END;
117
 
118
     EXCEPTION
119
          WHEN END_SUBTEST =>
120
               NULL;
121
     END;
122
 
123
     RESULT;
124
 
125
END CE2401L;

powered by: WebSVN 2.1.0

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