Added support for move only types to constraints

Therefore mock::retrieve now supports std::unique_ptr.
This commit is contained in:
Mathieu Champlon 2018-03-12 08:26:18 +01:00
parent 5795f4be70
commit bccd3ff303
8 changed files with 60 additions and 19 deletions

View file

@ -252,6 +252,16 @@ BOOST_AUTO_TEST_CASE( retrieve_constraint )
BOOST_CHECK_EQUAL( i, &j );
}
#endif
#ifdef MOCK_SMART_PTR
{
std::unique_ptr< int > i;
std::unique_ptr< int > j( new int( 3 ) );
BOOST_CHECK( mock::retrieve( i ).c_( boost::move( j ) ) );
BOOST_REQUIRE( i );
BOOST_CHECK_EQUAL( 3, *i );
BOOST_CHECK( !j );
}
#endif
}
namespace