mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Document how actions store data by copy
This commit is contained in:
parent
41de7236c4
commit
d1e0c96ff3
3 changed files with 30 additions and 4 deletions
|
|
@ -488,17 +488,23 @@ 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
|
||||
MOCK_EXPECT( identifier ).returns( value ); // stored internally by copy
|
||||
MOCK_EXPECT( identifier ).moves( value ); // stored internally by copy
|
||||
MOCK_EXPECT( identifier ).throws( exception ); // stored internally by copy
|
||||
MOCK_EXPECT( identifier ).calls( functor ); // stored internally by copy, throws std::invalid_argument if empty
|
||||
|
||||
[note The returns and moves actions are not available for mock methods returning void, including constructors and destructors.]
|
||||
|
||||
[note Actions are captured by copy, boost::ref and boost::cref can however be used to turn the copies into references.]
|
||||
|
||||
Example :
|
||||
|
||||
[action_example_1]
|
||||
|
||||
Example with references :
|
||||
|
||||
[action_example_2]
|
||||
|
||||
[endsect]
|
||||
|
||||
[endsect]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue