1 |
149 |
jeremybenn |
-- FXF3A00.A
|
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 |
|
|
--
|
26 |
|
|
-- FOUNDATION DESCRIPTION:
|
27 |
|
|
-- This foundation contains decimal data values, valid and invalid
|
28 |
|
|
-- Picture strings, and Edited Output result strings that will be used
|
29 |
|
|
-- in tests of Appendix F.3.
|
30 |
|
|
-- Note: In this foundation package, the effect of "Table Driven Data"
|
31 |
|
|
-- is achieved using a series of arrays to hold the various data items.
|
32 |
|
|
-- Since the data items (Picture strings, Edited Output) are often of
|
33 |
|
|
-- different lengths, the arrays are defined to contain pointers to
|
34 |
|
|
-- string values, thereby allowing the "tables" to hold string data of
|
35 |
|
|
-- different sizes.
|
36 |
|
|
--
|
37 |
|
|
-- CHANGE HISTORY:
|
38 |
|
|
-- 06 Dec 94 SAIC ACVC 2.0
|
39 |
|
|
-- 15 Feb 95 SAIC Picture string, decimal data, and edited_output
|
40 |
|
|
-- modifications.
|
41 |
|
|
-- 23 Feb 95 SAIC Picture string modification.
|
42 |
|
|
-- 10 Mar 95 SAIC Added explanatory comments.
|
43 |
|
|
-- 15 Nov 95 SAIC Corrected picture string for ACVC 2.0.1.
|
44 |
|
|
-- 06 Oct 96 SAIC Corrected invalid picture strings.
|
45 |
|
|
-- 13 Feb 97 PWB.CTA Deleted invalid picture string.
|
46 |
|
|
-- 17 Feb 97 PWB.CTA Added leading blank to two picture strings
|
47 |
|
|
--!
|
48 |
|
|
|
49 |
|
|
with Ada.Text_IO.Editing;
|
50 |
|
|
|
51 |
|
|
package FXF3A00 is
|
52 |
|
|
|
53 |
|
|
Number_Of_NDP_Items : constant := 12; -- No Decimal Places.
|
54 |
|
|
Number_Of_2DP_Items : constant := 20; -- Two Decimal Places.
|
55 |
|
|
Number_Of_Valid_Strings : constant := 40;
|
56 |
|
|
Number_Of_FF_Strings : constant := 4; -- French Francs
|
57 |
|
|
Number_Of_DM_Strings : constant := 5; -- Deutchemarks
|
58 |
|
|
Number_Of_CHF_Strings : constant := 1; -- Swiss Francs
|
59 |
|
|
Number_Of_Foreign_Strings : constant := Number_Of_FF_Strings +
|
60 |
|
|
Number_Of_DM_Strings +
|
61 |
|
|
Number_Of_CHF_Strings;
|
62 |
|
|
Number_Of_Invalid_Strings : constant := 25;
|
63 |
|
|
Number_Of_Erroneous_Conditions : constant := 3;
|
64 |
|
|
Number_Of_Edited_Output_Strings : constant := 32;
|
65 |
|
|
|
66 |
|
|
-- The following string is to be used as a picture string with length
|
67 |
|
|
-- beyond the maximum (Max_Picture_Length) that is supported by the
|
68 |
|
|
-- implementation.
|
69 |
|
|
|
70 |
|
|
A_Picture_String_Too_Long : constant
|
71 |
|
|
String (1..Ada.Text_IO.Editing.Max_Picture_Length + 1) := (others => '9');
|
72 |
|
|
|
73 |
|
|
|
74 |
|
|
type Str_Ptr is access String;
|
75 |
|
|
|
76 |
|
|
type Decimal_Type_NDP is delta 1.0 digits 16; -- no decimal places
|
77 |
|
|
type Decimal_Type_2DP is delta 0.01 digits 16; -- two decimal places
|
78 |
|
|
|
79 |
|
|
type Data_Array_Type_1 is array (Integer range <>) of Decimal_Type_NDP;
|
80 |
|
|
type Data_Array_Type_2 is array (Integer range <>) of Decimal_Type_2DP;
|
81 |
|
|
|
82 |
|
|
|
83 |
|
|
type Picture_String_Array_Type is
|
84 |
|
|
array (Integer range <>) of Str_Ptr;
|
85 |
|
|
|
86 |
|
|
type Edited_Output_Results_Array_Type is
|
87 |
|
|
array (Integer range <>) of Str_Ptr;
|
88 |
|
|
|
89 |
|
|
|
90 |
|
|
|
91 |
|
|
Data_With_NDP : Data_Array_Type_1 (1..Number_Of_NDP_Items) :=
|
92 |
|
|
( 1 => 1234.0,
|
93 |
|
|
2 => 51234.0,
|
94 |
|
|
3 => -1234.0,
|
95 |
|
|
4 => 1234.0,
|
96 |
|
|
5 => 1.0,
|
97 |
|
|
6 => 0.0,
|
98 |
|
|
7 => -10.0,
|
99 |
|
|
8 => -1.0,
|
100 |
|
|
9 => 1234.0,
|
101 |
|
|
10 => 1.0,
|
102 |
|
|
11 => 36.0,
|
103 |
|
|
12 => 0.0
|
104 |
|
|
);
|
105 |
|
|
|
106 |
|
|
|
107 |
|
|
Data_With_2DP : Data_Array_Type_2 (1..Number_Of_2DP_Items) :=
|
108 |
|
|
( 1 => 123456.78,
|
109 |
|
|
2 => 123456.78,
|
110 |
|
|
3 => 0.0,
|
111 |
|
|
4 => 0.20,
|
112 |
|
|
5 => 123456.00,
|
113 |
|
|
6 => -123456.78,
|
114 |
|
|
7 => 123456.78,
|
115 |
|
|
8 => -12.34,
|
116 |
|
|
9 => 1.23,
|
117 |
|
|
10 => 12.34,
|
118 |
|
|
|
119 |
|
|
-- Items 11-20 are used with picture strings in evaluating use of
|
120 |
|
|
-- foreign currency symbols.
|
121 |
|
|
|
122 |
|
|
11 => 123456.78,
|
123 |
|
|
12 => 123456.78,
|
124 |
|
|
13 => 32.10,
|
125 |
|
|
14 => -5432.10,
|
126 |
|
|
15 => -1234.57,
|
127 |
|
|
16 => 123456.78,
|
128 |
|
|
17 => 12.34,
|
129 |
|
|
18 => 12.34,
|
130 |
|
|
19 => 1.23,
|
131 |
|
|
20 => 12345.67
|
132 |
|
|
);
|
133 |
|
|
|
134 |
|
|
|
135 |
|
|
|
136 |
|
|
Valid_Strings : Picture_String_Array_Type
|
137 |
|
|
(1..Number_Of_Valid_Strings) :=
|
138 |
|
|
|
139 |
|
|
-- Items 1-10 are used in conjunction with Data_With_2DP values
|
140 |
|
|
-- to produce edited output strings, as well as in tests of
|
141 |
|
|
-- function Valid.
|
142 |
|
|
|
143 |
|
|
( 1 => new String'("-###**_***_**9.99"),
|
144 |
|
|
2 => new String'("-$**_***_**9.99"),
|
145 |
|
|
3 => new String'("-$$$$$$.$$"),
|
146 |
|
|
4 => new String'("-$$$$$$.$$"),
|
147 |
|
|
5 => new String'("+BBBZZ_ZZZ_ZZZ.ZZ"),
|
148 |
|
|
6 => new String'("--_---_---_--9"),
|
149 |
|
|
7 => new String'("-$_$$$_$$$_$$9.99"),
|
150 |
|
|
8 => new String'("<$$_$$$9.99>"),
|
151 |
|
|
9 => new String'("$_$$9.99"),
|
152 |
|
|
10 => new String'("$$9.99"),
|
153 |
|
|
|
154 |
|
|
-- Items 11-22 are used in conjunction with Data_With_NDP values
|
155 |
|
|
-- to produce edited output strings.
|
156 |
|
|
|
157 |
|
|
11 => new String'("ZZZZ9"),
|
158 |
|
|
12 => new String'("ZZZZ9"),
|
159 |
|
|
13 => new String'("<#Z_ZZ9>"),
|
160 |
|
|
14 => new String'("<#Z_ZZ9>"),
|
161 |
|
|
15 => new String'("ZZZ.ZZ"),
|
162 |
|
|
16 => new String'("ZZZ.ZZ"),
|
163 |
|
|
17 => new String'("<###99>"),
|
164 |
|
|
18 => new String'("ZZZZZ-"),
|
165 |
|
|
19 => new String'("$$$$9"),
|
166 |
|
|
20 => new String'("$$$$$"),
|
167 |
|
|
21 => new String'("<###99>"),
|
168 |
|
|
22 => new String'("$$$$9"),
|
169 |
|
|
|
170 |
|
|
-- Items 23-40 are used in validation of the Valid, To_Picture, and
|
171 |
|
|
-- Pic_String subprograms of package Text_IO.Editing, and are not
|
172 |
|
|
-- used to generate edited output.
|
173 |
|
|
|
174 |
|
|
23 => new String'("zZzZzZzZzZzZzZzZzZ"),
|
175 |
|
|
24 => new String'("999999999999999999"),
|
176 |
|
|
25 => new String'("******************"),
|
177 |
|
|
26 => new String'("$$$$$$$$$$$$$$$$$$"),
|
178 |
|
|
27 => new String'("9999/9999B9999_999909999"),
|
179 |
|
|
28 => new String'("+999999999999999999"),
|
180 |
|
|
29 => new String'("-999999999999999999"),
|
181 |
|
|
30 => new String'("999999999999999999+"),
|
182 |
|
|
31 => new String'("999999999999999999-"),
|
183 |
|
|
32 => new String'("<<<_<<<_<<<_<<<_<<<_<<9>"),
|
184 |
|
|
33 => new String'("++++++++++++++++++++"),
|
185 |
|
|
34 => new String'("--------------------"),
|
186 |
|
|
35 => new String'("zZzZzZzZzZzZzZzZzZ.zZ"),
|
187 |
|
|
36 => new String'("******************.99"),
|
188 |
|
|
37 => new String'("$$$$$$$$$$$$$$$$$$.99"),
|
189 |
|
|
|
190 |
|
|
-- The following string has length 30, which is the minimum value
|
191 |
|
|
-- that must be supported for Max_Picture_Length.
|
192 |
|
|
|
193 |
|
|
38 => new String'("9_999_999_999_999_999_999BB.99"),
|
194 |
|
|
39 => new String'("<<<_<<<_<<<_<<<.99>"),
|
195 |
|
|
40 => new String'("ZZZZZZZZZZZZZZZZZ+")
|
196 |
|
|
);
|
197 |
|
|
|
198 |
|
|
|
199 |
|
|
|
200 |
|
|
Foreign_Strings : Picture_String_Array_Type
|
201 |
|
|
(1..Number_Of_Foreign_Strings) :=
|
202 |
|
|
|
203 |
|
|
-- These strings are going to be used in conjunction with non-default
|
204 |
|
|
-- values for Currency string, Radix mark, and Separator in calls to
|
205 |
|
|
-- Image and Put, as well as in tests of function Valid.
|
206 |
|
|
|
207 |
|
|
( 1 => new String'("-###**_***_**9.99"), -- FF
|
208 |
|
|
2 => new String'("-$**_***_**9.99"), -- FF
|
209 |
|
|
3 => new String'("<###z_ZZ9.99>"), -- FF
|
210 |
|
|
4 => new String'("<###Z_ZZ9.99>"), -- FF
|
211 |
|
|
5 => new String'("<<<<_<<<.<<###>"), -- DM
|
212 |
|
|
6 => new String'("-$_$$$_$$$_$$9.99"), -- DM
|
213 |
|
|
7 => new String'("$z99.99"), -- DM
|
214 |
|
|
8 => new String'("$$$9.99"), -- DM
|
215 |
|
|
9 => new String'("$_$$9.99"), -- DM
|
216 |
|
|
10 => new String'("###_###_##9.99") -- CHF
|
217 |
|
|
);
|
218 |
|
|
|
219 |
|
|
|
220 |
|
|
|
221 |
|
|
Invalid_Strings : Picture_String_Array_Type
|
222 |
|
|
(1..Number_Of_Invalid_Strings) :=
|
223 |
|
|
--
|
224 |
|
|
-- The RM references to the right of these invalid picture strings
|
225 |
|
|
-- indicates which of the composition constraints of picture strings
|
226 |
|
|
-- is violated by the particular string (and all following strings
|
227 |
|
|
-- until another reference is presented). However, certain strings
|
228 |
|
|
-- violate multiple of the constraints.
|
229 |
|
|
--
|
230 |
|
|
( 1 => new String'("<<<"),
|
231 |
|
|
2 => new String'("<<>>"),
|
232 |
|
|
3 => new String'("<<<9_B0/$DB"),
|
233 |
|
|
4 => new String'("+BB"),
|
234 |
|
|
5 => new String'("<-"),
|
235 |
|
|
6 => new String'("
|
236 |
|
|
7 => new String'("
|
237 |
|
|
8 => new String'("<
|
238 |
|
|
9 => new String'("<<__DB"),
|
239 |
|
|
10 => new String'("<<<++++_++-"),
|
240 |
|
|
11 => new String'("-999.99>"),
|
241 |
|
|
12 => new String'("+++9.99+"),
|
242 |
|
|
13 => new String'("++++>>"),
|
243 |
|
|
14 => new String'("->"),
|
244 |
|
|
15 => new String'("++9-"),
|
245 |
|
|
16 => new String'("---999999->"),
|
246 |
|
|
17 => new String'("+++-"),
|
247 |
|
|
18 => new String'("+++_+++_+.--"),
|
248 |
|
|
19 => new String'("--B.BB+>"),
|
249 |
|
|
20 => new String'("$$#$"),
|
250 |
|
|
21 => new String'("#B$$$$"),
|
251 |
|
|
22 => new String'("**Z"),
|
252 |
|
|
23 => new String'("ZZZzzz*"),
|
253 |
|
|
24 => new String'("9.99DB(2)"),
|
254 |
|
|
25 => new String'(A_Picture_String_Too_Long)
|
255 |
|
|
);
|
256 |
|
|
|
257 |
|
|
|
258 |
|
|
Edited_Output : Edited_Output_Results_Array_Type
|
259 |
|
|
(1..Number_Of_Edited_Output_Strings) :=
|
260 |
|
|
|
261 |
|
|
-- The following 10 edited output strings result from the first 10
|
262 |
|
|
-- valid strings when used with the first 10 Data_With_2DP numeric
|
263 |
|
|
-- values.
|
264 |
|
|
( 1 => new String'(" $***123,456.78"),
|
265 |
|
|
2 => new String'(" $***123,456.78"),
|
266 |
|
|
3 => new String'(" "),
|
267 |
|
|
4 => new String'(" $.20"),
|
268 |
|
|
5 => new String'("+ 123,456.00"),
|
269 |
|
|
6 => new String'(" -123,457"),
|
270 |
|
|
7 => new String'(" $123,456.78"),
|
271 |
|
|
8 => new String'("( $12.34)"),
|
272 |
|
|
9 => new String'(" $1.23"),
|
273 |
|
|
10 => new String'("$12.34"),
|
274 |
|
|
|
275 |
|
|
-- The following 10 edited output strings correspond to the 10 foreign
|
276 |
|
|
-- currency picture strings (the currency string is supplied at the
|
277 |
|
|
-- time of the call to Editing.Image or Editing.Put), when used in
|
278 |
|
|
-- conjunction with Data_With_2DP items 11-20
|
279 |
|
|
|
280 |
|
|
11 => new String'(" FF***123.456,78"),
|
281 |
|
|
12 => new String'(" FF***123.456,78"),
|
282 |
|
|
13 => new String'(" FF 32,10 "),
|
283 |
|
|
14 => new String'("( FF5.432,10)"),
|
284 |
|
|
15 => new String'(" (1,234.57DM )"),
|
285 |
|
|
16 => new String'(" DM123,456.78"),
|
286 |
|
|
17 => new String'("DM 12.34"),
|
287 |
|
|
18 => new String'(" DM12.34"),
|
288 |
|
|
19 => new String'(" DM1.23"),
|
289 |
|
|
20 => new String'(" CHF12,345.67"),
|
290 |
|
|
|
291 |
|
|
-- The following 12 edited output strings correspond to the 12
|
292 |
|
|
-- Data_With_NDP items formatted using Valid_String items 11-22.
|
293 |
|
|
-- This combination shows decimal data with no decimal places
|
294 |
|
|
-- formatted using picture strings.
|
295 |
|
|
|
296 |
|
|
21 => new String'(" 1234"),
|
297 |
|
|
22 => new String'("51234"),
|
298 |
|
|
23 => new String'("($1,234)"),
|
299 |
|
|
24 => new String'(" $1,234 "),
|
300 |
|
|
25 => new String'(" 1.00"),
|
301 |
|
|
26 => new String'(" "),
|
302 |
|
|
27 => new String'("( $10)"),
|
303 |
|
|
28 => new String'(" 1-"),
|
304 |
|
|
29 => new String'("$1234"),
|
305 |
|
|
30 => new String'(" $1"),
|
306 |
|
|
31 => new String'(" $36 "),
|
307 |
|
|
32 => new String'(" $0")
|
308 |
|
|
);
|
309 |
|
|
|
310 |
|
|
|
311 |
|
|
|
312 |
|
|
-- The following data is used to create exception situations in tests of
|
313 |
|
|
-- the Edited Output capabilities of package Ada.Text_IO.Editing. The data
|
314 |
|
|
-- are not themselves erroneous, but will produce exceptions based on the
|
315 |
|
|
-- data/picture string combination used.
|
316 |
|
|
|
317 |
|
|
Erroneous_Data : Data_Array_Type_2 (1..Number_Of_Erroneous_Conditions) :=
|
318 |
|
|
( 1 => 12.34,
|
319 |
|
|
2 => -12.34,
|
320 |
|
|
3 => 51234.0
|
321 |
|
|
);
|
322 |
|
|
|
323 |
|
|
Erroneous_Strings : Picture_String_Array_Type
|
324 |
|
|
(1..Number_Of_Erroneous_Conditions) :=
|
325 |
|
|
( 1 => new String'("9.99"),
|
326 |
|
|
2 => new String'("99.99"),
|
327 |
|
|
3 => new String'("$$$$9")
|
328 |
|
|
);
|
329 |
|
|
|
330 |
|
|
end FXF3A00;
|