Electroneum
testing::internal::ExpectationBase Class Referenceabstract

#include <gmock-spec-builders.h>

Inheritance diagram for testing::internal::ExpectationBase:
Collaboration diagram for testing::internal::ExpectationBase:

Public Member Functions

 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)
 
virtual void MaybeDescribeExtraMatcherTo (::std::ostream *os)=0
 

Protected Types

enum  Clause {
  kNone, kWith, kTimes, kInSequence,
  kAfter, kWillOnce, kWillRepeatedly, kRetiresOnSaturation
}
 
typedef std::vector< const void * > UntypedActions
 

Protected Member Functions

virtual Expectation GetHandle ()=0
 
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

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_
 

Friends

class ::testing::Expectation
 
class UntypedFunctionMockerBase
 
class ::testing::Sequence
 
class ::testing::internal::ExpectationTester
 
template<typename Function >
class TypedExpectation
 

Detailed Description

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

Member Typedef Documentation

◆ UntypedActions

typedef std::vector<const void*> testing::internal::ExpectationBase::UntypedActions
protected

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

Member Enumeration Documentation

◆ Clause

Constructor & Destructor Documentation

◆ ExpectationBase()

testing::internal::ExpectationBase::ExpectationBase ( const char *  file,
int  line,
const string source_text 
)

◆ ~ExpectationBase()

virtual testing::internal::ExpectationBase::~ExpectationBase ( )
virtual

Member Function Documentation

◆ AllPrerequisitesAreSatisfied()

bool testing::internal::ExpectationBase::AllPrerequisitesAreSatisfied ( ) const
protected

◆ AssertSpecProperty()

void testing::internal::ExpectationBase::AssertSpecProperty ( bool  property,
const string failure_message 
) const
inlineprotected

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

741  {
742  Assert(property, file_, line_, failure_message);
743  }
void Assert(bool condition, const char *file, int line)
Here is the call graph for this function:

◆ call_count()

int testing::internal::ExpectationBase::call_count ( ) const
inlineprotected

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

816  {
817  g_gmock_mutex.AssertHeld();
818  return call_count_;
819  }

◆ cardinality()

const Cardinality& testing::internal::ExpectationBase::cardinality ( ) const
inline

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

◆ cardinality_specified()

bool testing::internal::ExpectationBase::cardinality_specified ( ) const
inlineprotected

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

◆ CheckActionCountIfNotDone()

void testing::internal::ExpectationBase::CheckActionCountIfNotDone ( ) const
protected

◆ DescribeCallCountTo()

void testing::internal::ExpectationBase::DescribeCallCountTo ( ::std::ostream *  os) const

◆ DescribeLocationTo()

void testing::internal::ExpectationBase::DescribeLocationTo ( ::std::ostream *  os) const
inline

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

705  {
706  *os << FormatFileLocation(file(), line()) << " ";
707  }
GTEST_API_ ::std::string FormatFileLocation(const char *file, int line)
Here is the call graph for this function:

◆ ExpectSpecProperty()

void testing::internal::ExpectationBase::ExpectSpecProperty ( bool  property,
const string failure_message 
) const
inlineprotected

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

746  {
747  Expect(property, file_, line_, failure_message);
748  }
void Expect(bool condition, const char *file, int line, const string &msg)
Here is the call graph for this function:

◆ file()

const char* testing::internal::ExpectationBase::file ( void  ) const
inline

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

698 { return file_; }

◆ FindUnsatisfiedPrerequisites()

void testing::internal::ExpectationBase::FindUnsatisfiedPrerequisites ( ExpectationSet result) const
protected

◆ GetHandle()

virtual Expectation testing::internal::ExpectationBase::GetHandle ( )
protectedpure virtual

◆ GTEST_DISALLOW_ASSIGN_()

testing::internal::ExpectationBase::GTEST_DISALLOW_ASSIGN_ ( ExpectationBase  )
protected

◆ IncrementCallCount()

void testing::internal::ExpectationBase::IncrementCallCount ( )
inlineprotected

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

823  {
824  g_gmock_mutex.AssertHeld();
825  call_count_++;
826  }

◆ is_retired()

bool testing::internal::ExpectationBase::is_retired ( ) const
inlineprotected

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

773  {
774  g_gmock_mutex.AssertHeld();
775  return retired_;
776  }

◆ IsOverSaturated()

bool testing::internal::ExpectationBase::IsOverSaturated ( ) const
inlineprotected

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

801  {
802  g_gmock_mutex.AssertHeld();
804  }
const Cardinality & cardinality() const
bool IsOverSaturatedByCallCount(int call_count) const

◆ IsSatisfied()

bool testing::internal::ExpectationBase::IsSatisfied ( ) const
inlineprotected

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

787  {
788  g_gmock_mutex.AssertHeld();
790  }
bool IsSatisfiedByCallCount(int call_count) const
const Cardinality & cardinality() const

◆ IsSaturated()

bool testing::internal::ExpectationBase::IsSaturated ( ) const
inlineprotected

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

794  {
795  g_gmock_mutex.AssertHeld();
797  }
bool IsSaturatedByCallCount(int call_count) const
const Cardinality & cardinality() const

◆ line()

int testing::internal::ExpectationBase::line ( void  ) const
inline

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

◆ MaybeDescribeExtraMatcherTo()

virtual void testing::internal::ExpectationBase::MaybeDescribeExtraMatcherTo ( ::std::ostream *  os)
pure virtual

◆ Retire()

void testing::internal::ExpectationBase::Retire ( )
inlineprotected

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

780  {
781  g_gmock_mutex.AssertHeld();
782  retired_ = true;
783  }

◆ RetireAllPreRequisites()

void testing::internal::ExpectationBase::RetireAllPreRequisites ( )
protected

◆ set_cardinality()

void testing::internal::ExpectationBase::set_cardinality ( const Cardinality a_cardinality)
inlineprotected

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

759  {
760  cardinality_ = a_cardinality;
761  }

◆ source_text()

const char* testing::internal::ExpectationBase::source_text ( ) const
inline

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

700 { return source_text_.c_str(); }

◆ SpecifyCardinality()

void testing::internal::ExpectationBase::SpecifyCardinality ( const Cardinality cardinality)
protected

◆ UntypedTimes()

void testing::internal::ExpectationBase::UntypedTimes ( const Cardinality a_cardinality)
protected
Here is the caller graph for this function:

Friends And Related Function Documentation

◆ ::testing::Expectation

friend class ::testing::Expectation
friend

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

◆ ::testing::internal::ExpectationTester

friend class ::testing::internal::ExpectationTester
friend

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

◆ ::testing::Sequence

friend class ::testing::Sequence
friend

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

◆ TypedExpectation

template<typename Function >
friend class TypedExpectation
friend

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

◆ UntypedFunctionMockerBase

friend class UntypedFunctionMockerBase
friend

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

Member Data Documentation

◆ action_count_checked_

bool testing::internal::ExpectationBase::action_count_checked_
mutableprotected

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

◆ call_count_

int testing::internal::ExpectationBase::call_count_
protected

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

◆ cardinality_

Cardinality testing::internal::ExpectationBase::cardinality_
protected

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

◆ cardinality_specified_

bool testing::internal::ExpectationBase::cardinality_specified_
protected

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

◆ extra_matcher_specified_

bool testing::internal::ExpectationBase::extra_matcher_specified_
protected

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

◆ file_

const char* testing::internal::ExpectationBase::file_
protected

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

◆ immediate_prerequisites_

ExpectationSet testing::internal::ExpectationBase::immediate_prerequisites_
protected

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

◆ last_clause_

Clause testing::internal::ExpectationBase::last_clause_
protected

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

◆ line_

int testing::internal::ExpectationBase::line_
protected

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

◆ mutex_

Mutex testing::internal::ExpectationBase::mutex_
mutableprotected

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

◆ repeated_action_specified_

bool testing::internal::ExpectationBase::repeated_action_specified_
protected

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

◆ retired_

bool testing::internal::ExpectationBase::retired_
protected

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

◆ retires_on_saturation_

bool testing::internal::ExpectationBase::retires_on_saturation_
protected

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

◆ source_text_

const string testing::internal::ExpectationBase::source_text_
protected

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

◆ untyped_actions_

UntypedActions testing::internal::ExpectationBase::untyped_actions_
protected

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


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