3 -- Grant of Unlimited Rights
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
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.
27 -- Check that the function Ada.Text_IO.Editing.Valid returns False if
28 -- a) Pic_String is not a well-formed Picture string, or
29 -- b) the length of Pic_String exceeds Max_Picture_Length, or
30 -- c) Blank_When_Zero is True and Pic_String contains '*';
31 -- Check that Valid otherwise returns True.
34 -- This test validates the results of function Editing.Valid under a
35 -- variety of conditions. Both valid and invalid picture strings are
36 -- provided as input parameters to the function. The use of the
37 -- Blank_When_Zero parameter is evaluated with strings that contain the
38 -- zero suppression character '*'.
41 -- The following files comprise this test:
43 -- FXF3A00.A (foundation code)
48 -- 06 Dec 94 SAIC ACVC 2.0
53 with Ada
.Text_IO
.Editing
;
59 Report
.Test
("CXF3A01", "Check that the Valid function from package " &
60 "Ada.Text_IO.Editing returns False for strings " &
61 "that fail to comply with the composition " &
62 "constraints defined for picture strings. " &
63 "Check that the Valid function returns True " &
64 "for strings that conform to the composition " &
65 "constraints defined for picture strings");
73 -- Use a series of picture strings that conform to the composition
74 -- constraints to validate the Ada.Text_IO.Editing.Valid function.
75 -- The result for each of these calls should be True.
76 -- In all the following cases, the default value of the Blank_When_Zero
79 for i
in 1..FXF3A00
.Number_Of_Valid_Strings
loop
81 if not Editing
.Valid
(Pic_String
=> FXF3A00
.Valid_Strings
(i
).all)
83 Report
.Failed
("Incorrect result from Function Valid using " &
84 "Valid_String = " & FXF3A00
.Valid_Strings
(i
).all);
90 for i
in 1..FXF3A00
.Number_Of_Foreign_Strings
loop
92 if not Editing
.Valid
(Pic_String
=> FXF3A00
.Foreign_Strings
(i
).all)
94 Report
.Failed
("Incorrect result from Function Valid using " &
96 FXF3A00
.Foreign_Strings
(i
).all);
102 -- Use a series of picture strings that violate one or more of the
103 -- composition constraints to validate the Ada.Text_IO.Editing.Valid
104 -- function. The result for each of these calls should be False.
105 -- In all the following cases, the default value of the Blank_When_Zero
106 -- parameter is used.
108 for i
in 1..FXF3A00
.Number_Of_Invalid_Strings
loop
110 if Editing
.Valid
(Pic_String
=> FXF3A00
.Invalid_Strings
(i
).all)
112 Report
.Failed
("Incorrect result from Function Valid using " &
113 "Invalid_String = " &
114 FXF3A00
.Invalid_Strings
(i
).all);
120 -- In all the following cases, the default value of the Blank_When_Zero
121 -- parameter is overridden with a True actual parameter value. Using
122 -- valid picture strings that contain the '*' zero suppression character
123 -- when this parameter value is True must result in a False result
124 -- from function Valid. Valid picture strings that do not contain the
125 -- '*' character should return a function result of True with True
126 -- provided as the actual parameter to Blank_When_Zero.
128 -- Check entries 1, 2, 25, 36 from the Valid_Strings array, all of
129 -- which contain the '*' zero suppression character.
131 if Editing
.Valid
(Valid_Strings
(1).all, Blank_When_Zero
=> True) or
132 Editing
.Valid
(Valid_Strings
(2).all, Blank_When_Zero
=> True) or
133 Editing
.Valid
(Valid_Strings
(25).all, Blank_When_Zero
=> True) or
134 Editing
.Valid
(Valid_Strings
(36).all, Blank_When_Zero
=> True)
137 ("Incorrect result from Function Valid when setting " &
138 "the value of the Blank_When_Zero parameter to True, " &
139 "and using picture strings with the '*' character");
143 -- Check entries from the Valid_Strings array, none of
144 -- which contain the '*' zero suppression character.
148 if not Editing
.Valid
(Pic_String
=> Valid_Strings
(i
).all,
149 Blank_When_Zero
=> True)
151 Report
.Failed
("Incorrect result from Function Valid when " &
152 "setting the value of the Blank_When_Zero " &
153 "parameter to True, and using picture strings " &
154 "without the '*' character, Valid_String = " &
155 FXF3A00
.Valid_Strings
(i
).all);
162 when others => Report
.Failed
("Exception raised in Test_Block");