Fixed move-only type argument in actions

Because boost::function does not move the parameters it receives we need to use std::function instead.
This commit is contained in:
Mathieu Champlon 2018-01-15 06:23:25 +01:00
parent 58b5e55bb5
commit d3a5d3010c
8 changed files with 40 additions and 22 deletions

View file

@ -690,3 +690,19 @@ BOOST_FIXTURE_TEST_CASE( mock_method_accepts_polymorphic_multi_constraint, mock_
m.m2( 1, 2 );
CHECK_CALLS( 1 );
}
#ifdef MOCK_SMART_PTR
BOOST_FIXTURE_TEST_CASE( std_unique_ptr_argument_is_supported_in_action, mock_error_fixture )
{
MOCK_FUNCTOR( f, void( std::unique_ptr< int > ) );
std::unique_ptr< int > p;
MOCK_EXPECT( f ).once().calls(
[]( std::unique_ptr< int > )
{
} );
f( std::unique_ptr< int >( new int( 7 ) ) );
CHECK_CALLS( 1 );
}
#endif