proxygen
testing::internal::OnCallSpec< F > Class Template Reference

#include <gmock-spec-builders.h>

Inheritance diagram for testing::internal::OnCallSpec< F >:
testing::internal::UntypedOnCallSpecBase testing::internal::UntypedOnCallSpecBase testing::internal::UntypedOnCallSpecBase

Public Types

typedef Function< F >::ArgumentTuple ArgumentTuple
 
typedef Function< F >::ArgumentMatcherTuple ArgumentMatcherTuple
 
typedef Function< F >::ArgumentTuple ArgumentTuple
 
typedef Function< F >::ArgumentMatcherTuple ArgumentMatcherTuple
 
typedef Function< F >::ArgumentTuple ArgumentTuple
 
typedef Function< F >::ArgumentMatcherTuple ArgumentMatcherTuple
 

Public Member Functions

 OnCallSpec (const char *a_file, int a_line, const ArgumentMatcherTuple &matchers)
 
OnCallSpecWith (const Matcher< const ArgumentTuple & > &m)
 
OnCallSpecWillByDefault (const Action< F > &action)
 
bool Matches (const ArgumentTuple &args) const
 
const Action< F > & GetAction () const
 
 OnCallSpec (const char *a_file, int a_line, const ArgumentMatcherTuple &matchers)
 
OnCallSpecWith (const Matcher< const ArgumentTuple & > &m)
 
OnCallSpecWillByDefault (const Action< F > &action)
 
bool Matches (const ArgumentTuple &args) const
 
const Action< F > & GetAction () const
 
 OnCallSpec (const char *a_file, int a_line, const ArgumentMatcherTuple &matchers)
 
OnCallSpecWith (const Matcher< const ArgumentTuple & > &m)
 
OnCallSpecWillByDefault (const Action< F > &action)
 
bool Matches (const ArgumentTuple &args) const
 
const Action< F > & GetAction () const
 
- Public Member Functions inherited from testing::internal::UntypedOnCallSpecBase
 UntypedOnCallSpecBase (const char *a_file, int a_line)
 
const char * file () const
 
int line () const
 
 UntypedOnCallSpecBase (const char *a_file, int a_line)
 
const char * file () const
 
int line () const
 
 UntypedOnCallSpecBase (const char *a_file, int a_line)
 
const char * file () const
 
int line () const
 

Private Attributes

ArgumentMatcherTuple matchers_
 
Matcher< const ArgumentTuple & > extra_matcher_
 
Action< F > action_
 

Additional Inherited Members

- Protected Types inherited from testing::internal::UntypedOnCallSpecBase
enum  Clause {
  kNone, kWith, kWillByDefault, kNone,
  kWith, kWillByDefault, kNone, kWith,
  kWillByDefault
}
 
enum  Clause {
  kNone, kWith, kWillByDefault, kNone,
  kWith, kWillByDefault, kNone, kWith,
  kWillByDefault
}
 
enum  Clause {
  kNone, kWith, kWillByDefault, kNone,
  kWith, kWillByDefault, kNone, kWith,
  kWillByDefault
}
 
- Protected Member Functions inherited from testing::internal::UntypedOnCallSpecBase
void AssertSpecProperty (bool property, const string &failure_message) const
 
void ExpectSpecProperty (bool property, const string &failure_message) const
 
void AssertSpecProperty (bool property, const string &failure_message) const
 
void ExpectSpecProperty (bool property, const string &failure_message) const
 
void AssertSpecProperty (bool property, const string &failure_message) const
 
void ExpectSpecProperty (bool property, const string &failure_message) const
 
- Protected Attributes inherited from testing::internal::UntypedOnCallSpecBase
const char * file_
 
int line_
 
Clause last_clause_
 

Detailed Description

template<typename F>
class testing::internal::OnCallSpec< F >

Definition at line 285 of file gmock-spec-builders.h.

Member Typedef Documentation

Definition at line 288 of file gmock-spec-builders.h.

Definition at line 288 of file gmock-spec-builders.h.

Definition at line 288 of file gmock-spec-builders.h.

template<typename F>
typedef Function<F>::ArgumentTuple testing::internal::OnCallSpec< F >::ArgumentTuple

Definition at line 287 of file gmock-spec-builders.h.

template<typename F>
typedef Function<F>::ArgumentTuple testing::internal::OnCallSpec< F >::ArgumentTuple

Definition at line 287 of file gmock-spec-builders.h.

template<typename F>
typedef Function<F>::ArgumentTuple testing::internal::OnCallSpec< F >::ArgumentTuple

Definition at line 287 of file gmock-spec-builders.h.

Constructor & Destructor Documentation

template<typename F>
testing::internal::OnCallSpec< F >::OnCallSpec ( const char *  a_file,
int  a_line,
const ArgumentMatcherTuple matchers 
)
inline

Definition at line 292 of file gmock-spec-builders.h.

294  : UntypedOnCallSpecBase(a_file, a_line),
295  matchers_(matchers),
296  // By default, extra_matcher_ should match anything. However,
297  // we cannot initialize it with _ as that triggers a compiler
298  // bug in Symbian's C++ compiler (cannot decide between two
299  // overloaded constructors of Matcher<const ArgumentTuple&>).
300  extra_matcher_(A<const ArgumentTuple&>()) {
301  }
Matcher< const ArgumentTuple & > extra_matcher_
UntypedOnCallSpecBase(const char *a_file, int a_line)
template<typename F>
testing::internal::OnCallSpec< F >::OnCallSpec ( const char *  a_file,
int  a_line,
const ArgumentMatcherTuple matchers 
)
inline

Definition at line 292 of file gmock-spec-builders.h.

294  : UntypedOnCallSpecBase(a_file, a_line),
295  matchers_(matchers),
296  // By default, extra_matcher_ should match anything. However,
297  // we cannot initialize it with _ as that triggers a compiler
298  // bug in Symbian's C++ compiler (cannot decide between two
299  // overloaded constructors of Matcher<const ArgumentTuple&>).
300  extra_matcher_(A<const ArgumentTuple&>()) {
301  }
Matcher< const ArgumentTuple & > extra_matcher_
UntypedOnCallSpecBase(const char *a_file, int a_line)
template<typename F>
testing::internal::OnCallSpec< F >::OnCallSpec ( const char *  a_file,
int  a_line,
const ArgumentMatcherTuple matchers 
)
inline

Definition at line 292 of file gmock-spec-builders.h.

294  : UntypedOnCallSpecBase(a_file, a_line),
295  matchers_(matchers),
296  // By default, extra_matcher_ should match anything. However,
297  // we cannot initialize it with _ as that triggers a compiler
298  // bug in Symbian's C++ compiler (cannot decide between two
299  // overloaded constructors of Matcher<const ArgumentTuple&>).
300  extra_matcher_(A<const ArgumentTuple&>()) {
301  }
Matcher< const ArgumentTuple & > extra_matcher_
UntypedOnCallSpecBase(const char *a_file, int a_line)

Member Function Documentation

template<typename F>
const Action<F>& testing::internal::OnCallSpec< F >::GetAction ( ) const
inline

Definition at line 334 of file gmock-spec-builders.h.

Referenced by testing::internal::FunctionMockerBase< R(A1, A2)>::PerformDefaultAction().

334  {
336  ".WillByDefault() must appear exactly "
337  "once in an ON_CALL().");
338  return action_;
339  }
void AssertSpecProperty(bool property, const string &failure_message) const
template<typename F>
const Action<F>& testing::internal::OnCallSpec< F >::GetAction ( ) const
inline

Definition at line 334 of file gmock-spec-builders.h.

334  {
336  ".WillByDefault() must appear exactly "
337  "once in an ON_CALL().");
338  return action_;
339  }
void AssertSpecProperty(bool property, const string &failure_message) const
template<typename F>
const Action<F>& testing::internal::OnCallSpec< F >::GetAction ( ) const
inline

Definition at line 334 of file gmock-spec-builders.h.

334  {
336  ".WillByDefault() must appear exactly "
337  "once in an ON_CALL().");
338  return action_;
339  }
void AssertSpecProperty(bool property, const string &failure_message) const
template<typename F>
bool testing::internal::OnCallSpec< F >::Matches ( const ArgumentTuple args) const
inline

Definition at line 329 of file gmock-spec-builders.h.

References testing::internal::TupleMatches().

Referenced by testing::internal::FunctionMockerBase< R(A1, A2)>::FindOnCallSpec().

329  {
330  return TupleMatches(matchers_, args) && extra_matcher_.Matches(args);
331  }
Matcher< const ArgumentTuple & > extra_matcher_
bool TupleMatches(const MatcherTuple &matcher_tuple, const ValueTuple &value_tuple)
template<typename F>
bool testing::internal::OnCallSpec< F >::Matches ( const ArgumentTuple args) const
inline

Definition at line 329 of file gmock-spec-builders.h.

References testing::internal::TupleMatches().

329  {
330  return TupleMatches(matchers_, args) && extra_matcher_.Matches(args);
331  }
Matcher< const ArgumentTuple & > extra_matcher_
bool TupleMatches(const MatcherTuple &matcher_tuple, const ValueTuple &value_tuple)
template<typename F>
bool testing::internal::OnCallSpec< F >::Matches ( const ArgumentTuple args) const
inline

Definition at line 329 of file gmock-spec-builders.h.

References testing::internal::TupleMatches().

329  {
330  return TupleMatches(matchers_, args) && extra_matcher_.Matches(args);
331  }
Matcher< const ArgumentTuple & > extra_matcher_
bool TupleMatches(const MatcherTuple &matcher_tuple, const ValueTuple &value_tuple)
template<typename F>
OnCallSpec& testing::internal::OnCallSpec< F >::WillByDefault ( const Action< F > &  action)
inline

Definition at line 316 of file gmock-spec-builders.h.

References upload::action, and testing::Action< F >::IsDoDefault().

316  {
318  ".WillByDefault() must appear "
319  "exactly once in an ON_CALL().");
321 
322  ExpectSpecProperty(!action.IsDoDefault(),
323  "DoDefault() cannot be used in ON_CALL().");
324  action_ = action;
325  return *this;
326  }
void ExpectSpecProperty(bool property, const string &failure_message) const
action
Definition: upload.py:393
template<typename F>
OnCallSpec& testing::internal::OnCallSpec< F >::WillByDefault ( const Action< F > &  action)
inline

Definition at line 316 of file gmock-spec-builders.h.

References upload::action, and testing::Action< F >::IsDoDefault().

316  {
318  ".WillByDefault() must appear "
319  "exactly once in an ON_CALL().");
321 
322  ExpectSpecProperty(!action.IsDoDefault(),
323  "DoDefault() cannot be used in ON_CALL().");
324  action_ = action;
325  return *this;
326  }
void ExpectSpecProperty(bool property, const string &failure_message) const
action
Definition: upload.py:393
template<typename F>
OnCallSpec& testing::internal::OnCallSpec< F >::WillByDefault ( const Action< F > &  action)
inline

Definition at line 316 of file gmock-spec-builders.h.

References upload::action, and testing::Action< F >::IsDoDefault().

316  {
318  ".WillByDefault() must appear "
319  "exactly once in an ON_CALL().");
321 
322  ExpectSpecProperty(!action.IsDoDefault(),
323  "DoDefault() cannot be used in ON_CALL().");
324  action_ = action;
325  return *this;
326  }
void ExpectSpecProperty(bool property, const string &failure_message) const
action
Definition: upload.py:393
template<typename F>
OnCallSpec& testing::internal::OnCallSpec< F >::With ( const Matcher< const ArgumentTuple & > &  m)
inline

Definition at line 304 of file gmock-spec-builders.h.

References m.

304  {
305  // Makes sure this is called at most once.
307  ".With() cannot appear "
308  "more than once in an ON_CALL().");
310 
311  extra_matcher_ = m;
312  return *this;
313  }
void ExpectSpecProperty(bool property, const string &failure_message) const
Matcher< const ArgumentTuple & > extra_matcher_
static map< string, int > m
template<typename F>
OnCallSpec& testing::internal::OnCallSpec< F >::With ( const Matcher< const ArgumentTuple & > &  m)
inline

Definition at line 304 of file gmock-spec-builders.h.

References m.

304  {
305  // Makes sure this is called at most once.
307  ".With() cannot appear "
308  "more than once in an ON_CALL().");
310 
311  extra_matcher_ = m;
312  return *this;
313  }
void ExpectSpecProperty(bool property, const string &failure_message) const
Matcher< const ArgumentTuple & > extra_matcher_
static map< string, int > m
template<typename F>
OnCallSpec& testing::internal::OnCallSpec< F >::With ( const Matcher< const ArgumentTuple & > &  m)
inline

Definition at line 304 of file gmock-spec-builders.h.

References m.

304  {
305  // Makes sure this is called at most once.
307  ".With() cannot appear "
308  "more than once in an ON_CALL().");
310 
311  extra_matcher_ = m;
312  return *this;
313  }
void ExpectSpecProperty(bool property, const string &failure_message) const
Matcher< const ArgumentTuple & > extra_matcher_
static map< string, int > m

Member Data Documentation

template<typename F>
Action< F > testing::internal::OnCallSpec< F >::action_
private

Definition at line 357 of file gmock-spec-builders.h.

template<typename F>
Matcher< const ArgumentTuple & > testing::internal::OnCallSpec< F >::extra_matcher_
private

Definition at line 356 of file gmock-spec-builders.h.

template<typename F>
ArgumentMatcherTuple testing::internal::OnCallSpec< F >::matchers_
private

Definition at line 355 of file gmock-spec-builders.h.


The documentation for this class was generated from the following file: