diff --git a/googlemock/include/gmock/gmock-actions.h b/googlemock/include/gmock/gmock-actions.h index a5fb6427..4b2c9cd5 100644 --- a/googlemock/include/gmock/gmock-actions.h +++ b/googlemock/include/gmock/gmock-actions.h @@ -175,7 +175,7 @@ struct BuiltInDefaultValueGetter { template struct BuiltInDefaultValueGetter { static T Get() { - Assert(/*condition=*/false, __FILE__, __LINE__, + Assert(false, __FILE__, __LINE__, "Default action undefined for the function return type."); #if defined(__GNUC__) || defined(__clang__) __builtin_unreachable(); diff --git a/googlemock/include/gmock/gmock-matchers.h b/googlemock/include/gmock/gmock-matchers.h index 244cb27d..5f5855f3 100644 --- a/googlemock/include/gmock/gmock-matchers.h +++ b/googlemock/include/gmock/gmock-matchers.h @@ -1908,12 +1908,12 @@ class [[nodiscard]] FloatingEqMatcher { template class [[nodiscard]] FloatingEq2Matcher { public: - FloatingEq2Matcher() { Init(-1, /*nan_eq_nan_val=*/false); } + FloatingEq2Matcher() { Init(-1, false); } explicit FloatingEq2Matcher(bool nan_eq_nan) { Init(-1, nan_eq_nan); } explicit FloatingEq2Matcher(FloatType max_abs_error) { - Init(max_abs_error, /*nan_eq_nan_val=*/false); + Init(max_abs_error, false); } FloatingEq2Matcher(FloatType max_abs_error, bool nan_eq_nan) { @@ -2942,8 +2942,7 @@ class [[nodiscard]] ContainsMatcherImpl bool MatchAndExplain(Container container, MatchResultListener* listener) const override { - return this->MatchAndExplainImpl(/*all_elements_should_match=*/false, - container, listener); + return this->MatchAndExplainImpl(false, container, listener); } }; @@ -4741,13 +4740,13 @@ inline PolymorphicMatcher IsNan() { // Creates a matcher that matches any double argument approximately // equal to rhs, where two NANs are considered unequal. inline internal::FloatingEqMatcher DoubleEq(double rhs) { - return internal::FloatingEqMatcher(rhs, /*nan_eq_nan=*/false); + return internal::FloatingEqMatcher(rhs, false); } // Creates a matcher that matches any double argument approximately // equal to rhs, including NaN values when rhs is NaN. inline internal::FloatingEqMatcher NanSensitiveDoubleEq(double rhs) { - return internal::FloatingEqMatcher(rhs, /*nan_eq_nan=*/true); + return internal::FloatingEqMatcher(rhs, true); } // Creates a matcher that matches any double argument approximately equal to @@ -4755,8 +4754,7 @@ inline internal::FloatingEqMatcher NanSensitiveDoubleEq(double rhs) { // considered unequal. The max absolute error bound must be non-negative. inline internal::FloatingEqMatcher DoubleNear(double rhs, double max_abs_error) { - return internal::FloatingEqMatcher(rhs, /*nan_eq_nan=*/false, - max_abs_error); + return internal::FloatingEqMatcher(rhs, false, max_abs_error); } // The DistanceFrom(target, get_distance, m) and DistanceFrom(target, m) @@ -4800,20 +4798,19 @@ DistanceFrom(T target, DistanceMatcher distance_matcher) { // rhs is NaN. The max absolute error bound must be non-negative. inline internal::FloatingEqMatcher NanSensitiveDoubleNear( double rhs, double max_abs_error) { - return internal::FloatingEqMatcher(rhs, /*nan_eq_nan=*/true, - max_abs_error); + return internal::FloatingEqMatcher(rhs, true, max_abs_error); } // Creates a matcher that matches any float argument approximately // equal to rhs, where two NANs are considered unequal. inline internal::FloatingEqMatcher FloatEq(float rhs) { - return internal::FloatingEqMatcher(rhs, /*nan_eq_nan=*/false); + return internal::FloatingEqMatcher(rhs, false); } // Creates a matcher that matches any float argument approximately // equal to rhs, including NaN values when rhs is NaN. inline internal::FloatingEqMatcher NanSensitiveFloatEq(float rhs) { - return internal::FloatingEqMatcher(rhs, /*nan_eq_nan=*/true); + return internal::FloatingEqMatcher(rhs, true); } // Creates a matcher that matches any float argument approximately equal to @@ -4821,8 +4818,7 @@ inline internal::FloatingEqMatcher NanSensitiveFloatEq(float rhs) { // considered unequal. The max absolute error bound must be non-negative. inline internal::FloatingEqMatcher FloatNear(float rhs, float max_abs_error) { - return internal::FloatingEqMatcher(rhs, /*nan_eq_nan=*/false, - max_abs_error); + return internal::FloatingEqMatcher(rhs, false, max_abs_error); } // Creates a matcher that matches any float argument approximately equal to @@ -4830,8 +4826,7 @@ inline internal::FloatingEqMatcher FloatNear(float rhs, // rhs is NaN. The max absolute error bound must be non-negative. inline internal::FloatingEqMatcher NanSensitiveFloatNear( float rhs, float max_abs_error) { - return internal::FloatingEqMatcher(rhs, /*nan_eq_nan=*/true, - max_abs_error); + return internal::FloatingEqMatcher(rhs, true, max_abs_error); } // Creates a matcher that matches a pointer (raw or smart) that points @@ -5074,13 +5069,13 @@ inline internal::FloatingEq2Matcher DoubleEq() { // Creates a polymorphic matcher that matches a 2-tuple where // FloatEq(first field) matches the second field with NaN equality. inline internal::FloatingEq2Matcher NanSensitiveFloatEq() { - return internal::FloatingEq2Matcher(/*nan_eq_nan=*/true); + return internal::FloatingEq2Matcher(true); } // Creates a polymorphic matcher that matches a 2-tuple where // DoubleEq(first field) matches the second field with NaN equality. inline internal::FloatingEq2Matcher NanSensitiveDoubleEq() { - return internal::FloatingEq2Matcher(/*nan_eq_nan=*/true); + return internal::FloatingEq2Matcher(true); } // Creates a polymorphic matcher that matches a 2-tuple where @@ -5100,8 +5095,7 @@ inline internal::FloatingEq2Matcher DoubleNear(double max_abs_error) { // equality. inline internal::FloatingEq2Matcher NanSensitiveFloatNear( float max_abs_error) { - return internal::FloatingEq2Matcher(max_abs_error, - /*nan_eq_nan=*/true); + return internal::FloatingEq2Matcher(max_abs_error, true); } // Creates a polymorphic matcher that matches a 2-tuple where @@ -5109,8 +5103,7 @@ inline internal::FloatingEq2Matcher NanSensitiveFloatNear( // equality. inline internal::FloatingEq2Matcher NanSensitiveDoubleNear( double max_abs_error) { - return internal::FloatingEq2Matcher(max_abs_error, - /*nan_eq_nan=*/true); + return internal::FloatingEq2Matcher(max_abs_error, true); } // Creates a matcher that matches any value of type T that m doesn't diff --git a/googlemock/include/gmock/gmock-spec-builders.h b/googlemock/include/gmock/gmock-spec-builders.h index cad491da..1be93588 100644 --- a/googlemock/include/gmock/gmock-spec-builders.h +++ b/googlemock/include/gmock/gmock-spec-builders.h @@ -909,7 +909,7 @@ class TypedExpectation : public ExpectationBase { // Implements the .With() clause. TypedExpectation& With(const Matcher& m) { if (last_clause_ == kWith) { - ExpectSpecProperty(/*property=*/false, + ExpectSpecProperty(false, ".With() cannot appear " "more than once in an EXPECT_CALL()."); } else { @@ -1032,7 +1032,7 @@ class TypedExpectation : public ExpectationBase { // Implements the .WillRepeatedly() clause. TypedExpectation& WillRepeatedly(const Action& action) { if (last_clause_ == kWillRepeatedly) { - ExpectSpecProperty(/*property=*/false, + ExpectSpecProperty(false, ".WillRepeatedly() cannot appear " "more than once in an EXPECT_CALL()."); } else { @@ -1421,11 +1421,11 @@ struct UntypedFunctionMockerBase::FailureCleanupHandler { if (!found) { // No expectation matches this call - reports a failure. - Expect(/*condition=*/false, /*file=*/nullptr, -1, ss.str()); + Expect(false, nullptr, -1, ss.str()); } else if (is_excessive) { // We had an upper-bound violation and the failure message is in ss. - Expect(/*condition=*/false, untyped_expectation->file(), - untyped_expectation->line(), ss.str()); + Expect(false, untyped_expectation->file(), untyped_expectation->line(), + ss.str()); } else { // We had an expected call and the matching expectation is // described in ss. @@ -1841,8 +1841,7 @@ R FunctionMocker::InvokeWith(ArgumentTuple&& args) const UninterestingCallCleanupHandler report_uninteresting_call = {reaction, ss}; - return PerformActionAndPrintResult(/*untyped_action=*/nullptr, - std::move(args), ss.str(), ss); + return PerformActionAndPrintResult(nullptr, std::move(args), ss.str(), ss); } bool is_excessive = false;