diff options
Diffstat (limited to 'googlemock')
-rw-r--r-- | googlemock/README.md | 2 | ||||
-rw-r--r-- | googlemock/docs/cheat_sheet.md | 23 | ||||
-rw-r--r-- | googlemock/docs/cook_book.md | 12 | ||||
-rw-r--r-- | googlemock/docs/for_dummies.md | 2 | ||||
-rw-r--r-- | googlemock/docs/gmock_faq.md | 8 | ||||
-rw-r--r-- | googlemock/include/gmock/gmock-actions.h | 10 | ||||
-rw-r--r-- | googlemock/include/gmock/gmock-cardinalities.h | 10 | ||||
-rw-r--r-- | googlemock/include/gmock/gmock-matchers.h | 24 | ||||
-rw-r--r-- | googlemock/include/gmock/gmock-spec-builders.h | 28 | ||||
-rw-r--r-- | googlemock/include/gmock/gmock.h | 4 | ||||
-rw-r--r-- | googlemock/include/gmock/internal/gmock-internal-utils.h | 18 | ||||
-rw-r--r-- | googlemock/src/gmock-internal-utils.cc | 4 | ||||
-rw-r--r-- | googlemock/src/gmock-spec-builders.cc | 10 | ||||
-rw-r--r-- | googlemock/src/gmock.cc | 2 | ||||
-rw-r--r-- | googlemock/test/gmock-cardinalities_test.cc | 4 | ||||
-rw-r--r-- | googlemock/test/gmock-matchers_test.cc | 6 | ||||
-rw-r--r-- | googlemock/test/gmock-spec-builders_test.cc | 4 |
17 files changed, 85 insertions, 86 deletions
diff --git a/googlemock/README.md b/googlemock/README.md index ef6b7fc..183fdb8 100644 --- a/googlemock/README.md +++ b/googlemock/README.md @@ -28,10 +28,8 @@ gMock: - does not use exceptions, and - is easy to learn and use. - Details and examples can be found here: - * [gMock for Dummies](docs/for_dummies.md) * [Legacy gMock FAQ](docs/gmock_faq.md) * [gMock Cookbook](docs/cook_book.md) diff --git a/googlemock/docs/cheat_sheet.md b/googlemock/docs/cheat_sheet.md index 6441a7a..3bfc6dd 100644 --- a/googlemock/docs/cheat_sheet.md +++ b/googlemock/docs/cheat_sheet.md @@ -177,7 +177,8 @@ Example usage: To customize the default action for a particular method of a specific mock object, use `ON_CALL()`. `ON_CALL()` has a similar syntax to `EXPECT_CALL()`, but it is used for setting default behaviors (when you do not require that the -mock method is called). See go/prefer-on-call for a more detailed discussion. +mock method is called). See [here](cook_book.md#UseOnCall) for a more detailed +discussion. ```cpp ON_CALL(mock-object, method(matchers)) @@ -332,8 +333,8 @@ The `argument` can be either a C string or a C++ string object: `ContainsRegex()` and `MatchesRegex()` take ownership of the `RE` object. They use the regular expression syntax defined -[here](http://go/gunit-advanced-regex). `StrCaseEq()`, `StrCaseNe()`, `StrEq()`, -and `StrNe()` work for wide strings as well. +[here](advanced.md#regular-expression-syntax). `StrCaseEq()`, `StrCaseNe()`, +`StrEq()`, and `StrNe()` work for wide strings as well. #### Container Matchers @@ -599,10 +600,10 @@ which must be a permanent callback. **Notes:** 1. The `MATCHER*` macros cannot be used inside a function or class. -1. The matcher body must be *purely functional* (i.e. it cannot have any side +2. The matcher body must be *purely functional* (i.e. it cannot have any side effect, and the result must not depend on anything other than the value being matched and the matcher parameters). -1. You can use `PrintToString(x)` to convert a value `x` of any type to a +3. You can use `PrintToString(x)` to convert a value `x` of any type to a string. ### Actions {#ActionList} @@ -658,20 +659,20 @@ which must be a permanent callback. : : be any copyable value. Available since : : : v1.1.0. : -#### Using a Function, Functor, Lambda, or Callback as an Action +#### Using a Function, Functor, or Lambda as an Action In the following, by "callable" we mean a free function, `std::function`, -functor, lambda, or `google3`-style permanent callback. +functor, or lambda. | | | | :---------------------------------- | :------------------------------------- | | `f` | Invoke f with the arguments passed to | : : the mock function, where f is a : -: : callable (except of google3 callback). : +: : callable. : | `Invoke(f)` | Invoke `f` with the arguments passed | : : to the mock function, where `f` can be : : : a global/static function or a functor. : -| `Invoke(object_pointer, | Invoke the {method on the object with | +| `Invoke(object_pointer, | Invoke the method on the object with | : &class\:\:method)` : the arguments passed to the mock : : : function. : | `InvokeWithoutArgs(f)` | Invoke `f`, which can be a | @@ -886,12 +887,12 @@ you can do it earlier: using ::testing::Mock; ... // Verifies and removes the expectations on mock_obj; -// returns true iff successful. +// returns true if successful. Mock::VerifyAndClearExpectations(&mock_obj); ... // Verifies and removes the expectations on mock_obj; // also removes the default actions set by ON_CALL(); -// returns true iff successful. +// returns true if successful. Mock::VerifyAndClear(&mock_obj); ``` diff --git a/googlemock/docs/cook_book.md b/googlemock/docs/cook_book.md index 17c2645..676560b 100644 --- a/googlemock/docs/cook_book.md +++ b/googlemock/docs/cook_book.md @@ -1038,7 +1038,7 @@ arguments as *one* single tuple to the predicate. Have you noticed that a matcher is just a fancy predicate that also knows how to describe itself? Many existing algorithms take predicates as arguments (e.g. those defined in STL's `<algorithm>` header), and it would be a shame if gMock -matchers are not allowed to participate. +matchers were not allowed to participate. Luckily, you can use a matcher where a unary predicate functor is expected by wrapping it inside the `Matches()` function. For example, @@ -1245,7 +1245,7 @@ what if you want to make sure the value *pointed to* by the pointer, instead of the pointer itself, has a certain property? Well, you can use the `Pointee(m)` matcher. -`Pointee(m)` matches a pointer iff `m` matches the value the pointer points to. +`Pointee(m)` matches a pointer if `m` matches the value the pointer points to. For example: ```cpp @@ -2603,7 +2603,7 @@ However, if the action has its own state, you may be surprised if you share the action object. Suppose you have an action factory `IncrementCounter(init)` which creates an action that increments and returns a counter whose initial value is `init`, using two actions created from the same expression and using a shared -action will exihibit different behaviors. Example: +action will exhibit different behaviors. Example: ```cpp EXPECT_CALL(foo, DoThis()) @@ -3548,7 +3548,7 @@ class MatcherInterface { public: virtual ~MatcherInterface(); - // Returns true iff the matcher matches x; also explains the match + // Returns true if the matcher matches x; also explains the match // result to 'listener'. virtual bool MatchAndExplain(T x, MatchResultListener* listener) const = 0; @@ -3702,10 +3702,10 @@ class CardinalityInterface { public: virtual ~CardinalityInterface(); - // 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. diff --git a/googlemock/docs/for_dummies.md b/googlemock/docs/for_dummies.md index 5551cd8..3bccd2b 100644 --- a/googlemock/docs/for_dummies.md +++ b/googlemock/docs/for_dummies.md @@ -695,4 +695,4 @@ For example, in some tests we may not care about how many times `GetX()` and In gMock, if you are not interested in a method, just don't say anything about it. If a call to this method occurs, you'll see a warning in the test output, but it won't be a failure. This is called "naggy" behavior; to change, see -[The Nice, the Strict, and the Naggy](#NiceStrictNaggy). +[The Nice, the Strict, and the Naggy](cook_book.md#NiceStrictNaggy). diff --git a/googlemock/docs/gmock_faq.md b/googlemock/docs/gmock_faq.md index 8bc45b1..214aabf 100644 --- a/googlemock/docs/gmock_faq.md +++ b/googlemock/docs/gmock_faq.md @@ -81,7 +81,7 @@ void Bar(int* p); // Neither p nor *p is const. void Bar(const int* p); // p is not const, but *p is. ``` -<<!-- GOOGLETEST_CM0030 DO NOT DELETE --> +<!-- GOOGLETEST_CM0030 DO NOT DELETE --> ### I can't figure out why gMock thinks my expectations are not satisfied. What should I do? @@ -91,9 +91,9 @@ trace, you'll gain insights on why the expectations you set are not met. If you see the message "The mock function has no default action set, and its return type has no default value set.", then try -[adding a default action](http://go/gmockguide#DefaultValue). Due to a known -issue, unexpected calls on mocks without default actions don't print out a -detailed comparison between the actual arguments and the expected arguments. +[adding a default action](for_dummies.md#DefaultValue). Due to a known issue, +unexpected calls on mocks without default actions don't print out a detailed +comparison between the actual arguments and the expected arguments. ### My program crashed and `ScopedMockLog` spit out tons of messages. Is it a gMock bug? diff --git a/googlemock/include/gmock/gmock-actions.h b/googlemock/include/gmock/gmock-actions.h index 6895dfd..e921cf4 100644 --- a/googlemock/include/gmock/gmock-actions.h +++ b/googlemock/include/gmock/gmock-actions.h @@ -99,7 +99,7 @@ struct BuiltInDefaultValueGetter<T, false> { template <typename T> 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<T>::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<T&> { // 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 <typename Func> explicit Action(const Action<Func>& 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 <typename G> 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<F> fun_; }; diff --git a/googlemock/include/gmock/gmock-cardinalities.h b/googlemock/include/gmock/gmock-cardinalities.h index 8fa25eb..4b269a3 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 fcf8cf2..7075082 100644 --- a/googlemock/include/gmock/gmock-matchers.h +++ b/googlemock/include/gmock/gmock-matchers.h @@ -361,7 +361,7 @@ template <size_t N> class TuplePrefix { public: // TuplePrefix<N>::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 <typename MatcherTuple, typename ValueTuple> 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<PairType> { testing::SafeMatcherCast<const KeyType&>(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<PairType> { 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<Tuple2Matcher, Second>(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 <typename Tuple2Matcher, typename Second> BoundSecondMatcher<Tuple2Matcher, Second> MatcherBindSecond( @@ -3710,7 +3710,7 @@ WhenDynamicCastTo(const Matcher<To>& 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 <typename Class, typename FieldType, typename FieldMatcher> inline PolymorphicMatcher< internal::FieldMatcher<Class, FieldType> > Field( @@ -3737,7 +3737,7 @@ inline PolymorphicMatcher<internal::FieldMatcher<Class, FieldType> > 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 <typename Class, typename PropertyType, typename PropertyMatcher> inline PolymorphicMatcher<internal::PropertyMatcher< Class, PropertyType, PropertyType (Class::*)() const> > @@ -3792,11 +3792,11 @@ Property(const std::string& property_name, property_name, property, MatcherCast<const PropertyType&>(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<M> Matches(M matcher) { return internal::MatcherAsPredicate<M>(matcher); } -// Returns true iff the value matches the matcher. +// Returns true if the value matches the matcher. template <typename T, typename M> inline bool Value(const T& value, M matcher) { return testing::Matches(matcher)(value); @@ -4551,7 +4551,7 @@ PolymorphicMatcher<internal::variant_matcher::VariantMatcher<T> > 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 255d6ad..81ee345 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/gmock.h b/googlemock/include/gmock/gmock.h index 7096984..99c3d78 100644 --- a/googlemock/include/gmock/gmock.h +++ b/googlemock/include/gmock/gmock.h @@ -39,14 +39,14 @@ // This file implements the following syntax: // -// ON_CALL(mock_object.Method(...)) +// ON_CALL(mock_object, Method(...)) // .With(...) ? // .WillByDefault(...); // // where With() is optional and WillByDefault() must appear exactly // once. // -// EXPECT_CALL(mock_object.Method(...)) +// EXPECT_CALL(mock_object, Method(...)) // .With(...) ? // .Times(...) ? // .InSequence(...) * diff --git a/googlemock/include/gmock/internal/gmock-internal-utils.h b/googlemock/include/gmock/internal/gmock-internal-utils.h index 01e96cf..ee00479 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<type>::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<T>(-1) < 0) // LosslessArithmeticConvertibleImpl<kFromKind, From, kToKind, To>::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 <typename From> struct LosslessArithmeticConvertibleImpl<kInteger, From, kBool, bool> : 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 <typename From, typename To> struct LosslessArithmeticConvertibleImpl<kInteger, From, kInteger, To> @@ -243,13 +243,13 @@ struct LosslessArithmeticConvertibleImpl<kFloatingPoint, From, kInteger, To> : 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 <typename From, typename To> struct LosslessArithmeticConvertibleImpl< kFloatingPoint, From, kFloatingPoint, To> : public bool_constant<sizeof(From) <= sizeof(To)> {}; // NOLINT -// LosslessArithmeticConvertible<From, To>::value is true iff arithmetic +// LosslessArithmeticConvertible<From, To>::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<T>::value is non-zero iff T is a reference type. +// is_reference<T>::value is non-zero if T is a reference type. template <typename T> struct is_reference : public false_type {}; template <typename T> struct is_reference<T&> : public true_type {}; -// type_equals<T1, T2>::value is non-zero iff T1 and T2 are the same type. +// type_equals<T1, T2>::value is non-zero if T1 and T2 are the same type. template <typename T1, typename T2> struct type_equals : public false_type {}; template <typename T> struct type_equals<T, T> : public true_type {}; diff --git a/googlemock/src/gmock-internal-utils.cc b/googlemock/src/gmock-internal-utils.cc index 1594662..1292e1d 100644 --- a/googlemock/src/gmock-internal-utils.cc +++ b/googlemock/src/gmock-internal-utils.cc @@ -123,7 +123,7 @@ GTEST_API_ FailureReporterInterface* GetFailureReporter() { // Protects global resources (stdout in particular) used by Log(). static GTEST_DEFINE_STATIC_MUTEX_(g_log_mutex); -// 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) { if (GMOCK_FLAG(verbose) == kInfoVerbosity) { @@ -139,7 +139,7 @@ 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 diff --git a/googlemock/src/gmock-spec-builders.cc b/googlemock/src/gmock-spec-builders.cc index ea8e173..f6705a3 100644 --- a/googlemock/src/gmock-spec-builders.cc +++ b/googlemock/src/gmock-spec-builders.cc @@ -126,7 +126,7 @@ void ExpectationBase::RetireAllPreRequisites() } } -// Returns true iff all pre-requisites of this expectation have been +// Returns true if all pre-requisites of this expectation have been // satisfied. bool ExpectationBase::AllPrerequisitesAreSatisfied() const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) { @@ -384,7 +384,7 @@ UntypedActionResultHolderBase* UntypedFunctionMockerBase::UntypedInvokeWith( const CallReaction reaction = Mock::GetReactionOnUninterestingCalls(MockObject()); - // True iff we need to print this call's arguments and return + // True if we need to print this call's arguments and return // value. This definition must be kept in sync with // the behavior of ReportUninterestingCall(). const bool need_to_report_uninteresting_call = @@ -435,7 +435,7 @@ UntypedActionResultHolderBase* UntypedFunctionMockerBase::UntypedInvokeWith( &ss, &why); const bool found = untyped_expectation != nullptr; - // True iff we need to print the call's arguments and return value. + // True if we need to print the call's arguments and return value. // This definition must be kept in sync with the uses of Expect() // and Log() in this function. const bool need_to_report_call = @@ -574,7 +574,7 @@ struct MockObjectState { int first_used_line; ::std::string first_used_test_suite; ::std::string first_used_test; - bool leakable; // true iff it's OK to leak the object. + bool leakable; // true if it's OK to leak the object. FunctionMockers function_mockers; // All registered methods of the object. }; @@ -718,7 +718,7 @@ bool Mock::VerifyAndClearExpectations(void* mock_obj) } // 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. bool Mock::VerifyAndClear(void* mock_obj) GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) { diff --git a/googlemock/src/gmock.cc b/googlemock/src/gmock.cc index 05566e2..ce926f2 100644 --- a/googlemock/src/gmock.cc +++ b/googlemock/src/gmock.cc @@ -34,7 +34,7 @@ namespace testing { GMOCK_DEFINE_bool_(catch_leaked_mocks, true, - "true iff Google Mock should report leaked mock objects " + "true if Google Mock should report leaked mock objects " "as failures."); GMOCK_DEFINE_string_(verbose, internal::kWarningVerbosity, diff --git a/googlemock/test/gmock-cardinalities_test.cc b/googlemock/test/gmock-cardinalities_test.cc index 60fd06a..66042d4 100644 --- a/googlemock/test/gmock-cardinalities_test.cc +++ b/googlemock/test/gmock-cardinalities_test.cc @@ -395,12 +395,12 @@ TEST(ExactlyTest, HasCorrectBounds) { class EvenCardinality : public CardinalityInterface { public: - // 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 override { return (call_count % 2 == 0); } - // 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 override { return false; } diff --git a/googlemock/test/gmock-matchers_test.cc b/googlemock/test/gmock-matchers_test.cc index 89ad335..74e9294 100644 --- a/googlemock/test/gmock-matchers_test.cc +++ b/googlemock/test/gmock-matchers_test.cc @@ -956,7 +956,7 @@ TEST(TypedEqTest, CanDescribeSelf) { // Tests that TypedEq<T>(v) has type Matcher<T>. -// Type<T>::IsTypeOf(v) compiles iff the type of value v is T, where T +// Type<T>::IsTypeOf(v) compiles if the type of value v is T, where T // is a "bare" type (i.e. not in the form of const U or U&). If v's // type is not T, the compiler will generate a message about // "undefined reference". @@ -2640,7 +2640,7 @@ class IsGreaterThan { // For testing Truly(). const int foo = 0; -// This predicate returns true iff the argument references foo and has +// This predicate returns true if the argument references foo and has // a zero value. bool ReferencesFooAndIsZero(const int& n) { return (&n == &foo) && (n == 0); @@ -3594,7 +3594,7 @@ class Uncopyable { GTEST_DISALLOW_COPY_AND_ASSIGN_(Uncopyable); }; -// Returns true iff x.value() is positive. +// Returns true if x.value() is positive. bool ValueIsPositive(const Uncopyable& x) { return x.value() > 0; } MATCHER_P(UncopyableIs, inner_matcher, "") { diff --git a/googlemock/test/gmock-spec-builders_test.cc b/googlemock/test/gmock-spec-builders_test.cc index d362a90..95b4b8b 100644 --- a/googlemock/test/gmock-spec-builders_test.cc +++ b/googlemock/test/gmock-spec-builders_test.cc @@ -1952,12 +1952,12 @@ TEST(DeletingMockEarlyTest, Failure2) { class EvenNumberCardinality : public CardinalityInterface { public: - // 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 override { return call_count % 2 == 0; } - // 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 override { return false; } |