[phobos] Unittest errors on windows with latest phobos sources

Andrei Alexandrescu andrei at erdani.com
Mon Jul 5 21:13:43 PDT 2010


On 07/05/2010 02:44 PM, Walter Bright wrote:
> The failing unittests still exit with an errorlevel. The change was to
> not exit immediately on the assert error, but to remember that it
> failed, run all the unittests, then exit with errorlevel set to 1 if any
> of them had failed.

I'm glad we see eye to eye on that! In fact there is a bug in your 
implementation of Linux - it doesn't do as you mention above. Look at this:

$ generated/posix/debug/unittest/std/xml
std.xml(379): unittest failure
$ echo $?
0
$ _

So something somewhere makes the program return success even though it 
fails.

> I also find the ErrnoException saying "(No error)" is very strange.

errnoEnforce() enforces its argument and assumes that failure will set 
errno. Somewhere there's an errnoEnforce() against an exception that 
does NOT set errno.

> BTW, the std.complex failures are possibly due to changes in toString().

I figured what's happening.

The problem stems again from the lack of a default constructor (or the 
inability to disable it effectively). Previously, Appender was passed 
around by reference, which made it possible for it itself to hold a 
null-initialized payload. But that was a hack - one should be able to 
pass it by value. Once I changed Appender to support pass-by-value, it 
started having that problem we discussed in conjunction with built-in 
hashtables: it has reference semantics if not null, and crappy semantics 
if null.


Andrei


More information about the phobos mailing list