restore mistakenly removed iffs in their explicit form
Due to confusion arisen from "iff" standing for "if and only if", this commit uses the latter.
This commit is contained in:
@@ -332,7 +332,7 @@ class OnCallSpec : public UntypedOnCallSpecBase {
|
||||
return *this;
|
||||
}
|
||||
|
||||
// Returns true if the given arguments match the matchers.
|
||||
// Returns true if and only if the given arguments match the matchers.
|
||||
bool Matches(const ArgumentTuple& args) const {
|
||||
return TupleMatches(matchers_, args) && extra_matcher_.Matches(args);
|
||||
}
|
||||
@@ -390,7 +390,7 @@ class GTEST_API_ Mock {
|
||||
GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);
|
||||
|
||||
// Verifies all expectations on the given mock object and clears its
|
||||
// default actions and expectations. Returns true if the
|
||||
// default actions and expectations. Returns true if and only if the
|
||||
// verification was successful.
|
||||
static bool VerifyAndClear(void* mock_obj)
|
||||
GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);
|
||||
@@ -516,7 +516,8 @@ class GTEST_API_ Expectation {
|
||||
// The compiler-generated copy ctor and operator= work exactly as
|
||||
// intended, so we don't need to define our own.
|
||||
|
||||
// Returns true if rhs references the same expectation as this object does.
|
||||
// Returns true if and only if rhs references the same expectation as this
|
||||
// object does.
|
||||
bool operator==(const Expectation& rhs) const {
|
||||
return expectation_base_ == rhs.expectation_base_;
|
||||
}
|
||||
@@ -598,8 +599,8 @@ class ExpectationSet {
|
||||
// The compiler-generator ctor and operator= works exactly as
|
||||
// intended, so we don't need to define our own.
|
||||
|
||||
// Returns true if rhs contains the same set of Expectation objects
|
||||
// as this does.
|
||||
// Returns true if and only if rhs contains the same set of Expectation
|
||||
// objects as this does.
|
||||
bool operator==(const ExpectationSet& rhs) const {
|
||||
return expectations_ == rhs.expectations_;
|
||||
}
|
||||
@@ -760,8 +761,8 @@ class GTEST_API_ ExpectationBase {
|
||||
// by the subclasses to implement the .Times() clause.
|
||||
void SpecifyCardinality(const Cardinality& cardinality);
|
||||
|
||||
// Returns true if the user specified the cardinality explicitly
|
||||
// using a .Times().
|
||||
// Returns true if and only if the user specified the cardinality
|
||||
// explicitly using a .Times().
|
||||
bool cardinality_specified() const { return cardinality_specified_; }
|
||||
|
||||
// Sets the cardinality of this expectation spec.
|
||||
@@ -777,7 +778,7 @@ class GTEST_API_ ExpectationBase {
|
||||
void RetireAllPreRequisites()
|
||||
GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex);
|
||||
|
||||
// Returns true if this expectation is retired.
|
||||
// Returns true if and only if this expectation is retired.
|
||||
bool is_retired() const
|
||||
GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
|
||||
g_gmock_mutex.AssertHeld();
|
||||
@@ -791,28 +792,29 @@ class GTEST_API_ ExpectationBase {
|
||||
retired_ = true;
|
||||
}
|
||||
|
||||
// Returns true if this expectation is satisfied.
|
||||
// Returns true if and only if this expectation is satisfied.
|
||||
bool IsSatisfied() const
|
||||
GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
|
||||
g_gmock_mutex.AssertHeld();
|
||||
return cardinality().IsSatisfiedByCallCount(call_count_);
|
||||
}
|
||||
|
||||
// Returns true if this expectation is saturated.
|
||||
// Returns true if and only if this expectation is saturated.
|
||||
bool IsSaturated() const
|
||||
GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
|
||||
g_gmock_mutex.AssertHeld();
|
||||
return cardinality().IsSaturatedByCallCount(call_count_);
|
||||
}
|
||||
|
||||
// Returns true if this expectation is over-saturated.
|
||||
// Returns true if and only if this expectation is over-saturated.
|
||||
bool IsOverSaturated() const
|
||||
GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
|
||||
g_gmock_mutex.AssertHeld();
|
||||
return cardinality().IsOverSaturatedByCallCount(call_count_);
|
||||
}
|
||||
|
||||
// Returns true if all pre-requisites of this expectation are satisfied.
|
||||
// Returns true if and only if all pre-requisites of this expectation are
|
||||
// satisfied.
|
||||
bool AllPrerequisitesAreSatisfied() const
|
||||
GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex);
|
||||
|
||||
@@ -855,7 +857,7 @@ class GTEST_API_ ExpectationBase {
|
||||
const char* file_; // The file that contains the expectation.
|
||||
int line_; // The line number of the expectation.
|
||||
const std::string source_text_; // The EXPECT_CALL(...) source text.
|
||||
// True if the cardinality is specified explicitly.
|
||||
// True if and only if the cardinality is specified explicitly.
|
||||
bool cardinality_specified_;
|
||||
Cardinality cardinality_; // The cardinality of the expectation.
|
||||
// The immediate pre-requisites (i.e. expectations that must be
|
||||
@@ -869,7 +871,7 @@ class GTEST_API_ ExpectationBase {
|
||||
// This group of fields are the current state of the expectation,
|
||||
// and can change as the mock function is called.
|
||||
int call_count_; // How many times this expectation has been invoked.
|
||||
bool retired_; // True if this expectation has retired.
|
||||
bool retired_; // True if and only if this expectation has retired.
|
||||
UntypedActions untyped_actions_;
|
||||
bool extra_matcher_specified_;
|
||||
bool repeated_action_specified_; // True if a WillRepeatedly() was specified.
|
||||
@@ -1087,14 +1089,15 @@ class TypedExpectation : public ExpectationBase {
|
||||
// statement finishes and when the current thread holds
|
||||
// g_gmock_mutex.
|
||||
|
||||
// Returns true if this expectation matches the given arguments.
|
||||
// Returns true if and only if this expectation matches the given arguments.
|
||||
bool Matches(const ArgumentTuple& args) const
|
||||
GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
|
||||
g_gmock_mutex.AssertHeld();
|
||||
return TupleMatches(matchers_, args) && extra_matcher_.Matches(args);
|
||||
}
|
||||
|
||||
// Returns true if this expectation should handle the given arguments.
|
||||
// Returns true if and only if this expectation should handle the given
|
||||
// arguments.
|
||||
bool ShouldHandleArguments(const ArgumentTuple& args) const
|
||||
GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
|
||||
g_gmock_mutex.AssertHeld();
|
||||
|
||||
Reference in New Issue
Block a user