Home | History | Annotate | Download | only in gmock

Lines Matching refs:Expectation

754   Expect(condition, file, line, "Expectation failed.");
4592 // A user can use the EXPECT_CALL() macro to specify an expectation on
7084 // doesn't match its expectation.
7091 // Every element matches its expectation. We need to explain why
7682 // An abstract handle of an expectation.
7683 class Expectation;
7685 // A set of expectation handles.
7698 // Implements an expectation.
7701 // Helper class for testing the Expectation class template.
7716 // expectation gets picked. Therefore, we sequence all mock function
7768 // Returns the expectation that matches the given function arguments
7823 // Returns an Expectation object that references and co-owns exp,
7824 // which must be an expectation on this mock function.
7825 Expectation GetHandleOf(ExpectationBase* exp);
8057 // An abstract handle of an expectation. Useful in the .After()
8061 // Expectation e1 = EXPECT_CALL(...)...;
8069 // - Constness is shallow: a const Expectation object itself cannot
8078 class Expectation {
8080 // Constructs a null object that doesn't reference any expectation.
8081 Expectation();
8083 ~Expectation();
8086 // Expectation e = EXPECT_CALL(...);
8090 // Expectation objects, and needs to call the non-const Retire()
8092 // Expectation must receive a *non-const* reference to the
8094 Expectation(internal::ExpectationBase& exp); // NOLINT
8099 // Returns true iff rhs references the same expectation as this object does.
8100 bool operator==(const Expectation& rhs) const {
8104 bool operator!=(const Expectation& rhs) const { return !(*this == rhs); }
8118 // This comparator is needed for putting Expectation objects into a set.
8121 bool operator()(const Expectation& lhs, const Expectation& rhs) const {
8126 typedef ::std::set<Expectation, Less> Set;
8128 Expectation(
8131 // Returns the expectation this object references.
8137 // A linked_ptr that co-owns the expectation this handle references.
8141 // A set of expectation handles. Useful in the .After() clause of
8157 typedef Expectation::Set::const_iterator const_iterator;
8159 // An object stored in the set. This is an alias of Expectation.
8160 typedef Expectation::Set::value_type value_type;
8169 *this += Expectation(exp);
8173 // Expectation and thus must not be explicit. This allows either an
8174 // Expectation or an ExpectationSet to be used in .After().
8175 ExpectationSet(const Expectation& e) { // NOLINT
8182 // Returns true iff rhs contains the same set of Expectation objects
8192 ExpectationSet& operator+=(const Expectation& e) {
8203 Expectation::Set expectations_;
8213 Sequence() : last_expectation_(new Expectation) {}
8215 // Adds an expectation to this sequence. The caller must ensure
8217 void AddExpectation(const Expectation& expectation) const;
8220 // The last expectation in this sequence. We use a linked_ptr here
8223 // the same Expectation object.
8224 internal::linked_ptr<Expectation> last_expectation_;
8270 // Expectation:
8273 // types (e.g. all pre-requisites of a particular expectation, all
8274 // expectations in a sequence). Therefore these expectation objects
8278 // on the template argument of Expectation to the base class.
8283 // source_text is the EXPECT_CALL(...) source that created this Expectation.
8288 // Where in the source file was the expectation spec defined?
8292 // Returns the cardinality specified in the expectation spec.
8295 // Describes the source file location of this expectation.
8301 // expectation has occurred.
8310 friend class ::testing::Expectation;
8327 // Returns an Expectation object that references and co-owns this
8328 // expectation.
8329 virtual Expectation GetHandle() = 0;
8341 // Explicitly specifies the cardinality of this expectation. Used
8349 // Sets the cardinality of this expectation spec.
8358 // Retires all pre-requisites of this expectation.
8362 // Returns true iff this expectation is retired.
8369 // Retires this expectation.
8376 // Returns true iff this expectation is satisfied.
8383 // Returns true iff this expectation is saturated.
8390 // Returns true iff this expectation is over-saturated.
8397 // Returns true iff all pre-requisites of this expectation are satisfied.
8401 // Adds unsatisfied pre-requisites of this expectation to 'result'.
8405 // Returns the number this expectation has been invoked.
8412 // Increments the number this expectation has been invoked.
8437 const char* file_; // The file that contains the expectation.
8438 int line_; // The line number of the expectation.
8442 Cardinality cardinality_; // The cardinality of the expectation.
8444 // satisfied before this expectation can be matched) of this
8445 // expectation. We use linked_ptr in the set because we want an
8446 // Expectation object to be co-owned by its FunctionMocker and its
8451 // This group of fields are the current state of the expectation,
8453 int call_count_; // How many times this expectation has been invoked.
8454 bool retired_; // True iff this expectation has retired.
8466 // Impements an expectation for the given function type.
8489 // yet (for example, if the expectation was never used).
8665 // Returns an Expectation object that references and co-owns this
8666 // expectation.
8667 virtual Expectation GetHandle() {
8675 // Returns true iff this expectation matches the given arguments.
8682 // Returns true iff this expectation should handle the given arguments.
8687 // In case the action count wasn't checked when the expectation
8688 // was defined (e.g. if this expectation has no WillRepeatedly()
8690 // expectation is used for the first time.
8696 // expectation to the given ostream.
8703 *os << " Expected: the expectation is active\n"
8735 // expectation.
8736 *os << "The call matches the expectation.\n";
8771 // over-saturate this expectation, returns the default action;
8772 // otherwise, returns the next action in this expectation. Also
8819 // specifying the default behavior of, or expectation on, a mock
8854 // Adds a new expectation spec to the function mocker and returns
9108 // Adds and returns an expectation spec for this mock function.
9116 TypedExpectation<F>* const expectation =
9118 const linked_ptr<ExpectationBase> untyped_expectation(expectation);
9121 // Adds this expectation into the implicit sequence if there is one.
9124 implicit_sequence->AddExpectation(Expectation(untyped_expectation));
9127 return *expectation;
9130 // The current spec (either default action spec or expectation spec)
9170 // Returns the expectation that matches the given function arguments
9177 // Critical section: We must find the matching expectation and the
9219 // Returns the expectation that matches the arguments, or NULL if no
9220 // expectation matches them.
9237 // Returns a message that the arguments don't match any expectation.
9256 << (count == 1 ? "expectation, but it didn't match" :
9260 TypedExpectation<F>* const expectation =
9263 expectation->DescribeLocationTo(why);
9265 *why << "tried expectation #" << i << ": ";
9267 *why << expectation->source_text() << "...\n";
9268 expectation->ExplainMatchResultTo(args, why);
9269 expectation->DescribeCallCountTo(why);
9273 // The current spec (either default action spec or expectation spec)
9334 // Constructs an Expectation object that references and co-owns exp.
9335 inline Expectation::Expectation(internal::ExpectationBase& exp) // NOLINT
10100 // The expectation spec says that the first Bar("a") must happen