#include <DelayedCallDriver.h> [code]
DelayedCallDriver objects are created by ExpectationDriver objects when a call back to the object under test needs to be modeled from a mock object. Using the DelayedCallDriver object further expectations for the environment can be modelled. The functions willReturn() and willReturnVoid() can be used to switch back to the context of the outer ExpectationDriver.
There was the idea to use a mixin base class in order to avoid some (though not all) code duplication in CallDriver and DelayedCallDriver, but that wouldn't work for a few reasons: DelayedCallDriver takes two template arguments, whereas CallDriver takes only one; CallDriver might own the underlying BoundFunction and in contrast DelayedCallDriver never does.
Definition at line 57 of file DelayedCallDriver.h.
Public Types | |
| typedef Function::ReturnType | ReturnType |
Public Member Functions | |
| DelayedCallDriver (OuterExpectationDriver &expectationDriver_, Function &f_) | |
| template<typename Foo> | |
| ExpectationDriver< DelayedCallDriver, ExpectedFunction< Foo > > | willCall (ExpectationPair< ExpectedFunction< Foo > > expectation) |
| Express the expectation that a function will be called. | |
| template<typename Foo> | |
| ExpectationDriver< DelayedCallDriver, ExpectedFunction< Foo > > | willCallMsg (ExpectationPair< ExpectedFunction< Foo > > expectation, const std::string &expressionString, const SourceLine &sourceLine) |
| OuterExpectationDriver & | willReturn (const ReturnTypeWrapper< ReturnType > &returnValue) |
| Express the expectation for the return value of the bound function. | |
| OuterExpectationDriver & | willReturnMsg (const ReturnTypeWrapper< ReturnType > &returnValue, const std::string &expressionString, const SourceLine &sourceLine) |
| OuterExpectationDriver & | returns () |
| Express the expectation that the bound function returns void. | |
| template<typename Foo> | |
| DelayedCallDriver & | willEmit (ExpectationPair< ExpectedFunction< Foo > > expectation) |
| Express the expectation that a signal is emitted form bound function. | |
| template<typename Foo> | |
| DelayedCallDriver & | willEmitMsg (ExpectationPair< ExpectedFunction< Foo > > expectation, const std::string &expressionString, const SourceLine &sourceLine) |
Protected Attributes | |
| Function & | f |
| OuterExpectationDriver & | outerExpectationDriver |
|
|||||
|
Definition at line 60 of file DelayedCallDriver.h. |
|
||||||||||||||||
|
Definition at line 62 of file DelayedCallDriver.h. |
|
|||||||||
|
Express the expectation that the bound function returns void.
Definition at line 116 of file DelayedCallDriver.h. |
|
||||||||||||||
|
Express the expectation that a function will be called. This overload gets called when we want to model the expectation that a function of a mock object gets called. Definition at line 72 of file DelayedCallDriver.h. |
|
||||||||||||||||||||||||
|
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Definition at line 86 of file DelayedCallDriver.h. |
|
||||||||||||||
|
Express the expectation that a signal is emitted form bound function.
Definition at line 124 of file DelayedCallDriver.h. |
|
||||||||||||||||||||||||
|
Definition at line 138 of file DelayedCallDriver.h. |
|
||||||||||
|
Express the expectation for the return value of the bound function.
Definition at line 96 of file DelayedCallDriver.h. |
|
||||||||||||||||||||
|
Definition at line 107 of file DelayedCallDriver.h. |
|
|||||
|
Definition at line 147 of file DelayedCallDriver.h. |
|
|||||
|
Definition at line 148 of file DelayedCallDriver.h. |