annotate gcc/testsuite/ada/acats/tests/cxf/cxf3a03.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 -- CXF3A03.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 function Length in the generic package Decimal_Output
kono
parents:
diff changeset
28 -- returns the number of characters in the edited output string
kono
parents:
diff changeset
29 -- produced by function Image, for a particular decimal type,
kono
parents:
diff changeset
30 -- currency string, and radix mark.
kono
parents:
diff changeset
31 -- Check that function Valid in the generic package Decimal_Output
kono
parents:
diff changeset
32 -- returns correct results based on the particular decimal value,
kono
parents:
diff changeset
33 -- and the Picture and Currency string parameters.
kono
parents:
diff changeset
34 --
kono
parents:
diff changeset
35 -- TEST DESCRIPTION:
kono
parents:
diff changeset
36 -- This test uses two instantiations of package Decimal_Output, one
kono
parents:
diff changeset
37 -- for decimal data with delta 0.01, the other for decimal data with
kono
parents:
diff changeset
38 -- delta 1.0. The functions Length and Valid found in this generic
kono
parents:
diff changeset
39 -- package are evaluated for each instantiation.
kono
parents:
diff changeset
40 -- Function Length is examined with picture and currency string input
kono
parents:
diff changeset
41 -- parameters of different sizes.
kono
parents:
diff changeset
42 -- Function Valid is examined with a decimal type data item, picture
kono
parents:
diff changeset
43 -- object, and currency string, for cases that are both valid and
kono
parents:
diff changeset
44 -- invalid (Layout_Error would result from the particular items as
kono
parents:
diff changeset
45 -- input parameters to function Image).
kono
parents:
diff changeset
46 --
kono
parents:
diff changeset
47 -- TEST FILES:
kono
parents:
diff changeset
48 -- The following files comprise this test:
kono
parents:
diff changeset
49 --
kono
parents:
diff changeset
50 -- FXF3A00.A (foundation code)
kono
parents:
diff changeset
51 -- => CXF3A03.A
kono
parents:
diff changeset
52 --
kono
parents:
diff changeset
53 --
kono
parents:
diff changeset
54 -- CHANGE HISTORY:
kono
parents:
diff changeset
55 -- 06 Dec 94 SAIC ACVC 2.0
kono
parents:
diff changeset
56 --
kono
parents:
diff changeset
57 --!
kono
parents:
diff changeset
58
kono
parents:
diff changeset
59 with FXF3A00;
kono
parents:
diff changeset
60 with Ada.Text_IO.Editing;
kono
parents:
diff changeset
61 with Report;
kono
parents:
diff changeset
62
kono
parents:
diff changeset
63 procedure CXF3A03 is
kono
parents:
diff changeset
64 begin
kono
parents:
diff changeset
65
kono
parents:
diff changeset
66 Report.Test ("CXF3A03", "Check that function Length returns the " &
kono
parents:
diff changeset
67 "number of characters in the edited output " &
kono
parents:
diff changeset
68 "string produced by function Image, for a " &
kono
parents:
diff changeset
69 "particular decimal type, currency string, " &
kono
parents:
diff changeset
70 "and radix mark. Check that function Valid " &
kono
parents:
diff changeset
71 "returns correct results based on the " &
kono
parents:
diff changeset
72 "particular decimal value, and the Picture " &
kono
parents:
diff changeset
73 "and Currency string parameters");
kono
parents:
diff changeset
74
kono
parents:
diff changeset
75 Test_Block:
kono
parents:
diff changeset
76 declare
kono
parents:
diff changeset
77
kono
parents:
diff changeset
78 use Ada.Text_IO;
kono
parents:
diff changeset
79 use FXF3A00;
kono
parents:
diff changeset
80
kono
parents:
diff changeset
81 type Instantiation_Type is (NDP, TwoDP);
kono
parents:
diff changeset
82
kono
parents:
diff changeset
83 -- Defaults used for all other generic parameters in these
kono
parents:
diff changeset
84 -- instantiations.
kono
parents:
diff changeset
85 package Pack_NDP is new Editing.Decimal_Output (Decimal_Type_NDP);
kono
parents:
diff changeset
86 package Pack_2DP is new Editing.Decimal_Output (Decimal_Type_2DP);
kono
parents:
diff changeset
87
kono
parents:
diff changeset
88 TC_Lower_Bound,
kono
parents:
diff changeset
89 TC_Higher_Bound : Integer := 0;
kono
parents:
diff changeset
90
kono
parents:
diff changeset
91 TC_Picture : Editing.Picture;
kono
parents:
diff changeset
92 TC_US_String : constant String := "$";
kono
parents:
diff changeset
93 TC_FF_String : constant String := "FF";
kono
parents:
diff changeset
94 TC_DM_String : constant String := "DM";
kono
parents:
diff changeset
95 TC_CHF_String : constant String := "CHF";
kono
parents:
diff changeset
96
kono
parents:
diff changeset
97
kono
parents:
diff changeset
98 function Dollar_Sign_Present (Str : String) return Boolean is
kono
parents:
diff changeset
99 begin
kono
parents:
diff changeset
100 for i in 1..Str'Length loop
kono
parents:
diff changeset
101 if Str(i) = '$' then
kono
parents:
diff changeset
102 return True;
kono
parents:
diff changeset
103 end if;
kono
parents:
diff changeset
104 end loop;
kono
parents:
diff changeset
105 return False;
kono
parents:
diff changeset
106 end Dollar_Sign_Present;
kono
parents:
diff changeset
107
kono
parents:
diff changeset
108 function V_Present (Str : String) return Boolean is
kono
parents:
diff changeset
109 begin
kono
parents:
diff changeset
110 for i in 1..Str'Length loop
kono
parents:
diff changeset
111 if Str(i) = 'V' or Str(i) = 'v' then
kono
parents:
diff changeset
112 return True;
kono
parents:
diff changeset
113 end if;
kono
parents:
diff changeset
114 end loop;
kono
parents:
diff changeset
115 return False;
kono
parents:
diff changeset
116 end V_Present;
kono
parents:
diff changeset
117
kono
parents:
diff changeset
118
kono
parents:
diff changeset
119 function Accurate_Length (Pict_Str : String;
kono
parents:
diff changeset
120 Inst : Instantiation_Type;
kono
parents:
diff changeset
121 Currency_String : String)
kono
parents:
diff changeset
122 return Boolean is
kono
parents:
diff changeset
123
kono
parents:
diff changeset
124 TC_Length : Natural := 0;
kono
parents:
diff changeset
125 TC_Currency_Length_Adjustment : Natural := 0;
kono
parents:
diff changeset
126 TC_Radix_Adjustment : Natural := 0;
kono
parents:
diff changeset
127 begin
kono
parents:
diff changeset
128
kono
parents:
diff changeset
129 -- Create the picture object from the picture string.
kono
parents:
diff changeset
130 TC_Picture := Editing.To_Picture(Pict_Str);
kono
parents:
diff changeset
131
kono
parents:
diff changeset
132 -- Calculate the currency length adjustment.
kono
parents:
diff changeset
133 if Dollar_Sign_Present (Editing.Pic_String(TC_Picture)) then
kono
parents:
diff changeset
134 TC_Currency_Length_Adjustment := Currency_String'Length - 1;
kono
parents:
diff changeset
135 end if;
kono
parents:
diff changeset
136
kono
parents:
diff changeset
137 -- Calculate the Radix adjustment.
kono
parents:
diff changeset
138 if V_Present (Editing.Pic_String(TC_Picture)) then
kono
parents:
diff changeset
139 TC_Radix_Adjustment := 1;
kono
parents:
diff changeset
140 end if;
kono
parents:
diff changeset
141
kono
parents:
diff changeset
142 -- Calculate the length, using the version of Length that comes
kono
parents:
diff changeset
143 -- from the appropriate instantiation of Decimal_Output, based
kono
parents:
diff changeset
144 -- on the decimal type used in the instantiation.
kono
parents:
diff changeset
145 if Inst = NDP then
kono
parents:
diff changeset
146 TC_Length := Pack_NDP.Length(TC_Picture,
kono
parents:
diff changeset
147 Currency_String);
kono
parents:
diff changeset
148 else
kono
parents:
diff changeset
149 TC_Length := Pack_2DP.Length(TC_Picture,
kono
parents:
diff changeset
150 Currency_String);
kono
parents:
diff changeset
151 end if;
kono
parents:
diff changeset
152
kono
parents:
diff changeset
153 return TC_Length = Editing.Pic_String(TC_Picture)'Length +
kono
parents:
diff changeset
154 TC_Currency_Length_Adjustment -
kono
parents:
diff changeset
155 TC_Radix_Adjustment;
kono
parents:
diff changeset
156 end Accurate_Length;
kono
parents:
diff changeset
157
kono
parents:
diff changeset
158
kono
parents:
diff changeset
159 begin
kono
parents:
diff changeset
160
kono
parents:
diff changeset
161 Length_Block:
kono
parents:
diff changeset
162 begin
kono
parents:
diff changeset
163
kono
parents:
diff changeset
164 -- The first 10 picture strings in the Valid_Strings array correspond
kono
parents:
diff changeset
165 -- to data values of a decimal type with delta 0.01.
kono
parents:
diff changeset
166 -- Note: The appropriate instantiation of the Decimal_Output package
kono
parents:
diff changeset
167 -- (and therefore function Length) is used by function
kono
parents:
diff changeset
168 -- Accurate_Length to calculate length.
kono
parents:
diff changeset
169
kono
parents:
diff changeset
170 for i in 1..10 loop
kono
parents:
diff changeset
171 if not Accurate_Length (FXF3A00.Valid_Strings(i).all,
kono
parents:
diff changeset
172 TwoDP,
kono
parents:
diff changeset
173 TC_US_String)
kono
parents:
diff changeset
174 then
kono
parents:
diff changeset
175 Report.Failed("Incorrect result from function Length, " &
kono
parents:
diff changeset
176 "when used with a decimal type with delta .01 " &
kono
parents:
diff changeset
177 "and with the currency string " & TC_US_String &
kono
parents:
diff changeset
178 " in evaluating picture string " &
kono
parents:
diff changeset
179 FXF3A00.Valid_Strings(i).all );
kono
parents:
diff changeset
180 end if;
kono
parents:
diff changeset
181 end loop;
kono
parents:
diff changeset
182
kono
parents:
diff changeset
183
kono
parents:
diff changeset
184 -- Picture strings 17-20 in the Valid_Strings array correspond
kono
parents:
diff changeset
185 -- to data values of a decimal type with delta 1.0. Again, the
kono
parents:
diff changeset
186 -- instantiation of Decimal_Output used is based on this particular
kono
parents:
diff changeset
187 -- decimal type.
kono
parents:
diff changeset
188
kono
parents:
diff changeset
189 for i in 17..20 loop
kono
parents:
diff changeset
190 if not Accurate_Length (FXF3A00.Valid_Strings(i).all,
kono
parents:
diff changeset
191 NDP,
kono
parents:
diff changeset
192 TC_US_String)
kono
parents:
diff changeset
193 then
kono
parents:
diff changeset
194 Report.Failed("Incorrect result from function Length, " &
kono
parents:
diff changeset
195 "when used with a decimal type with delta 1.0 " &
kono
parents:
diff changeset
196 "and with the currency string " & TC_US_String &
kono
parents:
diff changeset
197 " in evaluating picture string " &
kono
parents:
diff changeset
198 FXF3A00.Valid_Strings(i).all );
kono
parents:
diff changeset
199 end if;
kono
parents:
diff changeset
200 end loop;
kono
parents:
diff changeset
201
kono
parents:
diff changeset
202
kono
parents:
diff changeset
203 -- The first 4 picture strings in the Foreign_Strings array
kono
parents:
diff changeset
204 -- correspond to data values of a decimal type with delta 0.01,
kono
parents:
diff changeset
205 -- and to the currency string "FF" (two characters).
kono
parents:
diff changeset
206
kono
parents:
diff changeset
207 for i in 1..FXF3A00.Number_of_FF_Strings loop
kono
parents:
diff changeset
208 if not Accurate_Length (FXF3A00.Foreign_Strings(i).all,
kono
parents:
diff changeset
209 TwoDP,
kono
parents:
diff changeset
210 TC_FF_String)
kono
parents:
diff changeset
211 then
kono
parents:
diff changeset
212 Report.Failed("Incorrect result from function Length, " &
kono
parents:
diff changeset
213 "when used with a decimal type with delta .01 " &
kono
parents:
diff changeset
214 "and with the currency string " & TC_FF_String &
kono
parents:
diff changeset
215 " in evaluating picture string " &
kono
parents:
diff changeset
216 FXF3A00.Foreign_Strings(i).all );
kono
parents:
diff changeset
217 end if;
kono
parents:
diff changeset
218 end loop;
kono
parents:
diff changeset
219
kono
parents:
diff changeset
220
kono
parents:
diff changeset
221 -- Picture strings 5-9 in the Foreign_Strings array correspond
kono
parents:
diff changeset
222 -- to data values of a decimal type with delta 0.01, and to the
kono
parents:
diff changeset
223 -- currency string "DM" (two characters).
kono
parents:
diff changeset
224
kono
parents:
diff changeset
225 TC_Lower_Bound := FXF3A00.Number_of_FF_Strings + 1;
kono
parents:
diff changeset
226 TC_Higher_Bound := FXF3A00.Number_of_FF_Strings +
kono
parents:
diff changeset
227 FXF3A00.Number_of_DM_Strings;
kono
parents:
diff changeset
228
kono
parents:
diff changeset
229 for i in TC_Lower_Bound..TC_Higher_Bound loop
kono
parents:
diff changeset
230 if not Accurate_Length (FXF3A00.Foreign_Strings(i).all,
kono
parents:
diff changeset
231 TwoDP,
kono
parents:
diff changeset
232 TC_DM_String)
kono
parents:
diff changeset
233 then
kono
parents:
diff changeset
234 Report.Failed("Incorrect result from function Length, " &
kono
parents:
diff changeset
235 "when used with a decimal type with delta .01 " &
kono
parents:
diff changeset
236 "and with the currency string " & TC_DM_String &
kono
parents:
diff changeset
237 " in evaluating picture string " &
kono
parents:
diff changeset
238 FXF3A00.Foreign_Strings(i).all );
kono
parents:
diff changeset
239 end if;
kono
parents:
diff changeset
240 end loop;
kono
parents:
diff changeset
241
kono
parents:
diff changeset
242
kono
parents:
diff changeset
243 -- Picture string #10 in the Foreign_Strings array corresponds
kono
parents:
diff changeset
244 -- to a data value of a decimal type with delta 0.01, and to the
kono
parents:
diff changeset
245 -- currency string "CHF" (three characters).
kono
parents:
diff changeset
246
kono
parents:
diff changeset
247 if not Accurate_Length (FXF3A00.Foreign_Strings(10).all,
kono
parents:
diff changeset
248 TwoDP,
kono
parents:
diff changeset
249 TC_CHF_String)
kono
parents:
diff changeset
250 then
kono
parents:
diff changeset
251 Report.Failed("Incorrect result from function Length, " &
kono
parents:
diff changeset
252 "when used with a decimal type with delta .01 " &
kono
parents:
diff changeset
253 "and with the currency string " &
kono
parents:
diff changeset
254 TC_CHF_String);
kono
parents:
diff changeset
255 end if;
kono
parents:
diff changeset
256
kono
parents:
diff changeset
257 exception
kono
parents:
diff changeset
258 when others =>
kono
parents:
diff changeset
259 Report.Failed("Unexpected exception raised in Length_Block");
kono
parents:
diff changeset
260 end Length_Block;
kono
parents:
diff changeset
261
kono
parents:
diff changeset
262
kono
parents:
diff changeset
263 Valid_Block:
kono
parents:
diff changeset
264 declare
kono
parents:
diff changeset
265
kono
parents:
diff changeset
266 -- This offset value is used to align picture string and decimal
kono
parents:
diff changeset
267 -- data values from package FXF3A00 for proper correspondence for
kono
parents:
diff changeset
268 -- the evaluations below.
kono
parents:
diff changeset
269
kono
parents:
diff changeset
270 TC_Offset : constant Natural := 10;
kono
parents:
diff changeset
271
kono
parents:
diff changeset
272 begin
kono
parents:
diff changeset
273
kono
parents:
diff changeset
274 -- The following four For Loops examine cases where the
kono
parents:
diff changeset
275 -- decimal data/picture string/currency combinations used will
kono
parents:
diff changeset
276 -- generate valid Edited Output strings. These combinations, when
kono
parents:
diff changeset
277 -- provided to the Function Valid (from instantiations of
kono
parents:
diff changeset
278 -- Decimal_Output), should result in a return result of True.
kono
parents:
diff changeset
279 -- The particular instantiated version of Valid used in these loops
kono
parents:
diff changeset
280 -- is that for decimal data with delta 0.01.
kono
parents:
diff changeset
281
kono
parents:
diff changeset
282 -- The first 4 picture strings in the Foreign_Strings array
kono
parents:
diff changeset
283 -- correspond to data values of a decimal type with delta 0.01,
kono
parents:
diff changeset
284 -- and to the currency string "FF" (two characters).
kono
parents:
diff changeset
285
kono
parents:
diff changeset
286 for i in 1..FXF3A00.Number_of_FF_Strings loop
kono
parents:
diff changeset
287 -- Create the picture object from the picture string.
kono
parents:
diff changeset
288 TC_Picture := Editing.To_Picture(FXF3A00.Foreign_Strings(i).all);
kono
parents:
diff changeset
289
kono
parents:
diff changeset
290 if not Pack_2DP.Valid (FXF3A00.Data_With_2DP(TC_Offset + i),
kono
parents:
diff changeset
291 TC_Picture,
kono
parents:
diff changeset
292 TC_FF_String)
kono
parents:
diff changeset
293 then
kono
parents:
diff changeset
294 Report.Failed("Incorrect result from function Valid, " &
kono
parents:
diff changeset
295 "when used with a decimal type with delta .01 " &
kono
parents:
diff changeset
296 "and with the currency string " & TC_FF_String &
kono
parents:
diff changeset
297 " in evaluating picture string " &
kono
parents:
diff changeset
298 FXF3A00.Foreign_Strings(i).all );
kono
parents:
diff changeset
299 end if;
kono
parents:
diff changeset
300 end loop;
kono
parents:
diff changeset
301
kono
parents:
diff changeset
302
kono
parents:
diff changeset
303 -- Picture strings 5-9 in the Foreign_Strings array correspond
kono
parents:
diff changeset
304 -- to data values of a decimal type with delta 0.01, and to the
kono
parents:
diff changeset
305 -- currency string "DM" (two characters).
kono
parents:
diff changeset
306
kono
parents:
diff changeset
307 TC_Lower_Bound := FXF3A00.Number_of_FF_Strings + 1;
kono
parents:
diff changeset
308 TC_Higher_Bound := FXF3A00.Number_of_FF_Strings +
kono
parents:
diff changeset
309 FXF3A00.Number_of_DM_Strings;
kono
parents:
diff changeset
310
kono
parents:
diff changeset
311 for i in TC_Lower_Bound..TC_Higher_Bound loop
kono
parents:
diff changeset
312 -- Create the picture object from the picture string.
kono
parents:
diff changeset
313 TC_Picture := Editing.To_Picture(FXF3A00.Foreign_Strings(i).all);
kono
parents:
diff changeset
314
kono
parents:
diff changeset
315 if not Pack_2DP.Valid (FXF3A00.Data_With_2DP(TC_Offset + i),
kono
parents:
diff changeset
316 TC_Picture,
kono
parents:
diff changeset
317 TC_DM_String)
kono
parents:
diff changeset
318 then
kono
parents:
diff changeset
319 Report.Failed("Incorrect result from function Valid, " &
kono
parents:
diff changeset
320 "when used with a decimal type with delta .01 " &
kono
parents:
diff changeset
321 "and with the currency string " & TC_DM_String &
kono
parents:
diff changeset
322 " in evaluating picture string " &
kono
parents:
diff changeset
323 FXF3A00.Foreign_Strings(i).all );
kono
parents:
diff changeset
324 end if;
kono
parents:
diff changeset
325 end loop;
kono
parents:
diff changeset
326
kono
parents:
diff changeset
327
kono
parents:
diff changeset
328 -- Picture string #10 in the Foreign_Strings array corresponds
kono
parents:
diff changeset
329 -- to a data value of a decimal type with delta 0.01, and to the
kono
parents:
diff changeset
330 -- currency string "CHF" (three characters).
kono
parents:
diff changeset
331
kono
parents:
diff changeset
332 -- Create the picture object from the picture string.
kono
parents:
diff changeset
333 TC_Picture := Editing.To_Picture(FXF3A00.Foreign_Strings(10).all);
kono
parents:
diff changeset
334
kono
parents:
diff changeset
335 if not Pack_2DP.Valid (FXF3A00.Data_With_2DP(TC_Offset + 10),
kono
parents:
diff changeset
336 TC_Picture,
kono
parents:
diff changeset
337 TC_CHF_String)
kono
parents:
diff changeset
338 then
kono
parents:
diff changeset
339 Report.Failed("Incorrect result from function Valid, " &
kono
parents:
diff changeset
340 "when used with a decimal type with delta .01 " &
kono
parents:
diff changeset
341 "and with the currency string " &
kono
parents:
diff changeset
342 TC_CHF_String);
kono
parents:
diff changeset
343 end if;
kono
parents:
diff changeset
344
kono
parents:
diff changeset
345
kono
parents:
diff changeset
346 -- The following For Loop examines cases where the
kono
parents:
diff changeset
347 -- decimal data/picture string/currency combinations used will
kono
parents:
diff changeset
348 -- generate valid Edited Output strings.
kono
parents:
diff changeset
349 -- The particular instantiated version of Valid used in this loop
kono
parents:
diff changeset
350 -- is that for decimal data with delta 1.0; the others above have
kono
parents:
diff changeset
351 -- been for decimal data with delta 0.01.
kono
parents:
diff changeset
352 -- Note: TC_Offset is used here to align picture strings from the
kono
parents:
diff changeset
353 -- FXF3A00.Valid_Strings table with the appropriate decimal
kono
parents:
diff changeset
354 -- data in the FXF3A00.Data_With_NDP table.
kono
parents:
diff changeset
355
kono
parents:
diff changeset
356 for i in 1..FXF3A00.Number_Of_NDP_Items loop
kono
parents:
diff changeset
357 -- Create the picture object from the picture string.
kono
parents:
diff changeset
358 TC_Picture :=
kono
parents:
diff changeset
359 Editing.To_Picture(FXF3A00.Valid_Strings(TC_Offset + i).all);
kono
parents:
diff changeset
360
kono
parents:
diff changeset
361 if not Pack_NDP.Valid (FXF3A00.Data_With_NDP(i),
kono
parents:
diff changeset
362 TC_Picture,
kono
parents:
diff changeset
363 TC_US_String)
kono
parents:
diff changeset
364 then
kono
parents:
diff changeset
365 Report.Failed("Incorrect result from function Valid, " &
kono
parents:
diff changeset
366 "when used with a decimal type with delta .01 " &
kono
parents:
diff changeset
367 "and with the currency string " & TC_US_String &
kono
parents:
diff changeset
368 " in evaluating picture string " &
kono
parents:
diff changeset
369 FXF3A00.Valid_Strings(i).all );
kono
parents:
diff changeset
370 end if;
kono
parents:
diff changeset
371 end loop;
kono
parents:
diff changeset
372
kono
parents:
diff changeset
373
kono
parents:
diff changeset
374 -- The following three evaluations of picture strings, used in
kono
parents:
diff changeset
375 -- conjunction with the specific decimal values provided, will cause
kono
parents:
diff changeset
376 -- Editing.Image to raise Layout_Error (to be examined in other
kono
parents:
diff changeset
377 -- tests). Function Valid should return a False result for these
kono
parents:
diff changeset
378 -- combinations.
kono
parents:
diff changeset
379 -- The first two evaluations use the instantiation of Decimal_Output
kono
parents:
diff changeset
380 -- with a decimal type with delta 0.01, while the last evaluation
kono
parents:
diff changeset
381 -- uses the instantiation with decimal type with delta 1.0.
kono
parents:
diff changeset
382
kono
parents:
diff changeset
383 for i in 1..FXF3A00.Number_of_Erroneous_Conditions loop
kono
parents:
diff changeset
384
kono
parents:
diff changeset
385 -- Create the picture object from the picture string.
kono
parents:
diff changeset
386 TC_Picture :=
kono
parents:
diff changeset
387 Editing.To_Picture(FXF3A00.Erroneous_Strings(i).all);
kono
parents:
diff changeset
388
kono
parents:
diff changeset
389 if i < 3 then -- Choose the appropriate instantiation.
kono
parents:
diff changeset
390 if Pack_2DP.Valid(Item => FXF3A00.Erroneous_Data(i),
kono
parents:
diff changeset
391 Pic => TC_Picture,
kono
parents:
diff changeset
392 Currency => TC_US_String)
kono
parents:
diff changeset
393 then
kono
parents:
diff changeset
394 Report.Failed("Incorrect result from function Valid, " &
kono
parents:
diff changeset
395 "when used with a decimal type with delta " &
kono
parents:
diff changeset
396 "0.01 and with the currency string " &
kono
parents:
diff changeset
397 TC_US_String &
kono
parents:
diff changeset
398 " in evaluating picture string " &
kono
parents:
diff changeset
399 FXF3A00.Valid_Strings(i).all );
kono
parents:
diff changeset
400 end if;
kono
parents:
diff changeset
401 else
kono
parents:
diff changeset
402 if Pack_NDP.Valid(Item => FXF3A00.Decimal_Type_NDP(
kono
parents:
diff changeset
403 FXF3A00.Erroneous_Data(i)),
kono
parents:
diff changeset
404 Pic => TC_Picture,
kono
parents:
diff changeset
405 Currency => TC_US_String)
kono
parents:
diff changeset
406 then
kono
parents:
diff changeset
407 Report.Failed("Incorrect result from function Valid, " &
kono
parents:
diff changeset
408 "when used with a decimal type with delta " &
kono
parents:
diff changeset
409 "1.0 and with the currency string " &
kono
parents:
diff changeset
410 TC_US_String &
kono
parents:
diff changeset
411 " in evaluating picture string " &
kono
parents:
diff changeset
412 FXF3A00.Valid_Strings(i).all );
kono
parents:
diff changeset
413 end if;
kono
parents:
diff changeset
414 end if;
kono
parents:
diff changeset
415 end loop;
kono
parents:
diff changeset
416
kono
parents:
diff changeset
417 exception
kono
parents:
diff changeset
418 when others =>
kono
parents:
diff changeset
419 Report.Failed("Unexpected exception raised in Valid_Block");
kono
parents:
diff changeset
420 end Valid_Block;
kono
parents:
diff changeset
421
kono
parents:
diff changeset
422
kono
parents:
diff changeset
423 exception
kono
parents:
diff changeset
424 when others => Report.Failed ("Exception raised in Test_Block");
kono
parents:
diff changeset
425 end Test_Block;
kono
parents:
diff changeset
426
kono
parents:
diff changeset
427 Report.Result;
kono
parents:
diff changeset
428
kono
parents:
diff changeset
429 end CXF3A03;