From 57e107a10ea4ff5d8d31df9e4833f80b414b0dd2 Mon Sep 17 00:00:00 2001 From: Aaron Jacobs Date: Tue, 23 Jul 2024 03:56:40 -0700 Subject: [PATCH] Run clang-format. PiperOrigin-RevId: 655106304 Change-Id: Ie69b407fce74b31cf71d6dcc1361910d30e86bb5 --- googlemock/include/gmock/gmock-actions.h | 5 +++-- googlemock/include/gmock/gmock-more-actions.h | 7 ++++--- googlemock/include/gmock/gmock-spec-builders.h | 10 ++++------ googlemock/include/gmock/internal/gmock-port.h | 1 + googlemock/src/gmock-cardinalities.cc | 8 ++++---- googlemock/test/gmock-actions_test.cc | 8 ++++---- googlemock/test/gmock-matchers-comparisons_test.cc | 1 - googlemock/test/gmock_link_test.h | 2 +- 8 files changed, 21 insertions(+), 21 deletions(-) diff --git a/googlemock/include/gmock/gmock-actions.h b/googlemock/include/gmock/gmock-actions.h index cd129969..11da8990 100644 --- a/googlemock/include/gmock/gmock-actions.h +++ b/googlemock/include/gmock/gmock-actions.h @@ -1665,8 +1665,9 @@ template struct ReturnArgAction { template ::type> - auto operator()(Args&&... args) const -> decltype(std::get( - std::forward_as_tuple(std::forward(args)...))) { + auto operator()(Args&&... args) const + -> decltype(std::get( + std::forward_as_tuple(std::forward(args)...))) { return std::get(std::forward_as_tuple(std::forward(args)...)); } }; diff --git a/googlemock/include/gmock/gmock-more-actions.h b/googlemock/include/gmock/gmock-more-actions.h index e341d47f..55294dbd 100644 --- a/googlemock/include/gmock/gmock-more-actions.h +++ b/googlemock/include/gmock/gmock-more-actions.h @@ -601,9 +601,10 @@ template struct InvokeArgumentAction { template ::type> - auto operator()(Args &&...args) const -> decltype(internal::InvokeArgument( - std::get(std::forward_as_tuple(std::forward(args)...)), - std::declval()...)) { + auto operator()(Args &&...args) const + -> decltype(internal::InvokeArgument( + std::get(std::forward_as_tuple(std::forward(args)...)), + std::declval()...)) { internal::FlatTuple args_tuple(FlatTupleConstructTag{}, std::forward(args)...); return params.Apply([&](const Params &...unpacked_params) { diff --git a/googlemock/include/gmock/gmock-spec-builders.h b/googlemock/include/gmock/gmock-spec-builders.h index 78ca15d0..c4c42b7c 100644 --- a/googlemock/include/gmock/gmock-spec-builders.h +++ b/googlemock/include/gmock/gmock-spec-builders.h @@ -868,7 +868,7 @@ class GTEST_API_ ExpectationBase { Clause last_clause_; mutable bool action_count_checked_; // Under mutex_. mutable Mutex mutex_; // Protects action_count_checked_. -}; // class ExpectationBase +}; // class ExpectationBase template class TypedExpectation; @@ -1838,9 +1838,8 @@ R FunctionMocker::InvokeWith(ArgumentTuple&& args) // Doing so slows down compilation dramatically because the *constructor* of // std::function is re-instantiated with different template // parameters each time. - const UninterestingCallCleanupHandler report_uninteresting_call = { - reaction, ss - }; + const UninterestingCallCleanupHandler report_uninteresting_call = {reaction, + ss}; return PerformActionAndPrintResult(nullptr, std::move(args), ss.str(), ss); } @@ -1890,8 +1889,7 @@ R FunctionMocker::InvokeWith(ArgumentTuple&& args) // std::function is re-instantiated with different template // parameters each time. const FailureCleanupHandler handle_failures = { - ss, why, loc, untyped_expectation, found, is_excessive - }; + ss, why, loc, untyped_expectation, found, is_excessive}; return PerformActionAndPrintResult(untyped_action, std::move(args), ss.str(), ss); diff --git a/googlemock/include/gmock/internal/gmock-port.h b/googlemock/include/gmock/internal/gmock-port.h index e9d9e32a..42d36d2f 100644 --- a/googlemock/include/gmock/internal/gmock-port.h +++ b/googlemock/include/gmock/internal/gmock-port.h @@ -42,6 +42,7 @@ #include #include + #include #include diff --git a/googlemock/src/gmock-cardinalities.cc b/googlemock/src/gmock-cardinalities.cc index 92cde348..a7283aaf 100644 --- a/googlemock/src/gmock-cardinalities.cc +++ b/googlemock/src/gmock-cardinalities.cc @@ -53,12 +53,12 @@ class BetweenCardinalityImpl : public CardinalityInterface { : min_(min >= 0 ? min : 0), max_(max >= min_ ? max : min_) { std::stringstream ss; if (min < 0) { - ss << "The invocation lower bound must be >= 0, " - << "but is actually " << min << "."; + ss << "The invocation lower bound must be >= 0, " << "but is actually " + << min << "."; internal::Expect(false, __FILE__, __LINE__, ss.str()); } else if (max < 0) { - ss << "The invocation upper bound must be >= 0, " - << "but is actually " << max << "."; + ss << "The invocation upper bound must be >= 0, " << "but is actually " + << max << "."; internal::Expect(false, __FILE__, __LINE__, ss.str()); } else if (min > max) { ss << "The invocation upper bound (" << max diff --git a/googlemock/test/gmock-actions_test.cc b/googlemock/test/gmock-actions_test.cc index da1675c5..59b94583 100644 --- a/googlemock/test/gmock-actions_test.cc +++ b/googlemock/test/gmock-actions_test.cc @@ -441,8 +441,8 @@ TEST(DefaultValueDeathTest, GetReturnsBuiltInDefaultValueWhenUnset) { EXPECT_EQ(0, DefaultValue::Get()); - EXPECT_DEATH_IF_SUPPORTED({ DefaultValue::Get(); }, - ""); + EXPECT_DEATH_IF_SUPPORTED( + { DefaultValue::Get(); }, ""); } TEST(DefaultValueTest, GetWorksForMoveOnlyIfSet) { @@ -505,8 +505,8 @@ TEST(DefaultValueOfReferenceDeathTest, GetReturnsBuiltInDefaultValueWhenUnset) { EXPECT_FALSE(DefaultValue::IsSet()); EXPECT_DEATH_IF_SUPPORTED({ DefaultValue::Get(); }, ""); - EXPECT_DEATH_IF_SUPPORTED({ DefaultValue::Get(); }, - ""); + EXPECT_DEATH_IF_SUPPORTED( + { DefaultValue::Get(); }, ""); } // Tests that ActionInterface can be implemented by defining the diff --git a/googlemock/test/gmock-matchers-comparisons_test.cc b/googlemock/test/gmock-matchers-comparisons_test.cc index 5b75b457..769dc99e 100644 --- a/googlemock/test/gmock-matchers-comparisons_test.cc +++ b/googlemock/test/gmock-matchers-comparisons_test.cc @@ -43,7 +43,6 @@ // possible loss of data and C4100, unreferenced local parameter GTEST_DISABLE_MSC_WARNINGS_PUSH_(4244 4100) - namespace testing { namespace gmock_matchers_test { namespace { diff --git a/googlemock/test/gmock_link_test.h b/googlemock/test/gmock_link_test.h index cf0a985b..cb5179b2 100644 --- a/googlemock/test/gmock_link_test.h +++ b/googlemock/test/gmock_link_test.h @@ -186,8 +186,8 @@ using testing::SetErrnoAndReturn; #endif #if GTEST_HAS_EXCEPTIONS -using testing::Throw; using testing::Rethrow; +using testing::Throw; #endif using testing::ContainsRegex;