Made boost_test_error_policy throw a mock::exception extending boost::execution_aborted (helpful in order to filter on exceptions)

git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@151 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
mat007 2010-05-06 16:33:45 +00:00
parent 62d2766e20
commit aa816535b4

View file

@ -22,13 +22,16 @@
namespace mock
{
#ifdef MOCK_USE_BOOST_TEST
struct exception : public boost::execution_aborted
{};
template< typename Result >
struct boost_test_error_policy
{
static Result abort()
{
throw boost::enable_current_exception(
boost::execution_aborted() );
throw boost::enable_current_exception( exception() );
}
static void missing_action( const std::string& context,
@ -70,11 +73,14 @@ namespace mock
<< boost::unit_test::log::end();
}
};
#endif // MOCK_USE_BOOST_TEST
#else // MOCK_USE_BOOST_TEST
struct exception
{};
#endif // MOCK_USE_BOOST_TEST
template< typename Result >
struct basic_error_policy
{