annotate gcc/testsuite/ada/acats/tests/cxa/cxaa019.a @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 -- CXAA019.A
kono
parents:
diff changeset
2 --
kono
parents:
diff changeset
3 -- Grant of Unlimited Rights
kono
parents:
diff changeset
4 --
kono
parents:
diff changeset
5 -- The Ada Conformity Assessment Authority (ACAA) holds unlimited
kono
parents:
diff changeset
6 -- rights in the software and documentation contained herein. Unlimited
kono
parents:
diff changeset
7 -- rights are the same as those granted by the U.S. Government for older
kono
parents:
diff changeset
8 -- parts of the Ada Conformity Assessment Test Suite, and are defined
kono
parents:
diff changeset
9 -- in DFAR 252.227-7013(a)(19). By making this public release, the ACAA
kono
parents:
diff changeset
10 -- intends to confer upon all recipients unlimited rights equal to those
kono
parents:
diff changeset
11 -- held by the ACAA. These rights include rights to use, duplicate,
kono
parents:
diff changeset
12 -- release or disclose the released technical data and computer software
kono
parents:
diff changeset
13 -- in whole or in part, in any manner and for any purpose whatsoever, and
kono
parents:
diff changeset
14 -- to have or permit others to do so.
kono
parents:
diff changeset
15 --
kono
parents:
diff changeset
16 -- DISCLAIMER
kono
parents:
diff changeset
17 --
kono
parents:
diff changeset
18 -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
kono
parents:
diff changeset
19 -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
kono
parents:
diff changeset
20 -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
kono
parents:
diff changeset
21 -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
kono
parents:
diff changeset
22 -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
kono
parents:
diff changeset
23 -- PARTICULAR PURPOSE OF SAID MATERIAL.
kono
parents:
diff changeset
24 --*
kono
parents:
diff changeset
25 --
kono
parents:
diff changeset
26 -- OBJECTIVE:
kono
parents:
diff changeset
27 -- Check that Standard_Output can be flushed. Check that 'in' parameters of
kono
parents:
diff changeset
28 -- types Ada.Text_IO.File_Type and Ada.Streams.Stream_IO.File_Type can be
kono
parents:
diff changeset
29 -- flushed. (Defect Report 8652/0051).
kono
parents:
diff changeset
30 --
kono
parents:
diff changeset
31 -- CHANGE HISTORY:
kono
parents:
diff changeset
32 -- 12 FEB 2001 PHL Initial version
kono
parents:
diff changeset
33 -- 16 MAR 2001 RLB Readied for release; fixed Not_Applicable check
kono
parents:
diff changeset
34 -- to terminate test gracefully.
kono
parents:
diff changeset
35 --
kono
parents:
diff changeset
36 --!
kono
parents:
diff changeset
37 with Ada.Streams.Stream_Io;
kono
parents:
diff changeset
38 use Ada.Streams;
kono
parents:
diff changeset
39 with Ada.Text_Io;
kono
parents:
diff changeset
40 with Ada.Wide_Text_Io;
kono
parents:
diff changeset
41 with Report;
kono
parents:
diff changeset
42 use Report;
kono
parents:
diff changeset
43 procedure CXAA019 is
kono
parents:
diff changeset
44
kono
parents:
diff changeset
45 procedure Check (File : in Ada.Text_Io.File_Type) is
kono
parents:
diff changeset
46 begin
kono
parents:
diff changeset
47 Ada.Text_Io.Put_Line
kono
parents:
diff changeset
48 (File, " - CXAA019 About to flush a Text_IO file passed " &
kono
parents:
diff changeset
49 "as 'in' parameter");
kono
parents:
diff changeset
50 Ada.Text_Io.Flush (File);
kono
parents:
diff changeset
51 end Check;
kono
parents:
diff changeset
52
kono
parents:
diff changeset
53 procedure Check (File : in Ada.Wide_Text_Io.File_Type) is
kono
parents:
diff changeset
54 begin
kono
parents:
diff changeset
55 Ada.Wide_Text_Io.Put_Line
kono
parents:
diff changeset
56 (File, " - CXAA019 About to flush a Wide_Text_IO file passed " &
kono
parents:
diff changeset
57 "as 'in' parameter");
kono
parents:
diff changeset
58 Ada.Wide_Text_Io.Flush (File);
kono
parents:
diff changeset
59 end Check;
kono
parents:
diff changeset
60
kono
parents:
diff changeset
61 procedure Check (File : in Stream_Io.File_Type) is
kono
parents:
diff changeset
62 S : Stream_Element_Array (1 .. 10);
kono
parents:
diff changeset
63 begin
kono
parents:
diff changeset
64 for I in S'Range loop
kono
parents:
diff changeset
65 S (I) := Stream_Element (Character'Pos ('A') + I);
kono
parents:
diff changeset
66 end loop;
kono
parents:
diff changeset
67 Stream_Io.Write (File, S);
kono
parents:
diff changeset
68 Comment ("About to flush a Stream_IO file passed as 'in' parameter");
kono
parents:
diff changeset
69 Stream_Io.Flush (File);
kono
parents:
diff changeset
70 end Check;
kono
parents:
diff changeset
71
kono
parents:
diff changeset
72
kono
parents:
diff changeset
73 begin
kono
parents:
diff changeset
74 Test ("CXAA019",
kono
parents:
diff changeset
75 "Check that Standard_Output can be flushed; check that " &
kono
parents:
diff changeset
76 "'in' Ada.Text_IO.File_Type and Ada.Streams.Stream_IO.File_Type" &
kono
parents:
diff changeset
77 "parameters can be flushed");
kono
parents:
diff changeset
78
kono
parents:
diff changeset
79 Ada.Text_Io.Put_Line (Ada.Text_Io.Standard_Output,
kono
parents:
diff changeset
80 " - CXAA019 About to flush Standard_Output");
kono
parents:
diff changeset
81 Ada.Text_Io.Flush (Ada.Text_Io.Standard_Output);
kono
parents:
diff changeset
82
kono
parents:
diff changeset
83 Check (Ada.Text_Io.Current_Output);
kono
parents:
diff changeset
84
kono
parents:
diff changeset
85 declare
kono
parents:
diff changeset
86 TC_OK : Boolean := False;
kono
parents:
diff changeset
87 F : Ada.Text_Io.File_Type;
kono
parents:
diff changeset
88 begin
kono
parents:
diff changeset
89 begin
kono
parents:
diff changeset
90 Ada.Text_Io.Create (F, Name => Legal_File_Name (X => 1));
kono
parents:
diff changeset
91 TC_OK := True;
kono
parents:
diff changeset
92 exception
kono
parents:
diff changeset
93 when others =>
kono
parents:
diff changeset
94 Not_Applicable ("Unable to create Out mode Text_IO file");
kono
parents:
diff changeset
95 end;
kono
parents:
diff changeset
96 if TC_OK then
kono
parents:
diff changeset
97 Check (F);
kono
parents:
diff changeset
98 Ada.Text_Io.Delete (F);
kono
parents:
diff changeset
99 end if;
kono
parents:
diff changeset
100 end;
kono
parents:
diff changeset
101
kono
parents:
diff changeset
102 declare
kono
parents:
diff changeset
103 TC_OK : Boolean := False;
kono
parents:
diff changeset
104 F : Ada.Wide_Text_Io.File_Type;
kono
parents:
diff changeset
105 begin
kono
parents:
diff changeset
106 begin
kono
parents:
diff changeset
107 Ada.Wide_Text_Io.Create (F, Name => Legal_File_Name (X => 2));
kono
parents:
diff changeset
108 TC_OK := True;
kono
parents:
diff changeset
109 exception
kono
parents:
diff changeset
110 when others =>
kono
parents:
diff changeset
111 Not_Applicable ("Unable to create Out mode Wide_Text_IO file");
kono
parents:
diff changeset
112 end;
kono
parents:
diff changeset
113 if TC_OK then
kono
parents:
diff changeset
114 Check (F);
kono
parents:
diff changeset
115 Ada.Wide_Text_Io.Delete (F);
kono
parents:
diff changeset
116 end if;
kono
parents:
diff changeset
117 end;
kono
parents:
diff changeset
118
kono
parents:
diff changeset
119 declare
kono
parents:
diff changeset
120 TC_OK : Boolean := False;
kono
parents:
diff changeset
121 F : Stream_Io.File_Type;
kono
parents:
diff changeset
122 begin
kono
parents:
diff changeset
123 begin
kono
parents:
diff changeset
124 Stream_Io.Create (F, Name => Legal_File_Name (X => 3));
kono
parents:
diff changeset
125 TC_OK := True;
kono
parents:
diff changeset
126 exception
kono
parents:
diff changeset
127 when others =>
kono
parents:
diff changeset
128 Not_Applicable ("Unable to create Out mode Stream_IO file");
kono
parents:
diff changeset
129 end;
kono
parents:
diff changeset
130 if TC_OK then
kono
parents:
diff changeset
131 Check (F);
kono
parents:
diff changeset
132 Stream_Io.Delete (F);
kono
parents:
diff changeset
133 end if;
kono
parents:
diff changeset
134 end;
kono
parents:
diff changeset
135
kono
parents:
diff changeset
136 Result;
kono
parents:
diff changeset
137 end CXAA019;
kono
parents:
diff changeset
138