mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Prevented a crash when mocking a destructor and throwing out of the object scope
git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@121 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
parent
456869d82b
commit
0e8079d47a
8 changed files with 174 additions and 113 deletions
|
|
@ -6,6 +6,7 @@
|
|||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
|
||||
#define MOCK_USE_BOOST_TEST
|
||||
#include <turtle/mock.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
|
||||
|
|
@ -204,20 +205,6 @@ BOOST_AUTO_TEST_CASE( mock_functor_is_named )
|
|||
BOOST_CHECK_EQUAL( "f", to_string( MOCK_MOCKER( f, _ ) ) );
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
MOCK_CLASS( my_destroyed_class )
|
||||
{
|
||||
MOCK_DESTRUCTOR( my_destroyed_class, destructor )
|
||||
};
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE( mocking_a_destructor )
|
||||
{
|
||||
my_destroyed_class c;
|
||||
MOCK_EXPECT( c, destructor ).once();
|
||||
}
|
||||
|
||||
BOOST_MPL_ASSERT(( boost::is_same< float, mock::detail::arg< void( float ), 1, 1 >::type > ));
|
||||
BOOST_MPL_ASSERT(( boost::is_same< float, mock::detail::arg< void( float, int ), 1, 2 >::type > ));
|
||||
BOOST_MPL_ASSERT(( boost::is_same< int, mock::detail::arg< void( float, int ), 2, 2 >::type > ));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue