Utils::CalitkoMocks Namespace Reference


Classes

struct  BoundArgumentStorageType
 Defines the type used to store the values of bound arguments. More...
struct  BoundArgumentStorageType< T & >
 Defines storage type for references. More...
struct  BoundArgumentStorageType< const T & >
 Defines storage type for const references. More...
struct  ReturnTypeWrapper
struct  ReturnTypeWrapper< void >
struct  DefaultValue
struct  DefaultValue< T & >
struct  DefaultValue< const T & >
struct  IsSameType
struct  IsSameType< T, T >
struct  IsSameValue
struct  IsSameValue< T & >
struct  IsSameValue< const T & >
class  BoundFunctionBase
 Base functionality for the BoundFunction template. More...
class  CallDriver
 A thin wrapper around BoundFunction. More...
class  DelayedCallDriver
class  ExpectationDriver
 A thin wrapper around ExpectedFunction. More...
class  ExpectationsList
 A list of expected function calls on a mock object. More...
struct  ExpectationPair
 Helper for expectation factories and willCall(), willEmit(). More...
class  ExpectedFunctionBase
 Base functionality for the ExpectedFunction template. More...
struct  MockBase
struct  SignalWaitHelper
class  TesterApplication
 Extends QCoreApplication to support tests requiring an event loop. More...
struct  ReturnTypeWrapper< std::auto_ptr< T > >

Namespaces

namespace  Testing

Functions

CallDriver< BoundFunction<
SignalWaitHelper, void(int)> > 
waitFor (int maxTime)
 Returns a CallDriver bound to SignalWaitHelper::processEvents().
template<typename Host, typename Func>
CallDriver< BoundFunction<
Host, Func > > 
call (auto_ptr< BoundFunction< Host, Func > > f)
template<typename Host, typename Func>
CallDriver< BoundFunction<
Host, Func > > 
callMsg (auto_ptr< BoundFunction< Host, Func > > f, const std::string &expressionString, const SourceLine &sourceLine)
template<typename Checker>
auto_ptr< ExpectedFunction<
typename Checker::Function > > 
checker (const Checker &checker)
template<typename T>
void willBeEqual (T v1, T v2)
template<typename T>
void willBeEqualMsg (T v1, T v2, const std::string &expectationString, const SourceLine &sourceLine)
void willFail (const std::string &reason)


Function Documentation

template<typename Host, typename Func>
CallDriver<BoundFunction <Host, Func> > Utils::CalitkoMocks::call auto_ptr< BoundFunction< Host, Func > >  f  ) 
 

Definition at line 57 of file Mocks.h.

template<typename Host, typename Func>
CallDriver<BoundFunction <Host, Func> > Utils::CalitkoMocks::callMsg auto_ptr< BoundFunction< Host, Func > >  f,
const std::string &  expressionString,
const SourceLine &  sourceLine
 

Definition at line 64 of file Mocks.h.

template<typename Checker>
auto_ptr<ExpectedFunction <typename Checker::Function> > Utils::CalitkoMocks::checker const Checker &  checker  ) 
 

Definition at line 74 of file Mocks.h.

CallDriver< BoundFunction< SignalWaitHelper, void(int)> > Utils::CalitkoMocks::waitFor int  maxTime  ) 
 

Returns a CallDriver bound to SignalWaitHelper::processEvents().

Use this function to create a context in which you could set expectations for signals, which are emitted with a delay, e.g. from slots connected on a Qt::QueuedConnection. Example:

    wait()
        .willEmit (transport->connected())
    .returns();

Definition at line 58 of file Mocks.cpp.

template<typename T>
void Utils::CalitkoMocks::willBeEqual v1,
v2
 

Definition at line 119 of file Mocks.h.

template<typename T>
void Utils::CalitkoMocks::willBeEqualMsg v1,
v2,
const std::string &  expectationString,
const SourceLine &  sourceLine
 

Definition at line 125 of file Mocks.h.

void Utils::CalitkoMocks::willFail const std::string &  reason  )  [inline]
 

Definition at line 133 of file Mocks.h.