Added move support in actions

git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@681 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
mat007 2013-08-13 21:43:14 +00:00
parent fc74b61817
commit 392240a87c
7 changed files with 126 additions and 18 deletions

View file

@ -7,6 +7,7 @@ Not yet released
* Added MOCK_NO_VARIADIC_MACROS to deactivate variadic macros support
* Added support for movable only types as parameters
* Added logging support for std::unique_ptr, std::shared_ptr and std::weak_ptr
* Added move support in actions
[endsect]

View file

@ -624,6 +624,7 @@ BOOST_AUTO_TEST_CASE( demonstrates_configuring_actions )
{
mock_class c;
MOCK_EXPECT( c.method ).returns( 42 );
MOCK_EXPECT( c.method ).moves( 42 ); // returns by moving the value
MOCK_EXPECT( c.method ).throws( std::runtime_error( "error !" ) );
MOCK_EXPECT( c.method ).calls( &function ); // forwards 'method' parameter to 'function'
MOCK_EXPECT( c.method ).calls( boost::bind( &function, 42 ) ); // drops 'method' parameter and binds 42 as parameter to 'function'

View file

@ -419,6 +419,7 @@ An action performs additional treatments after an expectation has been deemed va
Synopsis :
MOCK_EXPECT( identifier ).returns( value );
MOCK_EXPECT( identifier ).moves( value );
MOCK_EXPECT( identifier ).throws( exception );
MOCK_EXPECT( identifier ).calls( functor ); // gets assigned to a boost::function and throws std::invalid_argument if empty