class ExpectationBase
Defined at line 685 of file ../../third_party/googletest/src/googlemock/include/gmock/gmock-spec-builders.h
Base class for expectations.
Protected Members
const char * file_
int line_
basic_string source_text_
basic_string description_
bool cardinality_specified_
Cardinality cardinality_
ExpectationSet immediate_prerequisites_
int call_count_
bool retired_
vector untyped_actions_
bool extra_matcher_specified_
bool repeated_action_specified_
bool retires_on_saturation_
Clause last_clause_
bool action_count_checked_
Mutex mutex_
Public Methods
void ~ExpectationBase ()
void DescribeCallCountTo (::std::ostream * os)
Describes how many times a function call matching this
expectation has occurred.
void DescribeLocationTo (::std::ostream * os)
Describes the source file location of this expectation.
Defined at line 700 of file ../../third_party/googletest/src/googlemock/include/gmock/gmock-spec-builders.h
void MaybeDescribeExtraMatcherTo (::std::ostream * os)
If this mock method has an extra matcher (i.e. .With(matcher)),
describes it to the ostream.
void UntypedDescription (std::string description)
Do not rely on this for correctness.
This is only for making human-readable test output easier to understand.
Defined at line 715 of file ../../third_party/googletest/src/googlemock/include/gmock/gmock-spec-builders.h
void ExpectationBase (const char * file, int line, const std::string & source_text)
source_text is the EXPECT_CALL(...) source that created this Expectation.
const char * file ()
Where in the source file was the expectation spec defined?
Defined at line 693 of file ../../third_party/googletest/src/googlemock/include/gmock/gmock-spec-builders.h
int line ()
Defined at line 694 of file ../../third_party/googletest/src/googlemock/include/gmock/gmock-spec-builders.h
const char * source_text ()
Defined at line 695 of file ../../third_party/googletest/src/googlemock/include/gmock/gmock-spec-builders.h
const Cardinality & cardinality ()
Returns the cardinality specified in the expectation spec.
Defined at line 697 of file ../../third_party/googletest/src/googlemock/include/gmock/gmock-spec-builders.h
Protected Methods
bool IsSatisfied ()
Returns true if and only if this expectation is satisfied.
Defined at line 790 of file ../../third_party/googletest/src/googlemock/include/gmock/gmock-spec-builders.h
bool AllPrerequisitesAreSatisfied ()
Returns true if and only if all pre-requisites of this expectation are
satisfied.
void FindUnsatisfiedPrerequisites (ExpectationSet * result)
Adds unsatisfied pre-requisites of this expectation to 'result'.
void CheckActionCountIfNotDone ()
Checks the action count (i.e. the number of WillOnce() and
WillRepeatedly() clauses) against the cardinality if this hasn't
been done before. Prints a warning if there are too many or too
few actions.
void IncrementCallCount ()
Increments the number this expectation has been invoked.
Defined at line 823 of file ../../third_party/googletest/src/googlemock/include/gmock/gmock-spec-builders.h
Expectation GetHandle ()
Returns an Expectation object that references and co-owns this
expectation.
void AssertSpecProperty (bool property, const std::string & failure_message)
Asserts that the EXPECT_CALL() statement has the given property.
Defined at line 742 of file ../../third_party/googletest/src/googlemock/include/gmock/gmock-spec-builders.h
void ExpectSpecProperty (bool property, const std::string & failure_message)
Expects that the EXPECT_CALL() statement has the given property.
Defined at line 748 of file ../../third_party/googletest/src/googlemock/include/gmock/gmock-spec-builders.h
void Retire ()
Retires this expectation.
Defined at line 780 of file ../../third_party/googletest/src/googlemock/include/gmock/gmock-spec-builders.h
const std::string & GetDescription ()
Returns a human-readable description of this expectation.
Do not rely on this for correctness. It is only for human readability.
Defined at line 787 of file ../../third_party/googletest/src/googlemock/include/gmock/gmock-spec-builders.h
bool IsSaturated ()
Returns true if and only if this expectation is saturated.
Defined at line 796 of file ../../third_party/googletest/src/googlemock/include/gmock/gmock-spec-builders.h
bool IsOverSaturated ()
Returns true if and only if this expectation is over-saturated.
Defined at line 802 of file ../../third_party/googletest/src/googlemock/include/gmock/gmock-spec-builders.h
void SpecifyCardinality (const Cardinality & cardinality)
Explicitly specifies the cardinality of this expectation. Used
by the subclasses to implement the .Times() clause.
void RetireAllPreRequisites ()
Retires all pre-requisites of this expectation.
void UntypedTimes (const Cardinality & a_cardinality)
Implements the .Times() clause.
bool cardinality_specified ()
Returns true if and only if the user specified the cardinality
explicitly using a .Times().
Defined at line 759 of file ../../third_party/googletest/src/googlemock/include/gmock/gmock-spec-builders.h
void set_cardinality (const Cardinality & a_cardinality)
Sets the cardinality of this expectation spec.
Defined at line 762 of file ../../third_party/googletest/src/googlemock/include/gmock/gmock-spec-builders.h
bool is_retired ()
Returns true if and only if this expectation is retired.
Defined at line 774 of file ../../third_party/googletest/src/googlemock/include/gmock/gmock-spec-builders.h
int call_count ()
Returns the number this expectation has been invoked.
Defined at line 817 of file ../../third_party/googletest/src/googlemock/include/gmock/gmock-spec-builders.h
Enumerations
enum Clause
| Name | Value |
|---|---|
| kNone | 0 |
| kWith | 1 |
| kTimes | 2 |
| kInSequence | 3 |
| kAfter | 4 |
| kWillOnce | 5 |
| kWillRepeatedly | 6 |
| kRetiresOnSaturation | 7 |
Defined at line 723 of file ../../third_party/googletest/src/googlemock/include/gmock/gmock-spec-builders.h
Friends
template <typename Function>
class TypedExpectation
class ExpectationTester
class Sequence
class UntypedFunctionMockerBase
class Expectation