mirror of
https://github.com/google/googletest.git
synced 2026-10-28 18:07:18 +08:00
Automated Code Change
PiperOrigin-RevId: 990940938 Change-Id: I052d1ea54207708646fbf8608a13185d76225df2
This commit is contained in:
parent
5a4a3c968b
commit
3ca3771f9c
@ -175,7 +175,7 @@ struct BuiltInDefaultValueGetter {
|
||||
template <typename T>
|
||||
struct BuiltInDefaultValueGetter<T, false> {
|
||||
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();
|
||||
|
||||
@ -1908,12 +1908,12 @@ class [[nodiscard]] FloatingEqMatcher {
|
||||
template <typename FloatType>
|
||||
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<internal::IsNanMatcher> IsNan() {
|
||||
// Creates a matcher that matches any double argument approximately
|
||||
// equal to rhs, where two NANs are considered unequal.
|
||||
inline internal::FloatingEqMatcher<double> DoubleEq(double rhs) {
|
||||
return internal::FloatingEqMatcher<double>(rhs, /*nan_eq_nan=*/false);
|
||||
return internal::FloatingEqMatcher<double>(rhs, false);
|
||||
}
|
||||
|
||||
// Creates a matcher that matches any double argument approximately
|
||||
// equal to rhs, including NaN values when rhs is NaN.
|
||||
inline internal::FloatingEqMatcher<double> NanSensitiveDoubleEq(double rhs) {
|
||||
return internal::FloatingEqMatcher<double>(rhs, /*nan_eq_nan=*/true);
|
||||
return internal::FloatingEqMatcher<double>(rhs, true);
|
||||
}
|
||||
|
||||
// Creates a matcher that matches any double argument approximately equal to
|
||||
@ -4755,8 +4754,7 @@ inline internal::FloatingEqMatcher<double> NanSensitiveDoubleEq(double rhs) {
|
||||
// considered unequal. The max absolute error bound must be non-negative.
|
||||
inline internal::FloatingEqMatcher<double> DoubleNear(double rhs,
|
||||
double max_abs_error) {
|
||||
return internal::FloatingEqMatcher<double>(rhs, /*nan_eq_nan=*/false,
|
||||
max_abs_error);
|
||||
return internal::FloatingEqMatcher<double>(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<double> NanSensitiveDoubleNear(
|
||||
double rhs, double max_abs_error) {
|
||||
return internal::FloatingEqMatcher<double>(rhs, /*nan_eq_nan=*/true,
|
||||
max_abs_error);
|
||||
return internal::FloatingEqMatcher<double>(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<float> FloatEq(float rhs) {
|
||||
return internal::FloatingEqMatcher<float>(rhs, /*nan_eq_nan=*/false);
|
||||
return internal::FloatingEqMatcher<float>(rhs, false);
|
||||
}
|
||||
|
||||
// Creates a matcher that matches any float argument approximately
|
||||
// equal to rhs, including NaN values when rhs is NaN.
|
||||
inline internal::FloatingEqMatcher<float> NanSensitiveFloatEq(float rhs) {
|
||||
return internal::FloatingEqMatcher<float>(rhs, /*nan_eq_nan=*/true);
|
||||
return internal::FloatingEqMatcher<float>(rhs, true);
|
||||
}
|
||||
|
||||
// Creates a matcher that matches any float argument approximately equal to
|
||||
@ -4821,8 +4818,7 @@ inline internal::FloatingEqMatcher<float> NanSensitiveFloatEq(float rhs) {
|
||||
// considered unequal. The max absolute error bound must be non-negative.
|
||||
inline internal::FloatingEqMatcher<float> FloatNear(float rhs,
|
||||
float max_abs_error) {
|
||||
return internal::FloatingEqMatcher<float>(rhs, /*nan_eq_nan=*/false,
|
||||
max_abs_error);
|
||||
return internal::FloatingEqMatcher<float>(rhs, false, max_abs_error);
|
||||
}
|
||||
|
||||
// Creates a matcher that matches any float argument approximately equal to
|
||||
@ -4830,8 +4826,7 @@ inline internal::FloatingEqMatcher<float> FloatNear(float rhs,
|
||||
// rhs is NaN. The max absolute error bound must be non-negative.
|
||||
inline internal::FloatingEqMatcher<float> NanSensitiveFloatNear(
|
||||
float rhs, float max_abs_error) {
|
||||
return internal::FloatingEqMatcher<float>(rhs, /*nan_eq_nan=*/true,
|
||||
max_abs_error);
|
||||
return internal::FloatingEqMatcher<float>(rhs, true, max_abs_error);
|
||||
}
|
||||
|
||||
// Creates a matcher that matches a pointer (raw or smart) that points
|
||||
@ -5074,13 +5069,13 @@ inline internal::FloatingEq2Matcher<double> DoubleEq() {
|
||||
// Creates a polymorphic matcher that matches a 2-tuple where
|
||||
// FloatEq(first field) matches the second field with NaN equality.
|
||||
inline internal::FloatingEq2Matcher<float> NanSensitiveFloatEq() {
|
||||
return internal::FloatingEq2Matcher<float>(/*nan_eq_nan=*/true);
|
||||
return internal::FloatingEq2Matcher<float>(true);
|
||||
}
|
||||
|
||||
// Creates a polymorphic matcher that matches a 2-tuple where
|
||||
// DoubleEq(first field) matches the second field with NaN equality.
|
||||
inline internal::FloatingEq2Matcher<double> NanSensitiveDoubleEq() {
|
||||
return internal::FloatingEq2Matcher<double>(/*nan_eq_nan=*/true);
|
||||
return internal::FloatingEq2Matcher<double>(true);
|
||||
}
|
||||
|
||||
// Creates a polymorphic matcher that matches a 2-tuple where
|
||||
@ -5100,8 +5095,7 @@ inline internal::FloatingEq2Matcher<double> DoubleNear(double max_abs_error) {
|
||||
// equality.
|
||||
inline internal::FloatingEq2Matcher<float> NanSensitiveFloatNear(
|
||||
float max_abs_error) {
|
||||
return internal::FloatingEq2Matcher<float>(max_abs_error,
|
||||
/*nan_eq_nan=*/true);
|
||||
return internal::FloatingEq2Matcher<float>(max_abs_error, true);
|
||||
}
|
||||
|
||||
// Creates a polymorphic matcher that matches a 2-tuple where
|
||||
@ -5109,8 +5103,7 @@ inline internal::FloatingEq2Matcher<float> NanSensitiveFloatNear(
|
||||
// equality.
|
||||
inline internal::FloatingEq2Matcher<double> NanSensitiveDoubleNear(
|
||||
double max_abs_error) {
|
||||
return internal::FloatingEq2Matcher<double>(max_abs_error,
|
||||
/*nan_eq_nan=*/true);
|
||||
return internal::FloatingEq2Matcher<double>(max_abs_error, true);
|
||||
}
|
||||
|
||||
// Creates a matcher that matches any value of type T that m doesn't
|
||||
|
||||
@ -909,7 +909,7 @@ class TypedExpectation<R(Args...)> : public ExpectationBase {
|
||||
// Implements the .With() clause.
|
||||
TypedExpectation& With(const Matcher<const ArgumentTuple&>& 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<R(Args...)> : public ExpectationBase {
|
||||
// Implements the .WillRepeatedly() clause.
|
||||
TypedExpectation& WillRepeatedly(const Action<F>& 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<R(Args...)>::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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user