Boost logo

Boost Users :

Subject: Re: [Boost-users] [Boost.Test] BOOST_CHECK_THROW behaviour
From: Ghyslain Leclerc (ghleclerc_at_[hidden])
Date: 2014-06-23 13:47:58


On 23/06/2014 17:19:01 +1200, Gavin Lambert wrote
>>You could try submitting that as a bug report in Trac (if it's  not already there), or waiting for Gennadiy Rozental's response.

Done.  I hope I did it properly.  Never reported a bug on Boost before.  Quoted our discussion, so that some more info is available if necessary.

>>In the  meantime, you'd need to write a more intelligent test yourself. 

I will do it manually.  Found someone on Stack Overflow who wanted the same behavior I expected and did it.  In case it helps someone, here is the snippet:

try
{
    … code that should throw ...
    BOOST_ERROR( “<function_name> did not throw anything. Expected a <exception_name>” );
}
catch( <exception_name> const& )
{
    //ok, this is the expected case
}
catch(…)
{
    BOOST_ERROR( “<function_name> has throw an unknown exception, but a <exception_name> was expected.” );
}

and the reference: http://stackoverflow.com/questions/21774387/boost-unit-testing-exceptions

Thanks again for your help.



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net