Home | History | Annotate | Download | only in gmock

Lines Matching refs:Expectation

45 // A user can use the EXPECT_CALL() macro to specify an expectation on
78 // An abstract handle of an expectation.
79 class Expectation;
81 // A set of expectation handles.
94 // Implements an expectation.
97 // Helper class for testing the Expectation class template.
112 // expectation gets picked. Therefore, we sequence all mock function
164 // Returns the expectation that matches the given function arguments
219 // Returns an Expectation object that references and co-owns exp,
220 // which must be an expectation on this mock function.
221 Expectation GetHandleOf(ExpectationBase* exp);
453 // An abstract handle of an expectation. Useful in the .After()
457 // Expectation e1 = EXPECT_CALL(...)...;
465 // - Constness is shallow: a const Expectation object itself cannot
474 class Expectation {
476 // Constructs a null object that doesn't reference any expectation.
477 Expectation();
479 ~Expectation();
482 // Expectation e = EXPECT_CALL(...);
486 // Expectation objects, and needs to call the non-const Retire()
488 // Expectation must receive a *non-const* reference to the
490 Expectation(internal::ExpectationBase& exp); // NOLINT
495 // Returns true iff rhs references the same expectation as this object does.
496 bool operator==(const Expectation& rhs) const {
500 bool operator!=(const Expectation& rhs) const { return !(*this == rhs); }
514 // This comparator is needed for putting Expectation objects into a set.
517 bool operator()(const Expectation& lhs, const Expectation& rhs) const {
522 typedef ::std::set<Expectation, Less> Set;
524 Expectation(
527 // Returns the expectation this object references.
533 // A linked_ptr that co-owns the expectation this handle references.
537 // A set of expectation handles. Useful in the .After() clause of
553 typedef Expectation::Set::const_iterator const_iterator;
555 // An object stored in the set. This is an alias of Expectation.
556 typedef Expectation::Set::value_type value_type;
565 *this += Expectation(exp);
569 // Expectation and thus must not be explicit. This allows either an
570 // Expectation or an ExpectationSet to be used in .After().
571 ExpectationSet(const Expectation& e) { // NOLINT
578 // Returns true iff rhs contains the same set of Expectation objects
588 ExpectationSet& operator+=(const Expectation& e) {
599 Expectation::Set expectations_;
609 Sequence() : last_expectation_(new Expectation) {}
611 // Adds an expectation to this sequence. The caller must ensure
613 void AddExpectation(const Expectation& expectation) const;
616 // The last expectation in this sequence. We use a linked_ptr here
619 // the same Expectation object.
620 internal::linked_ptr<Expectation> last_expectation_;
666 // Expectation:
669 // types (e.g. all pre-requisites of a particular expectation, all
670 // expectations in a sequence). Therefore these expectation objects
674 // on the template argument of Expectation to the base class.
679 // source_text is the EXPECT_CALL(...) source that created this Expectation.
684 // Where in the source file was the expectation spec defined?
688 // Returns the cardinality specified in the expectation spec.
691 // Describes the source file location of this expectation.
697 // expectation has occurred.
706 friend class ::testing::Expectation;
723 // Returns an Expectation object that references and co-owns this
724 // expectation.
725 virtual Expectation GetHandle() = 0;
737 // Explicitly specifies the cardinality of this expectation. Used
745 // Sets the cardinality of this expectation spec.
754 // Retires all pre-requisites of this expectation.
758 // Returns true iff this expectation is retired.
765 // Retires this expectation.
772 // Returns true iff this expectation is satisfied.
779 // Returns true iff this expectation is saturated.
786 // Returns true iff this expectation is over-saturated.
793 // Returns true iff all pre-requisites of this expectation are satisfied.
797 // Adds unsatisfied pre-requisites of this expectation to 'result'.
801 // Returns the number this expectation has been invoked.
808 // Increments the number this expectation has been invoked.
833 const char* file_; // The file that contains the expectation.
834 int line_; // The line number of the expectation.
838 Cardinality cardinality_; // The cardinality of the expectation.
840 // satisfied before this expectation can be matched) of this
841 // expectation. We use linked_ptr in the set because we want an
842 // Expectation object to be co-owned by its FunctionMocker and its
847 // This group of fields are the current state of the expectation,
849 int call_count_; // How many times this expectation has been invoked.
850 bool retired_; // True iff this expectation has retired.
862 // Impements an expectation for the given function type.
885 // yet (for example, if the expectation was never used).
1061 // Returns an Expectation object that references and co-owns this
1062 // expectation.
1063 virtual Expectation GetHandle() {
1071 // Returns true iff this expectation matches the given arguments.
1078 // Returns true iff this expectation should handle the given arguments.
1083 // In case the action count wasn't checked when the expectation
1084 // was defined (e.g. if this expectation has no WillRepeatedly()
1086 // expectation is used for the first time.
1092 // expectation to the given ostream.
1099 *os << " Expected: the expectation is active\n"
1131 // expectation.
1132 *os << "The call matches the expectation.\n";
1167 // over-saturate this expectation, returns the default action;
1168 // otherwise, returns the next action in this expectation. Also
1215 // specifying the default behavior of, or expectation on, a mock
1250 // Adds a new expectation spec to the function mocker and returns
1504 // Adds and returns an expectation spec for this mock function.
1512 TypedExpectation<F>* const expectation =
1514 const linked_ptr<ExpectationBase> untyped_expectation(expectation);
1517 // Adds this expectation into the implicit sequence if there is one.
1520 implicit_sequence->AddExpectation(Expectation(untyped_expectation));
1523 return *expectation;
1526 // The current spec (either default action spec or expectation spec)
1566 // Returns the expectation that matches the given function arguments
1573 // Critical section: We must find the matching expectation and the
1615 // Returns the expectation that matches the arguments, or NULL if no
1616 // expectation matches them.
1633 // Returns a message that the arguments don't match any expectation.
1652 << (count == 1 ? "expectation, but it didn't match" :
1656 TypedExpectation<F>* const expectation =
1659 expectation->DescribeLocationTo(why);
1661 *why << "tried expectation #" << i << ": ";
1663 *why << expectation->source_text() << "...\n";
1664 expectation->ExplainMatchResultTo(args, why);
1665 expectation->DescribeCallCountTo(why);
1669 // The current spec (either default action spec or expectation spec)
1730 // Constructs an Expectation object that references and co-owns exp.
1731 inline Expectation::Expectation(internal::ExpectationBase& exp) // NOLINT