mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
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:
parent
62d2766e20
commit
aa816535b4
1 changed files with 9 additions and 3 deletions
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue