|
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