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

#include <gmock-spec-builders.h>

Inheritance diagram for testing::internal::TypedExpectation< F >:
testing::internal::ExpectationBase testing::internal::ExpectationBase testing::internal::ExpectationBase

Public Types

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

Public Member Functions

 TypedExpectation (FunctionMockerBase< F > *owner, const char *a_file, int a_line, const string &a_source_text, const ArgumentMatcherTuple &m)
 
virtual ~TypedExpectation ()
 
TypedExpectationWith (const Matcher< const ArgumentTuple & > &m)
 
TypedExpectationTimes (const Cardinality &a_cardinality)
 
TypedExpectationTimes (int n)
 
TypedExpectationInSequence (const Sequence &s)
 
TypedExpectationInSequence (const Sequence &s1, const Sequence &s2)
 
TypedExpectationInSequence (const Sequence &s1, const Sequence &s2, const Sequence &s3)
 
TypedExpectationInSequence (const Sequence &s1, const Sequence &s2, const Sequence &s3, const Sequence &s4)
 
TypedExpectationInSequence (const Sequence &s1, const Sequence &s2, const Sequence &s3, const Sequence &s4, const Sequence &s5)
 
TypedExpectationAfter (const ExpectationSet &s)
 
TypedExpectationAfter (const ExpectationSet &s1, const ExpectationSet &s2)
 
TypedExpectationAfter (const ExpectationSet &s1, const ExpectationSet &s2, const ExpectationSet &s3)
 
TypedExpectationAfter (const ExpectationSet &s1, const ExpectationSet &s2, const ExpectationSet &s3, const ExpectationSet &s4)
 
TypedExpectationAfter (const ExpectationSet &s1, const ExpectationSet &s2, const ExpectationSet &s3, const ExpectationSet &s4, const ExpectationSet &s5)
 
TypedExpectationWillOnce (const Action< F > &action)
 
TypedExpectationWillRepeatedly (const Action< F > &action)
 
TypedExpectationRetiresOnSaturation ()
 
const ArgumentMatcherTuplematchers () const
 
const Matcher< const ArgumentTuple & > & extra_matcher () const
 
const Action< F > & repeated_action () const
 
virtual void MaybeDescribeExtraMatcherTo (::std::ostream *os)
 
 TypedExpectation (FunctionMockerBase< F > *owner, const char *a_file, int a_line, const string &a_source_text, const ArgumentMatcherTuple &m)
 
virtual ~TypedExpectation ()
 
TypedExpectationWith (const Matcher< const ArgumentTuple & > &m)
 
TypedExpectationTimes (const Cardinality &a_cardinality)
 
TypedExpectationTimes (int n)
 
TypedExpectationInSequence (const Sequence &s)
 
TypedExpectationInSequence (const Sequence &s1, const Sequence &s2)
 
TypedExpectationInSequence (const Sequence &s1, const Sequence &s2, const Sequence &s3)
 
TypedExpectationInSequence (const Sequence &s1, const Sequence &s2, const Sequence &s3, const Sequence &s4)
 
TypedExpectationInSequence (const Sequence &s1, const Sequence &s2, const Sequence &s3, const Sequence &s4, const Sequence &s5)
 
TypedExpectationAfter (const ExpectationSet &s)
 
TypedExpectationAfter (const ExpectationSet &s1, const ExpectationSet &s2)
 
TypedExpectationAfter (const ExpectationSet &s1, const ExpectationSet &s2, const ExpectationSet &s3)
 
TypedExpectationAfter (const ExpectationSet &s1, const ExpectationSet &s2, const ExpectationSet &s3, const ExpectationSet &s4)
 
TypedExpectationAfter (const ExpectationSet &s1, const ExpectationSet &s2, const ExpectationSet &s3, const ExpectationSet &s4, const ExpectationSet &s5)
 
TypedExpectationWillOnce (const Action< F > &action)
 
TypedExpectationWillRepeatedly (const Action< F > &action)
 
TypedExpectationRetiresOnSaturation ()
 
const ArgumentMatcherTuplematchers () const
 
const Matcher< const ArgumentTuple & > & extra_matcher () const
 
const Action< F > & repeated_action () const
 
virtual void MaybeDescribeExtraMatcherTo (::std::ostream *os)
 
 TypedExpectation (FunctionMockerBase< F > *owner, const char *a_file, int a_line, const string &a_source_text, const ArgumentMatcherTuple &m)
 
virtual ~TypedExpectation ()
 
TypedExpectationWith (const Matcher< const ArgumentTuple & > &m)
 
TypedExpectationTimes (const Cardinality &a_cardinality)
 
TypedExpectationTimes (int n)
 
TypedExpectationInSequence (const Sequence &s)
 
TypedExpectationInSequence (const Sequence &s1, const Sequence &s2)
 
TypedExpectationInSequence (const Sequence &s1, const Sequence &s2, const Sequence &s3)
 
TypedExpectationInSequence (const Sequence &s1, const Sequence &s2, const Sequence &s3, const Sequence &s4)
 
TypedExpectationInSequence (const Sequence &s1, const Sequence &s2, const Sequence &s3, const Sequence &s4, const Sequence &s5)
 
TypedExpectationAfter (const ExpectationSet &s)
 
TypedExpectationAfter (const ExpectationSet &s1, const ExpectationSet &s2)
 
TypedExpectationAfter (const ExpectationSet &s1, const ExpectationSet &s2, const ExpectationSet &s3)
 
TypedExpectationAfter (const ExpectationSet &s1, const ExpectationSet &s2, const ExpectationSet &s3, const ExpectationSet &s4)
 
TypedExpectationAfter (const ExpectationSet &s1, const ExpectationSet &s2, const ExpectationSet &s3, const ExpectationSet &s4, const ExpectationSet &s5)
 
TypedExpectationWillOnce (const Action< F > &action)
 
TypedExpectationWillRepeatedly (const Action< F > &action)
 
TypedExpectationRetiresOnSaturation ()
 
const ArgumentMatcherTuplematchers () const
 
const Matcher< const ArgumentTuple & > & extra_matcher () const
 
const Action< F > & repeated_action () const
 
virtual void MaybeDescribeExtraMatcherTo (::std::ostream *os)
 
- Public Member Functions inherited from testing::internal::ExpectationBase
 ExpectationBase (const char *file, int line, const string &source_text)
 
virtual ~ExpectationBase ()
 
const char * file () const
 
int line () const
 
const char * source_text () const
 
const Cardinalitycardinality () const
 
void DescribeLocationTo (::std::ostream *os) const
 
void DescribeCallCountTo (::std::ostream *os) const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
 
 ExpectationBase (const char *file, int line, const string &source_text)
 
virtual ~ExpectationBase ()
 
const char * file () const
 
int line () const
 
const char * source_text () const
 
const Cardinalitycardinality () const
 
void DescribeLocationTo (::std::ostream *os) const
 
void DescribeCallCountTo (::std::ostream *os) const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
 
 ExpectationBase (const char *file, int line, const string &source_text)
 
virtual ~ExpectationBase ()
 
const char * file () const
 
int line () const
 
const char * source_text () const
 
const Cardinalitycardinality () const
 
void DescribeLocationTo (::std::ostream *os) const
 
void DescribeCallCountTo (::std::ostream *os) const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
 

Private Member Functions

virtual Expectation GetHandle ()
 
bool Matches (const ArgumentTuple &args) const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
 
bool ShouldHandleArguments (const ArgumentTuple &args) const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
 
void ExplainMatchResultTo (const ArgumentTuple &args,::std::ostream *os) const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
 
const Action< F > & GetCurrentAction (const FunctionMockerBase< F > *mocker, const ArgumentTuple &args) const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
 
const Action< F > * GetActionForArguments (const FunctionMockerBase< F > *mocker, const ArgumentTuple &args,::std::ostream *what,::std::ostream *why) GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
 
 GTEST_DISALLOW_COPY_AND_ASSIGN_ (TypedExpectation)
 
virtual Expectation GetHandle ()
 
bool Matches (const ArgumentTuple &args) const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
 
bool ShouldHandleArguments (const ArgumentTuple &args) const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
 
void ExplainMatchResultTo (const ArgumentTuple &args,::std::ostream *os) const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
 
const Action< F > & GetCurrentAction (const FunctionMockerBase< F > *mocker, const ArgumentTuple &args) const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
 
const Action< F > * GetActionForArguments (const FunctionMockerBase< F > *mocker, const ArgumentTuple &args,::std::ostream *what,::std::ostream *why) GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
 
 GTEST_DISALLOW_COPY_AND_ASSIGN_ (TypedExpectation)
 
virtual Expectation GetHandle ()
 
bool Matches (const ArgumentTuple &args) const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
 
bool ShouldHandleArguments (const ArgumentTuple &args) const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
 
void ExplainMatchResultTo (const ArgumentTuple &args,::std::ostream *os) const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
 
const Action< F > & GetCurrentAction (const FunctionMockerBase< F > *mocker, const ArgumentTuple &args) const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
 
const Action< F > * GetActionForArguments (const FunctionMockerBase< F > *mocker, const ArgumentTuple &args,::std::ostream *what,::std::ostream *why) GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
 
 GTEST_DISALLOW_COPY_AND_ASSIGN_ (TypedExpectation)
 

Private Attributes

FunctionMockerBase< F > *const owner_
 
ArgumentMatcherTuple matchers_
 
Matcher< const ArgumentTuple & > extra_matcher_
 
Action< F > repeated_action_
 

Friends

template<typename Function >
class FunctionMockerBase
 
template<typename Function >
class FunctionMockerBase
 
template<typename Function >
class FunctionMockerBase
 

Additional Inherited Members

- Protected Types inherited from testing::internal::ExpectationBase
enum  Clause {
  kNone, kWith, kTimes, kInSequence,
  kAfter, kWillOnce, kWillRepeatedly, kRetiresOnSaturation,
  kNone, kWith, kTimes, kInSequence,
  kAfter, kWillOnce, kWillRepeatedly, kRetiresOnSaturation,
  kNone, kWith, kTimes, kInSequence,
  kAfter, kWillOnce, kWillRepeatedly, kRetiresOnSaturation
}
 
enum  Clause {
  kNone, kWith, kTimes, kInSequence,
  kAfter, kWillOnce, kWillRepeatedly, kRetiresOnSaturation,
  kNone, kWith, kTimes, kInSequence,
  kAfter, kWillOnce, kWillRepeatedly, kRetiresOnSaturation,
  kNone, kWith, kTimes, kInSequence,
  kAfter, kWillOnce, kWillRepeatedly, kRetiresOnSaturation
}
 
enum  Clause {
  kNone, kWith, kTimes, kInSequence,
  kAfter, kWillOnce, kWillRepeatedly, kRetiresOnSaturation,
  kNone, kWith, kTimes, kInSequence,
  kAfter, kWillOnce, kWillRepeatedly, kRetiresOnSaturation,
  kNone, kWith, kTimes, kInSequence,
  kAfter, kWillOnce, kWillRepeatedly, kRetiresOnSaturation
}
 
typedef std::vector< const void * > UntypedActions
 
typedef std::vector< const void * > UntypedActions
 
typedef std::vector< const void * > UntypedActions
 
- Protected Member Functions inherited from testing::internal::ExpectationBase
void AssertSpecProperty (bool property, const string &failure_message) const
 
void ExpectSpecProperty (bool property, const string &failure_message) const
 
void SpecifyCardinality (const Cardinality &cardinality)
 
bool cardinality_specified () const
 
void set_cardinality (const Cardinality &a_cardinality)
 
void RetireAllPreRequisites () GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
 
bool is_retired () const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
 
void Retire () GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
 
bool IsSatisfied () const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
 
bool IsSaturated () const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
 
bool IsOverSaturated () const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
 
bool AllPrerequisitesAreSatisfied () const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
 
void FindUnsatisfiedPrerequisites (ExpectationSet *result) const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
 
int call_count () const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
 
void IncrementCallCount () GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
 
void CheckActionCountIfNotDone () const GTEST_LOCK_EXCLUDED_(mutex_)
 
void UntypedTimes (const Cardinality &a_cardinality)
 
 GTEST_DISALLOW_ASSIGN_ (ExpectationBase)
 
void AssertSpecProperty (bool property, const string &failure_message) const
 
void ExpectSpecProperty (bool property, const string &failure_message) const
 
void SpecifyCardinality (const Cardinality &cardinality)
 
bool cardinality_specified () const
 
void set_cardinality (const Cardinality &a_cardinality)
 
void RetireAllPreRequisites () GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
 
bool is_retired () const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
 
void Retire () GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
 
bool IsSatisfied () const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
 
bool IsSaturated () const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
 
bool IsOverSaturated () const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
 
bool AllPrerequisitesAreSatisfied () const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
 
void FindUnsatisfiedPrerequisites (ExpectationSet *result) const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
 
int call_count () const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
 
void IncrementCallCount () GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
 
void CheckActionCountIfNotDone () const GTEST_LOCK_EXCLUDED_(mutex_)
 
void UntypedTimes (const Cardinality &a_cardinality)
 
 GTEST_DISALLOW_ASSIGN_ (ExpectationBase)
 
void AssertSpecProperty (bool property, const string &failure_message) const
 
void ExpectSpecProperty (bool property, const string &failure_message) const
 
void SpecifyCardinality (const Cardinality &cardinality)
 
bool cardinality_specified () const
 
void set_cardinality (const Cardinality &a_cardinality)
 
void RetireAllPreRequisites () GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
 
bool is_retired () const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
 
void Retire () GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
 
bool IsSatisfied () const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
 
bool IsSaturated () const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
 
bool IsOverSaturated () const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
 
bool AllPrerequisitesAreSatisfied () const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
 
void FindUnsatisfiedPrerequisites (ExpectationSet *result) const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
 
int call_count () const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
 
void IncrementCallCount () GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
 
void CheckActionCountIfNotDone () const GTEST_LOCK_EXCLUDED_(mutex_)
 
void UntypedTimes (const Cardinality &a_cardinality)
 
 GTEST_DISALLOW_ASSIGN_ (ExpectationBase)
 
- Protected Attributes inherited from testing::internal::ExpectationBase
const char * file_
 
int line_
 
const string source_text_
 
bool cardinality_specified_
 
Cardinality cardinality_
 
ExpectationSet immediate_prerequisites_
 
int call_count_
 
bool retired_
 
UntypedActions untyped_actions_
 
bool extra_matcher_specified_
 
bool repeated_action_specified_
 
bool retires_on_saturation_
 
Clause last_clause_
 
bool action_count_checked_
 
Mutex mutex_
 

Detailed Description

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

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

Member Typedef Documentation

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

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

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

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

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

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

template<typename F>
typedef Function<F>::Result testing::internal::TypedExpectation< F >::Result

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

template<typename F>
typedef Function<F>::Result testing::internal::TypedExpectation< F >::Result

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

template<typename F>
typedef Function<F>::Result testing::internal::TypedExpectation< F >::Result

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

Constructor & Destructor Documentation

template<typename F>
testing::internal::TypedExpectation< F >::TypedExpectation ( FunctionMockerBase< F > *  owner,
const char *  a_file,
int  a_line,
const string a_source_text,
const ArgumentMatcherTuple m 
)
inline

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

886  : ExpectationBase(a_file, a_line, a_source_text),
887  owner_(owner),
888  matchers_(m),
889  // By default, extra_matcher_ should match anything. However,
890  // we cannot initialize it with _ as that triggers a compiler
891  // bug in Symbian's C++ compiler (cannot decide between two
892  // overloaded constructors of Matcher<const ArgumentTuple&>).
893  extra_matcher_(A<const ArgumentTuple&>()),
ExpectationBase(const char *file, int line, const string &source_text)
FunctionMockerBase< F > *const owner_
static map< string, int > m
Matcher< const ArgumentTuple & > extra_matcher_
internal::DoDefaultAction DoDefault()
template<typename F>
virtual testing::internal::TypedExpectation< F >::~TypedExpectation ( )
inlinevirtual

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

896  {
897  // Check the validity of the action count if it hasn't been done
898  // yet (for example, if the expectation was never used).
900  for (UntypedActions::const_iterator it = untyped_actions_.begin();
901  it != untyped_actions_.end(); ++it) {
902  delete static_cast<const Action<F>*>(*it);
903  }
904  }
void CheckActionCountIfNotDone() const GTEST_LOCK_EXCLUDED_(mutex_)
template<typename F>
testing::internal::TypedExpectation< F >::TypedExpectation ( FunctionMockerBase< F > *  owner,
const char *  a_file,
int  a_line,
const string a_source_text,
const ArgumentMatcherTuple m 
)
inline

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

886  : ExpectationBase(a_file, a_line, a_source_text),
887  owner_(owner),
888  matchers_(m),
889  // By default, extra_matcher_ should match anything. However,
890  // we cannot initialize it with _ as that triggers a compiler
891  // bug in Symbian's C++ compiler (cannot decide between two
892  // overloaded constructors of Matcher<const ArgumentTuple&>).
893  extra_matcher_(A<const ArgumentTuple&>()),
ExpectationBase(const char *file, int line, const string &source_text)
FunctionMockerBase< F > *const owner_
static map< string, int > m
Matcher< const ArgumentTuple & > extra_matcher_
internal::DoDefaultAction DoDefault()
template<typename F>
virtual testing::internal::TypedExpectation< F >::~TypedExpectation ( )
inlinevirtual

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

896  {
897  // Check the validity of the action count if it hasn't been done
898  // yet (for example, if the expectation was never used).
900  for (UntypedActions::const_iterator it = untyped_actions_.begin();
901  it != untyped_actions_.end(); ++it) {
902  delete static_cast<const Action<F>*>(*it);
903  }
904  }
void CheckActionCountIfNotDone() const GTEST_LOCK_EXCLUDED_(mutex_)
template<typename F>
testing::internal::TypedExpectation< F >::TypedExpectation ( FunctionMockerBase< F > *  owner,
const char *  a_file,
int  a_line,
const string a_source_text,
const ArgumentMatcherTuple m 
)
inline

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

886  : ExpectationBase(a_file, a_line, a_source_text),
887  owner_(owner),
888  matchers_(m),
889  // By default, extra_matcher_ should match anything. However,
890  // we cannot initialize it with _ as that triggers a compiler
891  // bug in Symbian's C++ compiler (cannot decide between two
892  // overloaded constructors of Matcher<const ArgumentTuple&>).
893  extra_matcher_(A<const ArgumentTuple&>()),
ExpectationBase(const char *file, int line, const string &source_text)
FunctionMockerBase< F > *const owner_
static map< string, int > m
Matcher< const ArgumentTuple & > extra_matcher_
internal::DoDefaultAction DoDefault()
template<typename F>
virtual testing::internal::TypedExpectation< F >::~TypedExpectation ( )
inlinevirtual

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

896  {
897  // Check the validity of the action count if it hasn't been done
898  // yet (for example, if the expectation was never used).
900  for (UntypedActions::const_iterator it = untyped_actions_.begin();
901  it != untyped_actions_.end(); ++it) {
902  delete static_cast<const Action<F>*>(*it);
903  }
904  }
void CheckActionCountIfNotDone() const GTEST_LOCK_EXCLUDED_(mutex_)

Member Function Documentation

template<typename F>
TypedExpectation& testing::internal::TypedExpectation< F >::After ( const ExpectationSet s)
inline

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

References testing::ExpectationSet::begin(), and testing::ExpectationSet::end().

Referenced by testing::internal::TypedExpectation< F >::After().

964  {
966  ".After() cannot appear after .WillOnce(),"
967  " .WillRepeatedly(), or "
968  ".RetiresOnSaturation().");
970 
971  for (ExpectationSet::const_iterator it = s.begin(); it != s.end(); ++it) {
973  }
974  return *this;
975  }
void ExpectSpecProperty(bool property, const string &failure_message) const
Expectation::Set::const_iterator const_iterator
static set< string > s
template<typename F>
TypedExpectation& testing::internal::TypedExpectation< F >::After ( const ExpectationSet s)
inline

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

References testing::ExpectationSet::begin(), and testing::ExpectationSet::end().

964  {
966  ".After() cannot appear after .WillOnce(),"
967  " .WillRepeatedly(), or "
968  ".RetiresOnSaturation().");
970 
971  for (ExpectationSet::const_iterator it = s.begin(); it != s.end(); ++it) {
973  }
974  return *this;
975  }
void ExpectSpecProperty(bool property, const string &failure_message) const
Expectation::Set::const_iterator const_iterator
static set< string > s
template<typename F>
TypedExpectation& testing::internal::TypedExpectation< F >::After ( const ExpectationSet s)
inline

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

References testing::ExpectationSet::begin(), and testing::ExpectationSet::end().

964  {
966  ".After() cannot appear after .WillOnce(),"
967  " .WillRepeatedly(), or "
968  ".RetiresOnSaturation().");
970 
971  for (ExpectationSet::const_iterator it = s.begin(); it != s.end(); ++it) {
973  }
974  return *this;
975  }
void ExpectSpecProperty(bool property, const string &failure_message) const
Expectation::Set::const_iterator const_iterator
static set< string > s
template<typename F>
TypedExpectation& testing::internal::TypedExpectation< F >::After ( const ExpectationSet s1,
const ExpectationSet s2 
)
inline

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

References testing::internal::TypedExpectation< F >::After().

976  {
977  return After(s1).After(s2);
978  }
TypedExpectation & After(const ExpectationSet &s)
template<typename F>
TypedExpectation& testing::internal::TypedExpectation< F >::After ( const ExpectationSet s1,
const ExpectationSet s2 
)
inline

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

References testing::internal::TypedExpectation< F >::After().

976  {
977  return After(s1).After(s2);
978  }
TypedExpectation & After(const ExpectationSet &s)
template<typename F>
TypedExpectation& testing::internal::TypedExpectation< F >::After ( const ExpectationSet s1,
const ExpectationSet s2 
)
inline

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

References testing::internal::TypedExpectation< F >::After().

976  {
977  return After(s1).After(s2);
978  }
TypedExpectation & After(const ExpectationSet &s)
template<typename F>
TypedExpectation& testing::internal::TypedExpectation< F >::After ( const ExpectationSet s1,
const ExpectationSet s2,
const ExpectationSet s3 
)
inline

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

References testing::internal::TypedExpectation< F >::After().

980  {
981  return After(s1, s2).After(s3);
982  }
TypedExpectation & After(const ExpectationSet &s)
template<typename F>
TypedExpectation& testing::internal::TypedExpectation< F >::After ( const ExpectationSet s1,
const ExpectationSet s2,
const ExpectationSet s3 
)
inline

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

References testing::internal::TypedExpectation< F >::After().

980  {
981  return After(s1, s2).After(s3);
982  }
TypedExpectation & After(const ExpectationSet &s)
template<typename F>
TypedExpectation& testing::internal::TypedExpectation< F >::After ( const ExpectationSet s1,
const ExpectationSet s2,
const ExpectationSet s3 
)
inline

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

References testing::internal::TypedExpectation< F >::After().

980  {
981  return After(s1, s2).After(s3);
982  }
TypedExpectation & After(const ExpectationSet &s)
template<typename F>
TypedExpectation& testing::internal::TypedExpectation< F >::After ( const ExpectationSet s1,
const ExpectationSet s2,
const ExpectationSet s3,
const ExpectationSet s4 
)
inline

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

References testing::internal::TypedExpectation< F >::After().

984  {
985  return After(s1, s2, s3).After(s4);
986  }
TypedExpectation & After(const ExpectationSet &s)
template<typename F>
TypedExpectation& testing::internal::TypedExpectation< F >::After ( const ExpectationSet s1,
const ExpectationSet s2,
const ExpectationSet s3,
const ExpectationSet s4 
)
inline

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

References testing::internal::TypedExpectation< F >::After().

984  {
985  return After(s1, s2, s3).After(s4);
986  }
TypedExpectation & After(const ExpectationSet &s)
template<typename F>
TypedExpectation& testing::internal::TypedExpectation< F >::After ( const ExpectationSet s1,
const ExpectationSet s2,
const ExpectationSet s3,
const ExpectationSet s4 
)
inline

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

References testing::internal::TypedExpectation< F >::After().

984  {
985  return After(s1, s2, s3).After(s4);
986  }
TypedExpectation & After(const ExpectationSet &s)
template<typename F>
TypedExpectation& testing::internal::TypedExpectation< F >::After ( const ExpectationSet s1,
const ExpectationSet s2,
const ExpectationSet s3,
const ExpectationSet s4,
const ExpectationSet s5 
)
inline

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

References testing::internal::TypedExpectation< F >::After().

989  {
990  return After(s1, s2, s3, s4).After(s5);
991  }
TypedExpectation & After(const ExpectationSet &s)
template<typename F>
TypedExpectation& testing::internal::TypedExpectation< F >::After ( const ExpectationSet s1,
const ExpectationSet s2,
const ExpectationSet s3,
const ExpectationSet s4,
const ExpectationSet s5 
)
inline

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

References testing::internal::TypedExpectation< F >::After().

989  {
990  return After(s1, s2, s3, s4).After(s5);
991  }
TypedExpectation & After(const ExpectationSet &s)
template<typename F>
TypedExpectation& testing::internal::TypedExpectation< F >::After ( const ExpectationSet s1,
const ExpectationSet s2,
const ExpectationSet s3,
const ExpectationSet s4,
const ExpectationSet s5 
)
inline

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

References testing::internal::TypedExpectation< F >::After().

989  {
990  return After(s1, s2, s3, s4).After(s5);
991  }
TypedExpectation & After(const ExpectationSet &s)
template<typename F>
void testing::internal::TypedExpectation< F >::ExplainMatchResultTo ( const ArgumentTuple args,
::std::ostream *  os 
) const
inlineprivate

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

References testing::ExpectationSet::begin(), testing::ExpectationSet::end(), testing::internal::ExplainMatchFailureTupleTo(), i, testing::Matches(), testing::internal::PrintIfNotEmpty(), testing::StringMatchResultListener::str(), and testing::internal::TupleMatches().

1109  {
1110  g_gmock_mutex.AssertHeld();
1111 
1112  if (is_retired()) {
1113  *os << " Expected: the expectation is active\n"
1114  << " Actual: it is retired\n";
1115  } else if (!Matches(args)) {
1116  if (!TupleMatches(matchers_, args)) {
1118  }
1119  StringMatchResultListener listener;
1120  if (!extra_matcher_.MatchAndExplain(args, &listener)) {
1121  *os << " Expected args: ";
1123  *os << "\n Actual: don't match";
1124 
1125  internal::PrintIfNotEmpty(listener.str(), os);
1126  *os << "\n";
1127  }
1128  } else if (!AllPrerequisitesAreSatisfied()) {
1129  *os << " Expected: all pre-requisites are satisfied\n"
1130  << " Actual: the following immediate pre-requisites "
1131  << "are not satisfied:\n";
1132  ExpectationSet unsatisfied_prereqs;
1133  FindUnsatisfiedPrerequisites(&unsatisfied_prereqs);
1134  int i = 0;
1135  for (ExpectationSet::const_iterator it = unsatisfied_prereqs.begin();
1136  it != unsatisfied_prereqs.end(); ++it) {
1137  it->expectation_base()->DescribeLocationTo(os);
1138  *os << "pre-requisite #" << i++ << "\n";
1139  }
1140  *os << " (end of pre-requisites)\n";
1141  } else {
1142  // This line is here just for completeness' sake. It will never
1143  // be executed as currently the ExplainMatchResultTo() function
1144  // is called only when the mock function call does NOT match the
1145  // expectation.
1146  *os << "The call matches the expectation.\n";
1147  }
1148  }
bool Matches(const ArgumentTuple &args) const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
void FindUnsatisfiedPrerequisites(ExpectationSet *result) const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
bool is_retired() const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
bool TupleMatches(const MatcherTuple &matcher_tuple, const ValueTuple &value_tuple)
Expectation::Set::const_iterator const_iterator
bool MatchAndExplain(T x, MatchResultListener *listener) const
bool AllPrerequisitesAreSatisfied() const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
void DescribeTo(::std::ostream *os) const
void PrintIfNotEmpty(const internal::string &explanation,::std::ostream *os)
void ExplainMatchFailureTupleTo(const MatcherTuple &matchers, const ValueTuple &values,::std::ostream *os)
Matcher< const ArgumentTuple & > extra_matcher_
template<typename F>
void testing::internal::TypedExpectation< F >::ExplainMatchResultTo ( const ArgumentTuple args,
::std::ostream *  os 
) const
inlineprivate

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

References testing::ExpectationSet::begin(), testing::ExpectationSet::end(), testing::internal::ExplainMatchFailureTupleTo(), i, testing::Matches(), testing::internal::PrintIfNotEmpty(), testing::StringMatchResultListener::str(), and testing::internal::TupleMatches().

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

1109  {
1110  g_gmock_mutex.AssertHeld();
1111 
1112  if (is_retired()) {
1113  *os << " Expected: the expectation is active\n"
1114  << " Actual: it is retired\n";
1115  } else if (!Matches(args)) {
1116  if (!TupleMatches(matchers_, args)) {
1118  }
1119  StringMatchResultListener listener;
1120  if (!extra_matcher_.MatchAndExplain(args, &listener)) {
1121  *os << " Expected args: ";
1123  *os << "\n Actual: don't match";
1124 
1125  internal::PrintIfNotEmpty(listener.str(), os);
1126  *os << "\n";
1127  }
1128  } else if (!AllPrerequisitesAreSatisfied()) {
1129  *os << " Expected: all pre-requisites are satisfied\n"
1130  << " Actual: the following immediate pre-requisites "
1131  << "are not satisfied:\n";
1132  ExpectationSet unsatisfied_prereqs;
1133  FindUnsatisfiedPrerequisites(&unsatisfied_prereqs);
1134  int i = 0;
1135  for (ExpectationSet::const_iterator it = unsatisfied_prereqs.begin();
1136  it != unsatisfied_prereqs.end(); ++it) {
1137  it->expectation_base()->DescribeLocationTo(os);
1138  *os << "pre-requisite #" << i++ << "\n";
1139  }
1140  *os << " (end of pre-requisites)\n";
1141  } else {
1142  // This line is here just for completeness' sake. It will never
1143  // be executed as currently the ExplainMatchResultTo() function
1144  // is called only when the mock function call does NOT match the
1145  // expectation.
1146  *os << "The call matches the expectation.\n";
1147  }
1148  }
bool Matches(const ArgumentTuple &args) const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
void FindUnsatisfiedPrerequisites(ExpectationSet *result) const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
bool is_retired() const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
bool TupleMatches(const MatcherTuple &matcher_tuple, const ValueTuple &value_tuple)
Expectation::Set::const_iterator const_iterator
bool MatchAndExplain(T x, MatchResultListener *listener) const
bool AllPrerequisitesAreSatisfied() const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
void DescribeTo(::std::ostream *os) const
void PrintIfNotEmpty(const internal::string &explanation,::std::ostream *os)
void ExplainMatchFailureTupleTo(const MatcherTuple &matchers, const ValueTuple &values,::std::ostream *os)
Matcher< const ArgumentTuple & > extra_matcher_
template<typename F>
void testing::internal::TypedExpectation< F >::ExplainMatchResultTo ( const ArgumentTuple args,
::std::ostream *  os 
) const
inlineprivate

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

References testing::ExpectationSet::begin(), testing::ExpectationSet::end(), testing::internal::ExplainMatchFailureTupleTo(), i, testing::Matches(), testing::internal::PrintIfNotEmpty(), testing::StringMatchResultListener::str(), and testing::internal::TupleMatches().

1109  {
1110  g_gmock_mutex.AssertHeld();
1111 
1112  if (is_retired()) {
1113  *os << " Expected: the expectation is active\n"
1114  << " Actual: it is retired\n";
1115  } else if (!Matches(args)) {
1116  if (!TupleMatches(matchers_, args)) {
1118  }
1119  StringMatchResultListener listener;
1120  if (!extra_matcher_.MatchAndExplain(args, &listener)) {
1121  *os << " Expected args: ";
1123  *os << "\n Actual: don't match";
1124 
1125  internal::PrintIfNotEmpty(listener.str(), os);
1126  *os << "\n";
1127  }
1128  } else if (!AllPrerequisitesAreSatisfied()) {
1129  *os << " Expected: all pre-requisites are satisfied\n"
1130  << " Actual: the following immediate pre-requisites "
1131  << "are not satisfied:\n";
1132  ExpectationSet unsatisfied_prereqs;
1133  FindUnsatisfiedPrerequisites(&unsatisfied_prereqs);
1134  int i = 0;
1135  for (ExpectationSet::const_iterator it = unsatisfied_prereqs.begin();
1136  it != unsatisfied_prereqs.end(); ++it) {
1137  it->expectation_base()->DescribeLocationTo(os);
1138  *os << "pre-requisite #" << i++ << "\n";
1139  }
1140  *os << " (end of pre-requisites)\n";
1141  } else {
1142  // This line is here just for completeness' sake. It will never
1143  // be executed as currently the ExplainMatchResultTo() function
1144  // is called only when the mock function call does NOT match the
1145  // expectation.
1146  *os << "The call matches the expectation.\n";
1147  }
1148  }
bool Matches(const ArgumentTuple &args) const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
void FindUnsatisfiedPrerequisites(ExpectationSet *result) const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
bool is_retired() const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
bool TupleMatches(const MatcherTuple &matcher_tuple, const ValueTuple &value_tuple)
Expectation::Set::const_iterator const_iterator
bool MatchAndExplain(T x, MatchResultListener *listener) const
bool AllPrerequisitesAreSatisfied() const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
void DescribeTo(::std::ostream *os) const
void PrintIfNotEmpty(const internal::string &explanation,::std::ostream *os)
void ExplainMatchFailureTupleTo(const MatcherTuple &matchers, const ValueTuple &values,::std::ostream *os)
Matcher< const ArgumentTuple & > extra_matcher_
template<typename F>
const Matcher<const ArgumentTuple&>& testing::internal::TypedExpectation< F >::extra_matcher ( ) const
inline

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

1053  {
1054  return extra_matcher_;
1055  }
Matcher< const ArgumentTuple & > extra_matcher_
template<typename F>
const Matcher<const ArgumentTuple&>& testing::internal::TypedExpectation< F >::extra_matcher ( ) const
inline

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

1053  {
1054  return extra_matcher_;
1055  }
Matcher< const ArgumentTuple & > extra_matcher_
template<typename F>
const Matcher<const ArgumentTuple&>& testing::internal::TypedExpectation< F >::extra_matcher ( ) const
inline

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

1053  {
1054  return extra_matcher_;
1055  }
Matcher< const ArgumentTuple & > extra_matcher_
template<typename F>
const Action<F>* testing::internal::TypedExpectation< F >::GetActionForArguments ( const FunctionMockerBase< F > *  mocker,
const ArgumentTuple args,
::std::ostream *  what,
::std::ostream *  why 
)
inlineprivate

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

References GTEST_API_, GTEST_DISALLOW_COPY_AND_ASSIGN_, and testing::internal::LogWithLocation().

1193  {
1194  g_gmock_mutex.AssertHeld();
1195  if (IsSaturated()) {
1196  // We have an excessive call.
1198  *what << "Mock function called more times than expected - ";
1199  mocker->DescribeDefaultActionTo(args, what);
1200  DescribeCallCountTo(why);
1201 
1202  // TODO(wan@google.com): allow the user to control whether
1203  // unexpected calls should fail immediately or continue using a
1204  // flag --gmock_unexpected_calls_are_fatal.
1205  return NULL;
1206  }
1207 
1210 
1212  Retire();
1213  }
1214 
1215  // Must be done after IncrementCount()!
1216  *what << "Mock function call matches " << source_text() <<"...\n";
1217  return &(GetCurrentAction(mocker, args));
1218  }
void RetireAllPreRequisites() GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
void IncrementCallCount() GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
void Retire() GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
bool IsSaturated() const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
const Action< F > & GetCurrentAction(const FunctionMockerBase< F > *mocker, const ArgumentTuple &args) const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
void DescribeCallCountTo(::std::ostream *os) const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
template<typename F>
const Action<F>* testing::internal::TypedExpectation< F >::GetActionForArguments ( const FunctionMockerBase< F > *  mocker,
const ArgumentTuple args,
::std::ostream *  what,
::std::ostream *  why 
)
inlineprivate

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

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

1193  {
1194  g_gmock_mutex.AssertHeld();
1195  if (IsSaturated()) {
1196  // We have an excessive call.
1198  *what << "Mock function called more times than expected - ";
1199  mocker->DescribeDefaultActionTo(args, what);
1200  DescribeCallCountTo(why);
1201 
1202  // TODO(wan@google.com): allow the user to control whether
1203  // unexpected calls should fail immediately or continue using a
1204  // flag --gmock_unexpected_calls_are_fatal.
1205  return NULL;
1206  }
1207 
1210 
1212  Retire();
1213  }
1214 
1215  // Must be done after IncrementCount()!
1216  *what << "Mock function call matches " << source_text() <<"...\n";
1217  return &(GetCurrentAction(mocker, args));
1218  }
void RetireAllPreRequisites() GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
void IncrementCallCount() GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
void Retire() GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
bool IsSaturated() const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
const Action< F > & GetCurrentAction(const FunctionMockerBase< F > *mocker, const ArgumentTuple &args) const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
void DescribeCallCountTo(::std::ostream *os) const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
template<typename F>
const Action<F>* testing::internal::TypedExpectation< F >::GetActionForArguments ( const FunctionMockerBase< F > *  mocker,
const ArgumentTuple args,
::std::ostream *  what,
::std::ostream *  why 
)
inlineprivate

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

References GTEST_API_, GTEST_DISALLOW_COPY_AND_ASSIGN_, and testing::internal::LogWithLocation().

1193  {
1194  g_gmock_mutex.AssertHeld();
1195  if (IsSaturated()) {
1196  // We have an excessive call.
1198  *what << "Mock function called more times than expected - ";
1199  mocker->DescribeDefaultActionTo(args, what);
1200  DescribeCallCountTo(why);
1201 
1202  // TODO(wan@google.com): allow the user to control whether
1203  // unexpected calls should fail immediately or continue using a
1204  // flag --gmock_unexpected_calls_are_fatal.
1205  return NULL;
1206  }
1207 
1210 
1212  Retire();
1213  }
1214 
1215  // Must be done after IncrementCount()!
1216  *what << "Mock function call matches " << source_text() <<"...\n";
1217  return &(GetCurrentAction(mocker, args));
1218  }
void RetireAllPreRequisites() GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
void IncrementCallCount() GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
void Retire() GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
bool IsSaturated() const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
const Action< F > & GetCurrentAction(const FunctionMockerBase< F > *mocker, const ArgumentTuple &args) const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
void DescribeCallCountTo(::std::ostream *os) const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
template<typename F>
const Action<F>& testing::internal::TypedExpectation< F >::GetCurrentAction ( const FunctionMockerBase< F > *  mocker,
const ArgumentTuple args 
) const
inlineprivate

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

References testing::internal::Assert(), count, testing::internal::kWarning, and testing::internal::Log().

1154  {
1155  g_gmock_mutex.AssertHeld();
1156  const int count = call_count();
1157  Assert(count >= 1, __FILE__, __LINE__,
1158  "call_count() is <= 0 when GetCurrentAction() is "
1159  "called - this should never happen.");
1160 
1161  const int action_count = static_cast<int>(untyped_actions_.size());
1162  if (action_count > 0 && !repeated_action_specified_ &&
1163  count > action_count) {
1164  // If there is at least one WillOnce() and no WillRepeatedly(),
1165  // we warn the user when the WillOnce() clauses ran out.
1166  ::std::stringstream ss;
1167  DescribeLocationTo(&ss);
1168  ss << "Actions ran out in " << source_text() << "...\n"
1169  << "Called " << count << " times, but only "
1170  << action_count << " WillOnce()"
1171  << (action_count == 1 ? " is" : "s are") << " specified - ";
1172  mocker->DescribeDefaultActionTo(args, &ss);
1173  Log(kWarning, ss.str(), 1);
1174  }
1175 
1176  return count <= action_count ?
1177  *static_cast<const Action<F>*>(untyped_actions_[count - 1]) :
1178  repeated_action();
1179  }
void DescribeLocationTo(::std::ostream *os) const
const Action< F > & repeated_action() const
int call_count() const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
GTEST_API_ void Log(LogSeverity severity, const string &message, int stack_frames_to_skip)
int * count
void Assert(bool condition, const char *file, int line)
template<typename F>
const Action<F>& testing::internal::TypedExpectation< F >::GetCurrentAction ( const FunctionMockerBase< F > *  mocker,
const ArgumentTuple args 
) const
inlineprivate

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

References testing::internal::Assert(), count, testing::internal::kWarning, and testing::internal::Log().

1154  {
1155  g_gmock_mutex.AssertHeld();
1156  const int count = call_count();
1157  Assert(count >= 1, __FILE__, __LINE__,
1158  "call_count() is <= 0 when GetCurrentAction() is "
1159  "called - this should never happen.");
1160 
1161  const int action_count = static_cast<int>(untyped_actions_.size());
1162  if (action_count > 0 && !repeated_action_specified_ &&
1163  count > action_count) {
1164  // If there is at least one WillOnce() and no WillRepeatedly(),
1165  // we warn the user when the WillOnce() clauses ran out.
1166  ::std::stringstream ss;
1167  DescribeLocationTo(&ss);
1168  ss << "Actions ran out in " << source_text() << "...\n"
1169  << "Called " << count << " times, but only "
1170  << action_count << " WillOnce()"
1171  << (action_count == 1 ? " is" : "s are") << " specified - ";
1172  mocker->DescribeDefaultActionTo(args, &ss);
1173  Log(kWarning, ss.str(), 1);
1174  }
1175 
1176  return count <= action_count ?
1177  *static_cast<const Action<F>*>(untyped_actions_[count - 1]) :
1178  repeated_action();
1179  }
void DescribeLocationTo(::std::ostream *os) const
const Action< F > & repeated_action() const
int call_count() const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
GTEST_API_ void Log(LogSeverity severity, const string &message, int stack_frames_to_skip)
int * count
void Assert(bool condition, const char *file, int line)
template<typename F>
const Action<F>& testing::internal::TypedExpectation< F >::GetCurrentAction ( const FunctionMockerBase< F > *  mocker,
const ArgumentTuple args 
) const
inlineprivate

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

References testing::internal::Assert(), count, testing::internal::kWarning, and testing::internal::Log().

1154  {
1155  g_gmock_mutex.AssertHeld();
1156  const int count = call_count();
1157  Assert(count >= 1, __FILE__, __LINE__,
1158  "call_count() is <= 0 when GetCurrentAction() is "
1159  "called - this should never happen.");
1160 
1161  const int action_count = static_cast<int>(untyped_actions_.size());
1162  if (action_count > 0 && !repeated_action_specified_ &&
1163  count > action_count) {
1164  // If there is at least one WillOnce() and no WillRepeatedly(),
1165  // we warn the user when the WillOnce() clauses ran out.
1166  ::std::stringstream ss;
1167  DescribeLocationTo(&ss);
1168  ss << "Actions ran out in " << source_text() << "...\n"
1169  << "Called " << count << " times, but only "
1170  << action_count << " WillOnce()"
1171  << (action_count == 1 ? " is" : "s are") << " specified - ";
1172  mocker->DescribeDefaultActionTo(args, &ss);
1173  Log(kWarning, ss.str(), 1);
1174  }
1175 
1176  return count <= action_count ?
1177  *static_cast<const Action<F>*>(untyped_actions_[count - 1]) :
1178  repeated_action();
1179  }
void DescribeLocationTo(::std::ostream *os) const
const Action< F > & repeated_action() const
int call_count() const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
GTEST_API_ void Log(LogSeverity severity, const string &message, int stack_frames_to_skip)
int * count
void Assert(bool condition, const char *file, int line)
template<typename F>
virtual Expectation testing::internal::TypedExpectation< F >::GetHandle ( )
inlineprivatevirtual

Implements testing::internal::ExpectationBase.

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

1076  {
1077  return owner_->GetHandleOf(this);
1078  }
FunctionMockerBase< F > *const owner_
template<typename F>
virtual Expectation testing::internal::TypedExpectation< F >::GetHandle ( )
inlineprivatevirtual

Implements testing::internal::ExpectationBase.

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

1076  {
1077  return owner_->GetHandleOf(this);
1078  }
FunctionMockerBase< F > *const owner_
template<typename F>
virtual Expectation testing::internal::TypedExpectation< F >::GetHandle ( )
inlineprivatevirtual

Implements testing::internal::ExpectationBase.

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

1076  {
1077  return owner_->GetHandleOf(this);
1078  }
FunctionMockerBase< F > *const owner_
template<typename F>
testing::internal::TypedExpectation< F >::GTEST_DISALLOW_COPY_AND_ASSIGN_ ( TypedExpectation< F >  )
private
template<typename F>
testing::internal::TypedExpectation< F >::GTEST_DISALLOW_COPY_AND_ASSIGN_ ( TypedExpectation< F >  )
private
template<typename F>
testing::internal::TypedExpectation< F >::GTEST_DISALLOW_COPY_AND_ASSIGN_ ( TypedExpectation< F >  )
private
template<typename F>
TypedExpectation& testing::internal::TypedExpectation< F >::InSequence ( const Sequence s)
inline

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

References testing::Sequence::AddExpectation().

936  {
938  ".InSequence() cannot appear after .After(),"
939  " .WillOnce(), .WillRepeatedly(), or "
940  ".RetiresOnSaturation().");
942 
943  s.AddExpectation(GetHandle());
944  return *this;
945  }
void ExpectSpecProperty(bool property, const string &failure_message) const
static set< string > s
template<typename F>
TypedExpectation& testing::internal::TypedExpectation< F >::InSequence ( const Sequence s)
inline

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

References testing::Sequence::AddExpectation().

936  {
938  ".InSequence() cannot appear after .After(),"
939  " .WillOnce(), .WillRepeatedly(), or "
940  ".RetiresOnSaturation().");
942 
943  s.AddExpectation(GetHandle());
944  return *this;
945  }
void ExpectSpecProperty(bool property, const string &failure_message) const
static set< string > s
template<typename F>
TypedExpectation& testing::internal::TypedExpectation< F >::InSequence ( const Sequence s)
inline

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

References testing::Sequence::AddExpectation().

936  {
938  ".InSequence() cannot appear after .After(),"
939  " .WillOnce(), .WillRepeatedly(), or "
940  ".RetiresOnSaturation().");
942 
943  s.AddExpectation(GetHandle());
944  return *this;
945  }
void ExpectSpecProperty(bool property, const string &failure_message) const
static set< string > s
template<typename F>
TypedExpectation& testing::internal::TypedExpectation< F >::InSequence ( const Sequence s1,
const Sequence s2 
)
inline

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

946  {
947  return InSequence(s1).InSequence(s2);
948  }
TypedExpectation & InSequence(const Sequence &s)
template<typename F>
TypedExpectation& testing::internal::TypedExpectation< F >::InSequence ( const Sequence s1,
const Sequence s2 
)
inline

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

References testing::InSequence::InSequence().

946  {
947  return InSequence(s1).InSequence(s2);
948  }
TypedExpectation & InSequence(const Sequence &s)
template<typename F>
TypedExpectation& testing::internal::TypedExpectation< F >::InSequence ( const Sequence s1,
const Sequence s2 
)
inline

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

946  {
947  return InSequence(s1).InSequence(s2);
948  }
TypedExpectation & InSequence(const Sequence &s)
template<typename F>
TypedExpectation& testing::internal::TypedExpectation< F >::InSequence ( const Sequence s1,
const Sequence s2,
const Sequence s3 
)
inline

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

950  {
951  return InSequence(s1, s2).InSequence(s3);
952  }
TypedExpectation & InSequence(const Sequence &s)
template<typename F>
TypedExpectation& testing::internal::TypedExpectation< F >::InSequence ( const Sequence s1,
const Sequence s2,
const Sequence s3 
)
inline

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

References testing::InSequence::InSequence().

950  {
951  return InSequence(s1, s2).InSequence(s3);
952  }
TypedExpectation & InSequence(const Sequence &s)
template<typename F>
TypedExpectation& testing::internal::TypedExpectation< F >::InSequence ( const Sequence s1,
const Sequence s2,
const Sequence s3 
)
inline

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

950  {
951  return InSequence(s1, s2).InSequence(s3);
952  }
TypedExpectation & InSequence(const Sequence &s)
template<typename F>
TypedExpectation& testing::internal::TypedExpectation< F >::InSequence ( const Sequence s1,
const Sequence s2,
const Sequence s3,
const Sequence s4 
)
inline

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

954  {
955  return InSequence(s1, s2, s3).InSequence(s4);
956  }
TypedExpectation & InSequence(const Sequence &s)
template<typename F>
TypedExpectation& testing::internal::TypedExpectation< F >::InSequence ( const Sequence s1,
const Sequence s2,
const Sequence s3,
const Sequence s4 
)
inline

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

954  {
955  return InSequence(s1, s2, s3).InSequence(s4);
956  }
TypedExpectation & InSequence(const Sequence &s)
template<typename F>
TypedExpectation& testing::internal::TypedExpectation< F >::InSequence ( const Sequence s1,
const Sequence s2,
const Sequence s3,
const Sequence s4 
)
inline

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

References testing::InSequence::InSequence().

954  {
955  return InSequence(s1, s2, s3).InSequence(s4);
956  }
TypedExpectation & InSequence(const Sequence &s)
template<typename F>
TypedExpectation& testing::internal::TypedExpectation< F >::InSequence ( const Sequence s1,
const Sequence s2,
const Sequence s3,
const Sequence s4,
const Sequence s5 
)
inline

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

959  {
960  return InSequence(s1, s2, s3, s4).InSequence(s5);
961  }
TypedExpectation & InSequence(const Sequence &s)
template<typename F>
TypedExpectation& testing::internal::TypedExpectation< F >::InSequence ( const Sequence s1,
const Sequence s2,
const Sequence s3,
const Sequence s4,
const Sequence s5 
)
inline

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

References testing::InSequence::InSequence().

959  {
960  return InSequence(s1, s2, s3, s4).InSequence(s5);
961  }
TypedExpectation & InSequence(const Sequence &s)
template<typename F>
TypedExpectation& testing::internal::TypedExpectation< F >::InSequence ( const Sequence s1,
const Sequence s2,
const Sequence s3,
const Sequence s4,
const Sequence s5 
)
inline

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

959  {
960  return InSequence(s1, s2, s3, s4).InSequence(s5);
961  }
TypedExpectation & InSequence(const Sequence &s)
template<typename F>
const ArgumentMatcherTuple& testing::internal::TypedExpectation< F >::matchers ( ) const
inline

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

1048  {
1049  return matchers_;
1050  }
template<typename F>
const ArgumentMatcherTuple& testing::internal::TypedExpectation< F >::matchers ( ) const
inline

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

1048  {
1049  return matchers_;
1050  }
template<typename F>
const ArgumentMatcherTuple& testing::internal::TypedExpectation< F >::matchers ( ) const
inline

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

1048  {
1049  return matchers_;
1050  }
template<typename F>
bool testing::internal::TypedExpectation< F >::Matches ( const ArgumentTuple args) const
inlineprivate

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

References testing::internal::TupleMatches().

1086  {
1087  g_gmock_mutex.AssertHeld();
1088  return TupleMatches(matchers_, args) && extra_matcher_.Matches(args);
1089  }
bool TupleMatches(const MatcherTuple &matcher_tuple, const ValueTuple &value_tuple)
Matcher< const ArgumentTuple & > extra_matcher_
template<typename F>
bool testing::internal::TypedExpectation< F >::Matches ( const ArgumentTuple args) const
inlineprivate

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

References testing::internal::TupleMatches().

1086  {
1087  g_gmock_mutex.AssertHeld();
1088  return TupleMatches(matchers_, args) && extra_matcher_.Matches(args);
1089  }
bool TupleMatches(const MatcherTuple &matcher_tuple, const ValueTuple &value_tuple)
Matcher< const ArgumentTuple & > extra_matcher_
template<typename F>
bool testing::internal::TypedExpectation< F >::Matches ( const ArgumentTuple args) const
inlineprivate

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

References testing::internal::TupleMatches().

1086  {
1087  g_gmock_mutex.AssertHeld();
1088  return TupleMatches(matchers_, args) && extra_matcher_.Matches(args);
1089  }
bool TupleMatches(const MatcherTuple &matcher_tuple, const ValueTuple &value_tuple)
Matcher< const ArgumentTuple & > extra_matcher_
template<typename F>
virtual void testing::internal::TypedExpectation< F >::MaybeDescribeExtraMatcherTo ( ::std::ostream *  os)
inlinevirtual

Implements testing::internal::ExpectationBase.

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

1062  {
1064  *os << " Expected args: ";
1066  *os << "\n";
1067  }
1068  }
void DescribeTo(::std::ostream *os) const
Matcher< const ArgumentTuple & > extra_matcher_
template<typename F>
virtual void testing::internal::TypedExpectation< F >::MaybeDescribeExtraMatcherTo ( ::std::ostream *  os)
inlinevirtual

Implements testing::internal::ExpectationBase.

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

1062  {
1064  *os << " Expected args: ";
1066  *os << "\n";
1067  }
1068  }
void DescribeTo(::std::ostream *os) const
Matcher< const ArgumentTuple & > extra_matcher_
template<typename F>
virtual void testing::internal::TypedExpectation< F >::MaybeDescribeExtraMatcherTo ( ::std::ostream *  os)
inlinevirtual

Implements testing::internal::ExpectationBase.

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

1062  {
1064  *os << " Expected args: ";
1066  *os << "\n";
1067  }
1068  }
void DescribeTo(::std::ostream *os) const
Matcher< const ArgumentTuple & > extra_matcher_
template<typename F>
const Action<F>& testing::internal::TypedExpectation< F >::repeated_action ( ) const
inline

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

template<typename F>
const Action<F>& testing::internal::TypedExpectation< F >::repeated_action ( ) const
inline

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

template<typename F>
const Action<F>& testing::internal::TypedExpectation< F >::repeated_action ( ) const
inline

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

template<typename F>
TypedExpectation& testing::internal::TypedExpectation< F >::RetiresOnSaturation ( )
inline

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

1033  {
1035  ".RetiresOnSaturation() cannot appear "
1036  "more than once.");
1038  retires_on_saturation_ = true;
1039 
1040  // Now that no more action clauses can be specified, we check
1041  // whether their count makes sense.
1043  return *this;
1044  }
void ExpectSpecProperty(bool property, const string &failure_message) const
void CheckActionCountIfNotDone() const GTEST_LOCK_EXCLUDED_(mutex_)
template<typename F>
TypedExpectation& testing::internal::TypedExpectation< F >::RetiresOnSaturation ( )
inline

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

1033  {
1035  ".RetiresOnSaturation() cannot appear "
1036  "more than once.");
1038  retires_on_saturation_ = true;
1039 
1040  // Now that no more action clauses can be specified, we check
1041  // whether their count makes sense.
1043  return *this;
1044  }
void ExpectSpecProperty(bool property, const string &failure_message) const
void CheckActionCountIfNotDone() const GTEST_LOCK_EXCLUDED_(mutex_)
template<typename F>
TypedExpectation& testing::internal::TypedExpectation< F >::RetiresOnSaturation ( )
inline

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

1033  {
1035  ".RetiresOnSaturation() cannot appear "
1036  "more than once.");
1038  retires_on_saturation_ = true;
1039 
1040  // Now that no more action clauses can be specified, we check
1041  // whether their count makes sense.
1043  return *this;
1044  }
void ExpectSpecProperty(bool property, const string &failure_message) const
void CheckActionCountIfNotDone() const GTEST_LOCK_EXCLUDED_(mutex_)
template<typename F>
bool testing::internal::TypedExpectation< F >::ShouldHandleArguments ( const ArgumentTuple args) const
inlineprivate

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

References testing::Matches().

1093  {
1094  g_gmock_mutex.AssertHeld();
1095 
1096  // In case the action count wasn't checked when the expectation
1097  // was defined (e.g. if this expectation has no WillRepeatedly()
1098  // or RetiresOnSaturation() clause), we check it when the
1099  // expectation is used for the first time.
1101  return !is_retired() && AllPrerequisitesAreSatisfied() && Matches(args);
1102  }
bool Matches(const ArgumentTuple &args) const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
bool is_retired() const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
void CheckActionCountIfNotDone() const GTEST_LOCK_EXCLUDED_(mutex_)
bool AllPrerequisitesAreSatisfied() const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
template<typename F>
bool testing::internal::TypedExpectation< F >::ShouldHandleArguments ( const ArgumentTuple args) const
inlineprivate

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

References testing::Matches().

1093  {
1094  g_gmock_mutex.AssertHeld();
1095 
1096  // In case the action count wasn't checked when the expectation
1097  // was defined (e.g. if this expectation has no WillRepeatedly()
1098  // or RetiresOnSaturation() clause), we check it when the
1099  // expectation is used for the first time.
1101  return !is_retired() && AllPrerequisitesAreSatisfied() && Matches(args);
1102  }
bool Matches(const ArgumentTuple &args) const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
bool is_retired() const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
void CheckActionCountIfNotDone() const GTEST_LOCK_EXCLUDED_(mutex_)
bool AllPrerequisitesAreSatisfied() const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
template<typename F>
bool testing::internal::TypedExpectation< F >::ShouldHandleArguments ( const ArgumentTuple args) const
inlineprivate

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

References testing::Matches().

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

1093  {
1094  g_gmock_mutex.AssertHeld();
1095 
1096  // In case the action count wasn't checked when the expectation
1097  // was defined (e.g. if this expectation has no WillRepeatedly()
1098  // or RetiresOnSaturation() clause), we check it when the
1099  // expectation is used for the first time.
1101  return !is_retired() && AllPrerequisitesAreSatisfied() && Matches(args);
1102  }
bool Matches(const ArgumentTuple &args) const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
bool is_retired() const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
void CheckActionCountIfNotDone() const GTEST_LOCK_EXCLUDED_(mutex_)
bool AllPrerequisitesAreSatisfied() const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex)
template<typename F>
TypedExpectation& testing::internal::TypedExpectation< F >::Times ( const Cardinality a_cardinality)
inline

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

References testing::internal::ExpectationBase::UntypedTimes().

925  {
926  ExpectationBase::UntypedTimes(a_cardinality);
927  return *this;
928  }
void UntypedTimes(const Cardinality &a_cardinality)
template<typename F>
TypedExpectation& testing::internal::TypedExpectation< F >::Times ( const Cardinality a_cardinality)
inline

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

References testing::internal::ExpectationBase::UntypedTimes().

925  {
926  ExpectationBase::UntypedTimes(a_cardinality);
927  return *this;
928  }
void UntypedTimes(const Cardinality &a_cardinality)
template<typename F>
TypedExpectation& testing::internal::TypedExpectation< F >::Times ( const Cardinality a_cardinality)
inline

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

References testing::internal::ExpectationBase::UntypedTimes().

925  {
926  ExpectationBase::UntypedTimes(a_cardinality);
927  return *this;
928  }
void UntypedTimes(const Cardinality &a_cardinality)
template<typename F>
TypedExpectation& testing::internal::TypedExpectation< F >::Times ( int  n)
inline

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

References testing::Exactly().

931  {
932  return Times(Exactly(n));
933  }
TypedExpectation & Times(const Cardinality &a_cardinality)
GTEST_API_ Cardinality Exactly(int n)
template<typename F>
TypedExpectation& testing::internal::TypedExpectation< F >::Times ( int  n)
inline

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

References testing::Exactly().

931  {
932  return Times(Exactly(n));
933  }
TypedExpectation & Times(const Cardinality &a_cardinality)
GTEST_API_ Cardinality Exactly(int n)
template<typename F>
TypedExpectation& testing::internal::TypedExpectation< F >::Times ( int  n)
inline

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

References testing::Exactly().

931  {
932  return Times(Exactly(n));
933  }
TypedExpectation & Times(const Cardinality &a_cardinality)
GTEST_API_ Cardinality Exactly(int n)
template<typename F>
TypedExpectation& testing::internal::TypedExpectation< F >::WillOnce ( const Action< F > &  action)
inline

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

References testing::Exactly().

994  {
996  ".WillOnce() cannot appear after "
997  ".WillRepeatedly() or .RetiresOnSaturation().");
999 
1000  untyped_actions_.push_back(new Action<F>(action));
1001  if (!cardinality_specified()) {
1002  set_cardinality(Exactly(static_cast<int>(untyped_actions_.size())));
1003  }
1004  return *this;
1005  }
void ExpectSpecProperty(bool property, const string &failure_message) const
GTEST_API_ Cardinality Exactly(int n)
void set_cardinality(const Cardinality &a_cardinality)
action
Definition: upload.py:393
template<typename F>
TypedExpectation& testing::internal::TypedExpectation< F >::WillOnce ( const Action< F > &  action)
inline

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

References testing::Exactly().

994  {
996  ".WillOnce() cannot appear after "
997  ".WillRepeatedly() or .RetiresOnSaturation().");
999 
1000  untyped_actions_.push_back(new Action<F>(action));
1001  if (!cardinality_specified()) {
1002  set_cardinality(Exactly(static_cast<int>(untyped_actions_.size())));
1003  }
1004  return *this;
1005  }
void ExpectSpecProperty(bool property, const string &failure_message) const
GTEST_API_ Cardinality Exactly(int n)
void set_cardinality(const Cardinality &a_cardinality)
action
Definition: upload.py:393
template<typename F>
TypedExpectation& testing::internal::TypedExpectation< F >::WillOnce ( const Action< F > &  action)
inline

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

References testing::Exactly().

994  {
996  ".WillOnce() cannot appear after "
997  ".WillRepeatedly() or .RetiresOnSaturation().");
999 
1000  untyped_actions_.push_back(new Action<F>(action));
1001  if (!cardinality_specified()) {
1002  set_cardinality(Exactly(static_cast<int>(untyped_actions_.size())));
1003  }
1004  return *this;
1005  }
void ExpectSpecProperty(bool property, const string &failure_message) const
GTEST_API_ Cardinality Exactly(int n)
void set_cardinality(const Cardinality &a_cardinality)
action
Definition: upload.py:393
template<typename F>
TypedExpectation& testing::internal::TypedExpectation< F >::WillRepeatedly ( const Action< F > &  action)
inline

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

References upload::action, and testing::AtLeast().

1008  {
1009  if (last_clause_ == kWillRepeatedly) {
1010  ExpectSpecProperty(false,
1011  ".WillRepeatedly() cannot appear "
1012  "more than once in an EXPECT_CALL().");
1013  } else {
1015  ".WillRepeatedly() cannot appear "
1016  "after .RetiresOnSaturation().");
1017  }
1020 
1022  if (!cardinality_specified()) {
1023  set_cardinality(AtLeast(static_cast<int>(untyped_actions_.size())));
1024  }
1025 
1026  // Now that no more action clauses can be specified, we check
1027  // whether their count makes sense.
1029  return *this;
1030  }
void ExpectSpecProperty(bool property, const string &failure_message) const
GTEST_API_ Cardinality AtLeast(int n)
void CheckActionCountIfNotDone() const GTEST_LOCK_EXCLUDED_(mutex_)
void set_cardinality(const Cardinality &a_cardinality)
action
Definition: upload.py:393
template<typename F>
TypedExpectation& testing::internal::TypedExpectation< F >::WillRepeatedly ( const Action< F > &  action)
inline

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

References upload::action, and testing::AtLeast().

1008  {
1009  if (last_clause_ == kWillRepeatedly) {
1010  ExpectSpecProperty(false,
1011  ".WillRepeatedly() cannot appear "
1012  "more than once in an EXPECT_CALL().");
1013  } else {
1015  ".WillRepeatedly() cannot appear "
1016  "after .RetiresOnSaturation().");
1017  }
1020 
1022  if (!cardinality_specified()) {
1023  set_cardinality(AtLeast(static_cast<int>(untyped_actions_.size())));
1024  }
1025 
1026  // Now that no more action clauses can be specified, we check
1027  // whether their count makes sense.
1029  return *this;
1030  }
void ExpectSpecProperty(bool property, const string &failure_message) const
GTEST_API_ Cardinality AtLeast(int n)
void CheckActionCountIfNotDone() const GTEST_LOCK_EXCLUDED_(mutex_)
void set_cardinality(const Cardinality &a_cardinality)
action
Definition: upload.py:393
template<typename F>
TypedExpectation& testing::internal::TypedExpectation< F >::WillRepeatedly ( const Action< F > &  action)
inline

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

References upload::action, and testing::AtLeast().

1008  {
1009  if (last_clause_ == kWillRepeatedly) {
1010  ExpectSpecProperty(false,
1011  ".WillRepeatedly() cannot appear "
1012  "more than once in an EXPECT_CALL().");
1013  } else {
1015  ".WillRepeatedly() cannot appear "
1016  "after .RetiresOnSaturation().");
1017  }
1020 
1022  if (!cardinality_specified()) {
1023  set_cardinality(AtLeast(static_cast<int>(untyped_actions_.size())));
1024  }
1025 
1026  // Now that no more action clauses can be specified, we check
1027  // whether their count makes sense.
1029  return *this;
1030  }
void ExpectSpecProperty(bool property, const string &failure_message) const
GTEST_API_ Cardinality AtLeast(int n)
void CheckActionCountIfNotDone() const GTEST_LOCK_EXCLUDED_(mutex_)
void set_cardinality(const Cardinality &a_cardinality)
action
Definition: upload.py:393
template<typename F>
TypedExpectation& testing::internal::TypedExpectation< F >::With ( const Matcher< const ArgumentTuple & > &  m)
inline

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

References m.

907  {
908  if (last_clause_ == kWith) {
909  ExpectSpecProperty(false,
910  ".With() cannot appear "
911  "more than once in an EXPECT_CALL().");
912  } else {
914  ".With() must be the first "
915  "clause in an EXPECT_CALL().");
916  }
918 
919  extra_matcher_ = m;
921  return *this;
922  }
void ExpectSpecProperty(bool property, const string &failure_message) const
static map< string, int > m
Matcher< const ArgumentTuple & > extra_matcher_
template<typename F>
TypedExpectation& testing::internal::TypedExpectation< F >::With ( const Matcher< const ArgumentTuple & > &  m)
inline

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

References m.

907  {
908  if (last_clause_ == kWith) {
909  ExpectSpecProperty(false,
910  ".With() cannot appear "
911  "more than once in an EXPECT_CALL().");
912  } else {
914  ".With() must be the first "
915  "clause in an EXPECT_CALL().");
916  }
918 
919  extra_matcher_ = m;
921  return *this;
922  }
void ExpectSpecProperty(bool property, const string &failure_message) const
static map< string, int > m
Matcher< const ArgumentTuple & > extra_matcher_
template<typename F>
TypedExpectation& testing::internal::TypedExpectation< F >::With ( const Matcher< const ArgumentTuple & > &  m)
inline

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

References m.

907  {
908  if (last_clause_ == kWith) {
909  ExpectSpecProperty(false,
910  ".With() cannot appear "
911  "more than once in an EXPECT_CALL().");
912  } else {
914  ".With() must be the first "
915  "clause in an EXPECT_CALL().");
916  }
918 
919  extra_matcher_ = m;
921  return *this;
922  }
void ExpectSpecProperty(bool property, const string &failure_message) const
static map< string, int > m
Matcher< const ArgumentTuple & > extra_matcher_

Friends And Related Function Documentation

template<typename F>
template<typename Function >
friend class FunctionMockerBase
friend

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

template<typename F>
template<typename Function >
class FunctionMockerBase ( )
friend

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

template<typename F>
template<typename Function >
class FunctionMockerBase ( )
friend

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

Member Data Documentation

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

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

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

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

template<typename F>
FunctionMockerBase< F > *const testing::internal::TypedExpectation< F >::owner_
private

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

template<typename F>
Action< F > testing::internal::TypedExpectation< F >::repeated_action_
private

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


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