annotate gcc/testsuite/ada/acats/tests/cxf/cxf3a01.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 -- CXF3A01.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 -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
kono
parents:
diff changeset
6 -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
kono
parents:
diff changeset
7 -- unlimited rights in the software and documentation contained herein.
kono
parents:
diff changeset
8 -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
kono
parents:
diff changeset
9 -- this public release, the Government intends to confer upon all
kono
parents:
diff changeset
10 -- recipients unlimited rights equal to those held by the Government.
kono
parents:
diff changeset
11 -- These rights include rights to use, duplicate, release or disclose the
kono
parents:
diff changeset
12 -- released technical data and computer software in whole or in part, in
kono
parents:
diff changeset
13 -- any manner and for any purpose whatsoever, and to have or permit others
kono
parents:
diff changeset
14 -- 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 the function Ada.Text_IO.Editing.Valid returns False if
kono
parents:
diff changeset
28 -- a) Pic_String is not a well-formed Picture string, or
kono
parents:
diff changeset
29 -- b) the length of Pic_String exceeds Max_Picture_Length, or
kono
parents:
diff changeset
30 -- c) Blank_When_Zero is True and Pic_String contains '*';
kono
parents:
diff changeset
31 -- Check that Valid otherwise returns True.
kono
parents:
diff changeset
32 --
kono
parents:
diff changeset
33 -- TEST DESCRIPTION:
kono
parents:
diff changeset
34 -- This test validates the results of function Editing.Valid under a
kono
parents:
diff changeset
35 -- variety of conditions. Both valid and invalid picture strings are
kono
parents:
diff changeset
36 -- provided as input parameters to the function. The use of the
kono
parents:
diff changeset
37 -- Blank_When_Zero parameter is evaluated with strings that contain the
kono
parents:
diff changeset
38 -- zero suppression character '*'.
kono
parents:
diff changeset
39 --
kono
parents:
diff changeset
40 -- TEST FILES:
kono
parents:
diff changeset
41 -- The following files comprise this test:
kono
parents:
diff changeset
42 --
kono
parents:
diff changeset
43 -- FXF3A00.A (foundation code)
kono
parents:
diff changeset
44 -- => CXF3A01.A
kono
parents:
diff changeset
45 --
kono
parents:
diff changeset
46 --
kono
parents:
diff changeset
47 -- CHANGE HISTORY:
kono
parents:
diff changeset
48 -- 06 Dec 94 SAIC ACVC 2.0
kono
parents:
diff changeset
49 --
kono
parents:
diff changeset
50 --!
kono
parents:
diff changeset
51
kono
parents:
diff changeset
52 with FXF3A00;
kono
parents:
diff changeset
53 with Ada.Text_IO.Editing;
kono
parents:
diff changeset
54 with Report;
kono
parents:
diff changeset
55
kono
parents:
diff changeset
56 procedure CXF3A01 is
kono
parents:
diff changeset
57 begin
kono
parents:
diff changeset
58
kono
parents:
diff changeset
59 Report.Test ("CXF3A01", "Check that the Valid function from package " &
kono
parents:
diff changeset
60 "Ada.Text_IO.Editing returns False for strings " &
kono
parents:
diff changeset
61 "that fail to comply with the composition " &
kono
parents:
diff changeset
62 "constraints defined for picture strings. " &
kono
parents:
diff changeset
63 "Check that the Valid function returns True " &
kono
parents:
diff changeset
64 "for strings that conform to the composition " &
kono
parents:
diff changeset
65 "constraints defined for picture strings");
kono
parents:
diff changeset
66
kono
parents:
diff changeset
67 Test_Block:
kono
parents:
diff changeset
68 declare
kono
parents:
diff changeset
69 use FXF3A00;
kono
parents:
diff changeset
70 use Ada.Text_IO;
kono
parents:
diff changeset
71 begin
kono
parents:
diff changeset
72
kono
parents:
diff changeset
73 -- Use a series of picture strings that conform to the composition
kono
parents:
diff changeset
74 -- constraints to validate the Ada.Text_IO.Editing.Valid function.
kono
parents:
diff changeset
75 -- The result for each of these calls should be True.
kono
parents:
diff changeset
76 -- In all the following cases, the default value of the Blank_When_Zero
kono
parents:
diff changeset
77 -- parameter is used.
kono
parents:
diff changeset
78
kono
parents:
diff changeset
79 for i in 1..FXF3A00.Number_Of_Valid_Strings loop
kono
parents:
diff changeset
80
kono
parents:
diff changeset
81 if not Editing.Valid(Pic_String => FXF3A00.Valid_Strings(i).all)
kono
parents:
diff changeset
82 then
kono
parents:
diff changeset
83 Report.Failed("Incorrect result from Function Valid using " &
kono
parents:
diff changeset
84 "Valid_String = " & FXF3A00.Valid_Strings(i).all);
kono
parents:
diff changeset
85 end if;
kono
parents:
diff changeset
86
kono
parents:
diff changeset
87 end loop;
kono
parents:
diff changeset
88
kono
parents:
diff changeset
89
kono
parents:
diff changeset
90 for i in 1..FXF3A00.Number_Of_Foreign_Strings loop
kono
parents:
diff changeset
91
kono
parents:
diff changeset
92 if not Editing.Valid(Pic_String => FXF3A00.Foreign_Strings(i).all)
kono
parents:
diff changeset
93 then
kono
parents:
diff changeset
94 Report.Failed("Incorrect result from Function Valid using " &
kono
parents:
diff changeset
95 "Foreign_String = " &
kono
parents:
diff changeset
96 FXF3A00.Foreign_Strings(i).all);
kono
parents:
diff changeset
97 end if;
kono
parents:
diff changeset
98
kono
parents:
diff changeset
99 end loop;
kono
parents:
diff changeset
100
kono
parents:
diff changeset
101
kono
parents:
diff changeset
102 -- Use a series of picture strings that violate one or more of the
kono
parents:
diff changeset
103 -- composition constraints to validate the Ada.Text_IO.Editing.Valid
kono
parents:
diff changeset
104 -- function. The result for each of these calls should be False.
kono
parents:
diff changeset
105 -- In all the following cases, the default value of the Blank_When_Zero
kono
parents:
diff changeset
106 -- parameter is used.
kono
parents:
diff changeset
107
kono
parents:
diff changeset
108 for i in 1..FXF3A00.Number_Of_Invalid_Strings loop
kono
parents:
diff changeset
109
kono
parents:
diff changeset
110 if Editing.Valid(Pic_String => FXF3A00.Invalid_Strings(i).all)
kono
parents:
diff changeset
111 then
kono
parents:
diff changeset
112 Report.Failed("Incorrect result from Function Valid using " &
kono
parents:
diff changeset
113 "Invalid_String = " &
kono
parents:
diff changeset
114 FXF3A00.Invalid_Strings(i).all);
kono
parents:
diff changeset
115 end if;
kono
parents:
diff changeset
116
kono
parents:
diff changeset
117 end loop;
kono
parents:
diff changeset
118
kono
parents:
diff changeset
119
kono
parents:
diff changeset
120 -- In all the following cases, the default value of the Blank_When_Zero
kono
parents:
diff changeset
121 -- parameter is overridden with a True actual parameter value. Using
kono
parents:
diff changeset
122 -- valid picture strings that contain the '*' zero suppression character
kono
parents:
diff changeset
123 -- when this parameter value is True must result in a False result
kono
parents:
diff changeset
124 -- from function Valid. Valid picture strings that do not contain the
kono
parents:
diff changeset
125 -- '*' character should return a function result of True with True
kono
parents:
diff changeset
126 -- provided as the actual parameter to Blank_When_Zero.
kono
parents:
diff changeset
127
kono
parents:
diff changeset
128 -- Check entries 1, 2, 25, 36 from the Valid_Strings array, all of
kono
parents:
diff changeset
129 -- which contain the '*' zero suppression character.
kono
parents:
diff changeset
130
kono
parents:
diff changeset
131 if Editing.Valid(Valid_Strings(1).all, Blank_When_Zero => True) or
kono
parents:
diff changeset
132 Editing.Valid(Valid_Strings(2).all, Blank_When_Zero => True) or
kono
parents:
diff changeset
133 Editing.Valid(Valid_Strings(25).all, Blank_When_Zero => True) or
kono
parents:
diff changeset
134 Editing.Valid(Valid_Strings(36).all, Blank_When_Zero => True)
kono
parents:
diff changeset
135 then
kono
parents:
diff changeset
136 Report.Failed
kono
parents:
diff changeset
137 ("Incorrect result from Function Valid when setting " &
kono
parents:
diff changeset
138 "the value of the Blank_When_Zero parameter to True, " &
kono
parents:
diff changeset
139 "and using picture strings with the '*' character");
kono
parents:
diff changeset
140 end if;
kono
parents:
diff changeset
141
kono
parents:
diff changeset
142
kono
parents:
diff changeset
143 -- Check entries from the Valid_Strings array, none of
kono
parents:
diff changeset
144 -- which contain the '*' zero suppression character.
kono
parents:
diff changeset
145
kono
parents:
diff changeset
146 for i in 3..24 loop
kono
parents:
diff changeset
147
kono
parents:
diff changeset
148 if not Editing.Valid(Pic_String => Valid_Strings(i).all,
kono
parents:
diff changeset
149 Blank_When_Zero => True)
kono
parents:
diff changeset
150 then
kono
parents:
diff changeset
151 Report.Failed("Incorrect result from Function Valid when " &
kono
parents:
diff changeset
152 "setting the value of the Blank_When_Zero " &
kono
parents:
diff changeset
153 "parameter to True, and using picture strings " &
kono
parents:
diff changeset
154 "without the '*' character, Valid_String = " &
kono
parents:
diff changeset
155 FXF3A00.Valid_Strings(i).all);
kono
parents:
diff changeset
156 end if;
kono
parents:
diff changeset
157
kono
parents:
diff changeset
158 end loop;
kono
parents:
diff changeset
159
kono
parents:
diff changeset
160
kono
parents:
diff changeset
161 exception
kono
parents:
diff changeset
162 when others => Report.Failed ("Exception raised in Test_Block");
kono
parents:
diff changeset
163 end Test_Block;
kono
parents:
diff changeset
164
kono
parents:
diff changeset
165 Report.Result;
kono
parents:
diff changeset
166
kono
parents:
diff changeset
167 end CXF3A01;