Opened 8 years ago

Closed 7 years ago

Last modified 7 years ago

#10143 closed Bugs (wontfix)

BOOST.TEST BOOST_*_THROW behavior

Reported by: ghleclerc@… Owned by: Gennadiy Rozental
Milestone: To Be Determined Component: test
Version: Boost 1.55.0 Severity: Problem
Keywords: Cc:

Description

As has been suggested to me on the user list, I am filing a new ticket for a BOOST.TEST library bug. (http://lists.boost.org/boost-users/2014/06/82308.php)

The BOOST_*_THROW behavior is currently that if an "unexpected" exception is thrown, it is not caught and simply unravels until it reaches terminate() or at least it has been my experience that it is so. I was under the impression, from the documentation found here (http://www.boost.org/doc/libs/1_55_0/libs/test/doc/html/utf/testing-tools/reference.html) that the tests would continue to run and that only a message (BOOST_ERROR) stating that the wrong exception was caught would be outputted. This is the sentence that lead me to believe that :

" If check is successful, the tool produces a confirmation message, in other case it produces an error message in a form "error in test case name: exception exception expected. "

Anyhow, the person who answered me about this on the mailing list suggested to consider this a bug rather than a feature request (see first link above) "because the reference docs for BOOST_*_THROW state that "check fails" if an unrelated exception is thrown, which is at least misleading at present if not incorrect". So here I am filing the ticket.

I hope I am clear enough about my problem. If not, I am sorry and willing to clarify things.

Change History (2)

comment:1 by Gennadiy Rozental, 7 years ago

Resolution: wontfix
Status: newclosed

All testing tools can fail with exception. BOOST_CHECK_THROW is not that different from BOOST_TEST(a==b). It has one good result, one bad result and one exception execution path. In later case exception is caught by execution monitor and reported as fatal test case error. We do not want to replicate rather complicated logic of catching unknown exception at every assertion location. If you want to continue with other assertions I suggest placing them into a separate test case.

comment:2 by Raffi Enficiaud, 7 years ago

Hi,

I revised the documentation to clarify the behaviour of all exception related macros. Should be online by version 1.60.

Note: See TracTickets for help on using tickets.