[phobos] Silent failure of std.container unittests

Benjamin Shropshire benjamin at precisionsoftware.us
Sat Jul 17 09:24:34 PDT 2010


Walter Bright wrote:
>
>
> Michel Fortin wrote:
>>
>> And here's an illustration of a second test modelling a sequence of 
>> events. If one of these test fails, all others will fail too because 
>> they depend on each other:
>>
>>     unittest {
>>         S s = new S;
>>         s.giveMeAName();
>>         assert(s.fileName);
>>         s.value = 1;
>>         assert(s.value == 1);
>>         assert(s.needsToBeSaved);
>>         s.save();
>>         assert(!s.needsToBeSaved);
>>         s.value = 2;
>>         assert(s.value == 2);
>>         assert(s.needsToBeSaved);
>>         s.revert();
>>         assert(s.value == 1);
>>         assert(!s.needsToBeSaved);
>>         ...
>>     }
>>
>> So here you only need to know about the first error, and the rest is 
>> garbage.
>>   
>
> Yes, for that sequence, the rest are irrelevant. But what I don't
> understand is why is it so bad that they also generate messages, which
> you just ignore looking over the log file? Me, I'd rather see a few
> extra cascaded messages, fix the ones that matter and ignore the extra,

The issue is that some people won't be getting "a few" extra messages to 
be ignored.They will get one message they want, followed by dozens that 
they need to ignore, followed by one they want, ...

If there is more than one message in a row that is to be ignored, it 
makes finding the real messages harder and makes it worse than the 
original design.



More information about the phobos mailing list