From bf6df7eaee5cfaafe2655fab143f348eba98c9af Mon Sep 17 00:00:00 2001 From: Krystian Kuzniarek Date: Fri, 26 Jul 2019 11:48:08 +0200 Subject: fix typos --- googlemock/include/gmock/gmock-actions.h | 10 ++++---- googlemock/include/gmock/gmock-cardinalities.h | 10 ++++---- googlemock/include/gmock/gmock-matchers.h | 24 +++++++++---------- googlemock/include/gmock/gmock-spec-builders.h | 28 +++++++++++----------- .../include/gmock/internal/gmock-internal-utils.h | 18 +++++++------- 5 files changed, 45 insertions(+), 45 deletions(-) (limited to 'googlemock/include') diff --git a/googlemock/include/gmock/gmock-actions.h b/googlemock/include/gmock/gmock-actions.h index 6895dfd5..e921cf4a 100644 --- a/googlemock/include/gmock/gmock-actions.h +++ b/googlemock/include/gmock/gmock-actions.h @@ -99,7 +99,7 @@ struct BuiltInDefaultValueGetter { template class BuiltInDefaultValue { public: - // This function returns true iff type T has a built-in default value. + // This function returns true if type T has a built-in default value. static bool Exists() { return ::std::is_default_constructible::value; } @@ -208,7 +208,7 @@ class DefaultValue { producer_ = nullptr; } - // Returns true iff the user has set the default value for type T. + // Returns true if the user has set the default value for type T. static bool IsSet() { return producer_ != nullptr; } // Returns true if T has a default return value set by the user or there @@ -269,7 +269,7 @@ class DefaultValue { // Unsets the default value for type T&. static void Clear() { address_ = nullptr; } - // Returns true iff the user has set the default value for type T&. + // Returns true if the user has set the default value for type T&. static bool IsSet() { return address_ != nullptr; } // Returns true if T has a default return value set by the user or there @@ -375,7 +375,7 @@ class Action { template explicit Action(const Action& action) : fun_(action.fun_) {} - // Returns true iff this is the DoDefault() action. + // Returns true if this is the DoDefault() action. bool IsDoDefault() const { return fun_ == nullptr; } // Performs the action. Note that this method is const even though @@ -395,7 +395,7 @@ class Action { template friend class Action; - // fun_ is an empty function iff this is the DoDefault() action. + // fun_ is an empty function if this is the DoDefault() action. ::std::function fun_; }; diff --git a/googlemock/include/gmock/gmock-cardinalities.h b/googlemock/include/gmock/gmock-cardinalities.h index 8fa25ebb..4b269a3e 100644 --- a/googlemock/include/gmock/gmock-cardinalities.h +++ b/googlemock/include/gmock/gmock-cardinalities.h @@ -70,10 +70,10 @@ class CardinalityInterface { virtual int ConservativeLowerBound() const { return 0; } virtual int ConservativeUpperBound() const { return INT_MAX; } - // Returns true iff call_count calls will satisfy this cardinality. + // Returns true if call_count calls will satisfy this cardinality. virtual bool IsSatisfiedByCallCount(int call_count) const = 0; - // Returns true iff call_count calls will saturate this cardinality. + // Returns true if call_count calls will saturate this cardinality. virtual bool IsSaturatedByCallCount(int call_count) const = 0; // Describes self to an ostream. @@ -98,17 +98,17 @@ class GTEST_API_ Cardinality { int ConservativeLowerBound() const { return impl_->ConservativeLowerBound(); } int ConservativeUpperBound() const { return impl_->ConservativeUpperBound(); } - // Returns true iff call_count calls will satisfy this cardinality. + // Returns true if call_count calls will satisfy this cardinality. bool IsSatisfiedByCallCount(int call_count) const { return impl_->IsSatisfiedByCallCount(call_count); } - // Returns true iff call_count calls will saturate this cardinality. + // Returns true if call_count calls will saturate this cardinality. bool IsSaturatedByCallCount(int call_count) const { return impl_->IsSaturatedByCallCount(call_count); } - // Returns true iff call_count calls will over-saturate this + // Returns true if call_count calls will over-saturate this // cardinality, i.e. exceed the maximum number of allowed calls. bool IsOverSaturatedByCallCount(int call_count) const { return impl_->IsSaturatedByCallCount(call_count) && diff --git a/googlemock/include/gmock/gmock-matchers.h b/googlemock/include/gmock/gmock-matchers.h index fcf8cf26..70750827 100644 --- a/googlemock/include/gmock/gmock-matchers.h +++ b/googlemock/include/gmock/gmock-matchers.h @@ -361,7 +361,7 @@ template class TuplePrefix { public: // TuplePrefix::Matches(matcher_tuple, value_tuple) returns true - // iff the first N fields of matcher_tuple matches the first N + // if the first N fields of matcher_tuple matches the first N // fields of value_tuple, respectively. template static bool Matches(const MatcherTuple& matcher_tuple, @@ -420,7 +420,7 @@ class TuplePrefix<0> { ::std::ostream* /* os */) {} }; -// TupleMatches(matcher_tuple, value_tuple) returns true iff all +// TupleMatches(matcher_tuple, value_tuple) returns true if all // matchers in matcher_tuple match the corresponding fields in // value_tuple. It is a compiler error if matcher_tuple and // value_tuple have different number of fields or incompatible field @@ -2534,7 +2534,7 @@ class KeyMatcherImpl : public MatcherInterface { testing::SafeMatcherCast(inner_matcher)) { } - // Returns true iff 'key_value.first' (the key) matches the inner matcher. + // Returns true if 'key_value.first' (the key) matches the inner matcher. bool MatchAndExplain(PairType key_value, MatchResultListener* listener) const override { StringMatchResultListener inner_listener; @@ -2616,7 +2616,7 @@ class PairMatcherImpl : public MatcherInterface { second_matcher_.DescribeNegationTo(os); } - // Returns true iff 'a_pair.first' matches first_matcher and 'a_pair.second' + // Returns true if 'a_pair.first' matches first_matcher and 'a_pair.second' // matches second_matcher. bool MatchAndExplain(PairType a_pair, MatchResultListener* listener) const override { @@ -3152,7 +3152,7 @@ class ElementsAreArrayMatcher { // Given a 2-tuple matcher tm of type Tuple2Matcher and a value second // of type Second, BoundSecondMatcher(tm, -// second) is a polymorphic matcher that matches a value x iff tm +// second) is a polymorphic matcher that matches a value x if tm // matches tuple (x, second). Useful for implementing // UnorderedPointwise() in terms of UnorderedElementsAreArray(). // @@ -3217,7 +3217,7 @@ class BoundSecondMatcher { // Given a 2-tuple matcher tm and a value second, // MatcherBindSecond(tm, second) returns a matcher that matches a -// value x iff tm matches tuple (x, second). Useful for implementing +// value x if tm matches tuple (x, second). Useful for implementing // UnorderedPointwise() in terms of UnorderedElementsAreArray(). template BoundSecondMatcher MatcherBindSecond( @@ -3710,7 +3710,7 @@ WhenDynamicCastTo(const Matcher& inner_matcher) { // Creates a matcher that matches an object whose given field matches // 'matcher'. For example, // Field(&Foo::number, Ge(5)) -// matches a Foo object x iff x.number >= 5. +// matches a Foo object x if x.number >= 5. template inline PolymorphicMatcher< internal::FieldMatcher > Field( @@ -3737,7 +3737,7 @@ inline PolymorphicMatcher > Field( // Creates a matcher that matches an object whose given property // matches 'matcher'. For example, // Property(&Foo::str, StartsWith("hi")) -// matches a Foo object x iff x.str() starts with "hi". +// matches a Foo object x if x.str() starts with "hi". template inline PolymorphicMatcher > @@ -3792,11 +3792,11 @@ Property(const std::string& property_name, property_name, property, MatcherCast(matcher))); } -// Creates a matcher that matches an object iff the result of applying +// Creates a matcher that matches an object if the result of applying // a callable to x matches 'matcher'. // For example, // ResultOf(f, StartsWith("hi")) -// matches a Foo object x iff f(x) starts with "hi". +// matches a Foo object x if f(x) starts with "hi". // `callable` parameter can be a function, function pointer, or a functor. It is // required to keep no state affecting the results of the calls on it and make // no assumptions about how many calls will be made. Any state it keeps must be @@ -4345,7 +4345,7 @@ inline internal::MatcherAsPredicate Matches(M matcher) { return internal::MatcherAsPredicate(matcher); } -// Returns true iff the value matches the matcher. +// Returns true if the value matches the matcher. template inline bool Value(const T& value, M matcher) { return testing::Matches(matcher)(value); @@ -4551,7 +4551,7 @@ PolymorphicMatcher > VariantWith( // These macros allow using matchers to check values in Google Test // tests. ASSERT_THAT(value, matcher) and EXPECT_THAT(value, matcher) -// succeed iff the value matches the matcher. If the assertion fails, +// succeed if the value matches the matcher. If the assertion fails, // the value and the description of the matcher will be printed. #define ASSERT_THAT(value, matcher) ASSERT_PRED_FORMAT1(\ ::testing::internal::MakePredicateFormatterFromMatcher(matcher), value) diff --git a/googlemock/include/gmock/gmock-spec-builders.h b/googlemock/include/gmock/gmock-spec-builders.h index 255d6ad6..81ee3457 100644 --- a/googlemock/include/gmock/gmock-spec-builders.h +++ b/googlemock/include/gmock/gmock-spec-builders.h @@ -331,7 +331,7 @@ class OnCallSpec : public UntypedOnCallSpecBase { return *this; } - // Returns true iff the given arguments match the matchers. + // Returns true if the given arguments match the matchers. bool Matches(const ArgumentTuple& args) const { return TupleMatches(matchers_, args) && extra_matcher_.Matches(args); } @@ -389,7 +389,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 iff the + // default actions and expectations. Returns true if the // verification was successful. static bool VerifyAndClear(void* mock_obj) GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex); @@ -515,7 +515,7 @@ 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 iff rhs references the same expectation as this object does. + // Returns true if rhs references the same expectation as this object does. bool operator==(const Expectation& rhs) const { return expectation_base_ == rhs.expectation_base_; } @@ -597,7 +597,7 @@ class ExpectationSet { // The compiler-generator ctor and operator= works exactly as // intended, so we don't need to define our own. - // Returns true iff rhs contains the same set of Expectation objects + // Returns true if rhs contains the same set of Expectation objects // as this does. bool operator==(const ExpectationSet& rhs) const { return expectations_ == rhs.expectations_; @@ -759,7 +759,7 @@ class GTEST_API_ ExpectationBase { // by the subclasses to implement the .Times() clause. void SpecifyCardinality(const Cardinality& cardinality); - // Returns true iff the user specified the cardinality explicitly + // Returns true if the user specified the cardinality explicitly // using a .Times(). bool cardinality_specified() const { return cardinality_specified_; } @@ -776,7 +776,7 @@ class GTEST_API_ ExpectationBase { void RetireAllPreRequisites() GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex); - // Returns true iff this expectation is retired. + // Returns true if this expectation is retired. bool is_retired() const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) { g_gmock_mutex.AssertHeld(); @@ -790,28 +790,28 @@ class GTEST_API_ ExpectationBase { retired_ = true; } - // Returns true iff this expectation is satisfied. + // Returns true 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 iff this expectation is saturated. + // Returns true 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 iff this expectation is over-saturated. + // Returns true 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 iff all pre-requisites of this expectation are satisfied. + // Returns true if all pre-requisites of this expectation are satisfied. bool AllPrerequisitesAreSatisfied() const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex); @@ -854,7 +854,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 iff the cardinality is specified explicitly. + // True 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 @@ -868,7 +868,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 iff this expectation has retired. + bool retired_; // True if this expectation has retired. UntypedActions untyped_actions_; bool extra_matcher_specified_; bool repeated_action_specified_; // True if a WillRepeatedly() was specified. @@ -1086,14 +1086,14 @@ class TypedExpectation : public ExpectationBase { // statement finishes and when the current thread holds // g_gmock_mutex. - // Returns true iff this expectation matches the given arguments. + // Returns true 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 iff this expectation should handle the given arguments. + // Returns true 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(); diff --git a/googlemock/include/gmock/internal/gmock-internal-utils.h b/googlemock/include/gmock/internal/gmock-internal-utils.h index 01e96cfe..ee004790 100644 --- a/googlemock/include/gmock/internal/gmock-internal-utils.h +++ b/googlemock/include/gmock/internal/gmock-internal-utils.h @@ -176,11 +176,11 @@ GMOCK_DECLARE_KIND_(long double, kFloatingPoint); static_cast< ::testing::internal::TypeKind>( \ ::testing::internal::KindOf::value) -// Evaluates to true iff integer type T is signed. +// Evaluates to true if integer type T is signed. #define GMOCK_IS_SIGNED_(T) (static_cast(-1) < 0) // LosslessArithmeticConvertibleImpl::value -// is true iff arithmetic type From can be losslessly converted to +// is true if arithmetic type From can be losslessly converted to // arithmetic type To. // // It's the user's responsibility to ensure that both From and To are @@ -211,7 +211,7 @@ template struct LosslessArithmeticConvertibleImpl : public false_type {}; // NOLINT -// Converting an integer to another non-bool integer is lossless iff +// Converting an integer to another non-bool integer is lossless if // the target type's range encloses the source type's range. template struct LosslessArithmeticConvertibleImpl @@ -243,13 +243,13 @@ struct LosslessArithmeticConvertibleImpl : public false_type {}; // NOLINT // Converting a floating-point to another floating-point is lossless -// iff the target type is at least as big as the source type. +// if the target type is at least as big as the source type. template struct LosslessArithmeticConvertibleImpl< kFloatingPoint, From, kFloatingPoint, To> : public bool_constant {}; // NOLINT -// LosslessArithmeticConvertible::value is true iff arithmetic +// LosslessArithmeticConvertible::value is true if arithmetic // type From can be losslessly converted to arithmetic type To. // // It's the user's responsibility to ensure that both From and To are @@ -324,11 +324,11 @@ const char kWarningVerbosity[] = "warning"; // No logs are printed. const char kErrorVerbosity[] = "error"; -// Returns true iff a log with the given severity is visible according +// Returns true if a log with the given severity is visible according // to the --gmock_verbose flag. GTEST_API_ bool LogIsVisible(LogSeverity severity); -// Prints the given message to stdout iff 'severity' >= the level +// Prints the given message to stdout if 'severity' >= the level // specified by the --gmock_verbose flag. If stack_frames_to_skip >= // 0, also prints the stack trace excluding the top // stack_frames_to_skip frames. In opt mode, any positive @@ -355,11 +355,11 @@ GTEST_API_ WithoutMatchers GetWithoutMatchers(); // Type traits. -// is_reference::value is non-zero iff T is a reference type. +// is_reference::value is non-zero if T is a reference type. template struct is_reference : public false_type {}; template struct is_reference : public true_type {}; -// type_equals::value is non-zero iff T1 and T2 are the same type. +// type_equals::value is non-zero if T1 and T2 are the same type. template struct type_equals : public false_type {}; template struct type_equals : public true_type {}; -- cgit v1.2.3