mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Make action classes non-relocatable
This fixes an issue with auto_ptr. As shown by missing coverage the actual copy/move ctors are not required as C++11 emplace functions can be used. Furthermore some places using shared_ptr could be replaced by unique_ptr leading to better performance.
This commit is contained in:
parent
f3d6564d2b
commit
d9f9fce6fc
5 changed files with 54 additions and 55 deletions
|
|
@ -535,6 +535,19 @@ BOOST_FIXTURE_TEST_CASE( triggering_an_expectation_returns_the_set_auto_ptr_valu
|
|||
BOOST_CHECK( ! f().get() );
|
||||
CHECK_CALLS( 2 );
|
||||
}
|
||||
{
|
||||
mock::detail::function< std::auto_ptr< int >() > f;
|
||||
f.expect().once().returns( new int( 1 ) );
|
||||
f.expect().once().returns( new int( 2 ) );
|
||||
f.expect().once().returns( new int( 3 ) );
|
||||
f.expect().returns( new int( 4 ) );
|
||||
BOOST_CHECK_EQUAL( 1, *f() );
|
||||
BOOST_CHECK_EQUAL( 2, *f() );
|
||||
BOOST_CHECK_EQUAL( 3, *f() );
|
||||
BOOST_CHECK_EQUAL( 4, *f() );
|
||||
BOOST_CHECK( ! f().get() );
|
||||
CHECK_CALLS( 5 );
|
||||
}
|
||||
{
|
||||
mock::detail::function< std::auto_ptr< int >() > f;
|
||||
f.expect().returns( std::auto_ptr< int >( new int( 3 ) ) );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue