[Boost-bugs] [Boost C++ Libraries] #12800: BOOST_CHECK_THROW does not catch unrelated exception type

Subject: [Boost-bugs] [Boost C++ Libraries] #12800: BOOST_CHECK_THROW does not catch unrelated exception type
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-02-01 08:17:07


#12800: BOOST_CHECK_THROW does not catch unrelated exception type
------------------------------+---------------------
 Reporter: enniobarbaro@… | Owner: rogeeff
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: test
  Version: Boost 1.63.0 | Severity: Problem
 Keywords: throw |
------------------------------+---------------------
 The following code:

 {{{
 #define BOOST_TEST_MODULE qengine_mapping
 #include <boost/test/included/unit_test.hpp>

 BOOST_AUTO_TEST_CASE( test )
 {
     try {
         BOOST_CHECK_THROW( throw 1, std::exception );
     }
     catch( ... )
     {
     }
 }

 }}}

 Produces "No errors detected". The documentation for `BOOST_CHECK_THROW`
 states that: ''If the statement throw any other unrelated exception or
 doesn't throw at all, check fails.''. It is my understanding that ``check
 fails`` implies the creation of some log report, which is not the case.

 I believe that `BOOST_CHECK_THROW_IMPL` should provide a `catch(...)`
 block and report relevant errors in place, rather than letting the
 exception escape.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/12800>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:21 UTC