www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - DMD 0.109 Linux - std.format unittest fails

Running the Phobos unittest fails in .109:

 Error: AssertError Failure format(730)
This is where it tests the %A format... Actual results are: (with extra printfs)
 putreal 1.67
 format = '%*.*Lg', n = 4
 putreal -1.28
 format = '%*.*LA', n = 21
 putreal nan
 format = '%*.*Lg', n = 3
The assert doesn't output anything useful like it does in C, but I added some printf:
 RESULT: 1.67 -0XA.3D70A3D70A3D8P-3 nan
 EXPECT: 1.67 -0X1.47AE147AE147BP+0 nan
The error seems to be in the real conversion:
 printf("%A\n%LA\n", -1.28, cast(real) -1.28);
outputs:
 -0X1.47AE147AE147BP+0
 -0XA.3D70A3D70A3D8P-3
The other unittests in the library succeeded. For some reason, "make unittest" doesn't set the -unittest flag when compiling Phobos... ? --anders
Dec 09 2004