Skip to content

Commit f96998a

Browse files
committed
*_decimal: Update for stable output on 64bit & 32bit platforms.
TN: eng/toolchain/aws#45
1 parent 1ecb1b0 commit f96998a

File tree

6 files changed

+63
-2
lines changed

6 files changed

+63
-2
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
!lal DEAD
22
!xmlada DEAD
3+
32bits OUT test32b.out
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
0.0000
2+
12.0000
3+
12.1000
4+
12.2000
5+
12.3500
6+
98712.0000
7+
789.0000
8+
-2.0000
9+
88.0000
10+
12.99
11+
0.0010
12+
0.0120
13+
0.1230
14+
1.2340
15+
12.3450
16+
123.4560
17+
1234.5670
18+
12345.6780
19+
123456.7890
20+
1234567.9000
21+
12345679.0110
22+
123456790.1220
23+
1234567901.2330
24+
12345679012.3440
25+
123456790123.4550

regtests/0355_wsdl_decimal/wsdl_d_main.adb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ procedure WSDL_D_Main is
4545
D : SOAP.Types.Decimal := 0.0;
4646
P : WSDL_D.Price := 12.99;
4747

48+
Step : constant := (if Standard'Max_Integer_Size >= 128
49+
then 0.000001
50+
else 0.0001);
51+
4852
begin
4953
H := SOAP.Dispatchers.Callback.Create
5054
(WSDL_D_Server.HTTP_CB'Access,
@@ -69,7 +73,7 @@ begin
6973
WSDL_D_Service.Client.Print_Price (P);
7074

7175
for J in 1 .. 15 loop
72-
D := (D + 0.000001 * J) * 10;
76+
D := (D + Step * J) * 10;
7377
if D /= SOAP.Types.XSD_Decimal'(SOAP.Types.D (D)).V then
7478
Text_IO.Put_Line ("Wrong decimal " & D'Img & " convertion");
7579
end if;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
!lal DEAD
22
!xmlada DEAD
3+
32bits OUT test32b.out
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
0.0000
2+
12.0000
3+
12.1000
4+
12.2000
5+
12.3500
6+
98712.0000
7+
789.0000
8+
-2.0000
9+
88.0000
10+
12.99
11+
0.0010
12+
0.0120
13+
0.1230
14+
1.2340
15+
12.3450
16+
123.4560
17+
1234.5670
18+
12345.6780
19+
123456.7890
20+
1234567.9000
21+
12345679.0110
22+
123456790.1220
23+
1234567901.2330
24+
12345679012.3440
25+
123456790123.4550
26+
Expected constaint error

regtests/0359_decimal_constraints/wsdl_d_main.adb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ procedure WSDL_D_Main is
4545
D : SOAP.Types.Decimal := 0.0;
4646
P : WSDL_D.Price := 12.99;
4747

48+
Step : constant := (if Standard'Max_Integer_Size >= 128
49+
then 0.000001
50+
else 0.0001);
51+
4852
begin
4953
H := SOAP.Dispatchers.Callback.Create
5054
(WSDL_D_Server.HTTP_CB'Access,
@@ -69,7 +73,7 @@ begin
6973
WSDL_D_Service.Client.Print_Price (P);
7074

7175
for J in 1 .. 15 loop
72-
D := (D + 0.000001 * J) * 10;
76+
D := (D + Step * J) * 10;
7377
if D /= SOAP.Types.XSD_Decimal'(SOAP.Types.D (D)).V then
7478
Text_IO.Put_Line ("Wrong decimal " & D'Img & " convertion");
7579
end if;

0 commit comments

Comments
 (0)