Boost logo

Boost :

From: Boris Gubenko (Boris.Gubenko_at_[hidden])
Date: 2007-11-05 16:19:11


Jens Seidel wrote:
> Are the last two tests OK? Two const char* pointer are compared by
> address!?

They are not. I misunderstood how BOOST_CHECK works. The correct fix
may look like the following:

#if defined(__hpux)
  BOOST_CHECK( ec.message() == "" );
#elif defined(__osf__)
  BOOST_CHECK( ec.message() == "Error -1 occurred." );
#elif defined(__vms)
  BOOST_CHECK( ec.message() == "error -1" );
#else
   BOOST_CHECK( ec.message().substr( 0, 13) == "Unknown error" );
#endif

Thanks for pointing it out.

Boris

----- Original Message -----
From: "Jens Seidel" <jensseidel_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Monday, November 05, 2007 3:39 PM
Subject: Re: [boost] [system] error_code_test.cpp does not accountfor
implementation-specific behaviour of strerror()

> On Mon, Nov 05, 2007 at 02:47:15PM -0500, Boris Gubenko wrote:
>> Forgot VMS:
>>
>> #if defined(__hpux)
>> BOOST_CHECK( *(ec.message().c_str()) == 0 );
>> #elif defined(__osf__)
>> BOOST_CHECK( ec.message().c_str() == "Error -1 occurred." );
>> #elif defined(__vms)
>> BOOST_CHECK( ec.message().c_str() == "error -1" );
>
> Are the last two tests OK? Two const char* pointer are compared by
> address!?
>
>> #else
>> BOOST_CHECK( ec.message().substr( 0, 13) == "Unknown error" );
>> #endif
>
> Jens
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk