[phobos] phobos commit, revision 1559

Shin Fujishiro rsinfu at gmail.com
Wed May 26 22:41:43 PDT 2010


Don Clugston <dclugston at googlemail.com> wrote:
> What I've been doing for such cases is adding:
>     version (OSX)
>     {
> 	pragma(msg, " --- std.socket(" ~ __LINE__.stringof ~ ") broken test ---");
>     }
> else {
> ...
> }
> 
> so that the unittests compile on all platforms but clearly indicate
> that there is a failure.
> 

I have seen one in std.regex!  It's a good idea.

In this case, I can't use verison blocks.  The unittests fail on Gentoo
Linux, however they succeed on some other Linux systems. version
(Linux) will bypass the unittests on all Linux systems.

I think I can add try-catch blocks instead:
--------------------
try
{
    r = to!real(to!string(real.min_normal));
    assert(to!string(r) == to!string(real.min_normal));
}
catch (ConvError e)    // strtold() bug on some platforms
{
    printf(" --- std.math(%u) broken test ---\n", cast(uint) __LINE__);
}
--------------------
If there's no problem, I'll commit this after.

Thank you for the advice!

Shin


More information about the phobos mailing list