Skip to content

Commit

Permalink
Run clang-format.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 655106304
Change-Id: Ie69b407fce74b31cf71d6dcc1361910d30e86bb5
  • Loading branch information
jacobsa authored and copybara-github committed Jul 23, 2024
1 parent cee1ba1 commit 57e107a
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 21 deletions.
5 changes: 3 additions & 2 deletions googlemock/include/gmock/gmock-actions.h
Original file line number Diff line number Diff line change
Expand Up @@ -1665,8 +1665,9 @@ template <size_t k>
struct ReturnArgAction {
template <typename... Args,
typename = typename std::enable_if<(k < sizeof...(Args))>::type>
auto operator()(Args&&... args) const -> decltype(std::get<k>(
std::forward_as_tuple(std::forward<Args>(args)...))) {
auto operator()(Args&&... args) const
-> decltype(std::get<k>(
std::forward_as_tuple(std::forward<Args>(args)...))) {
return std::get<k>(std::forward_as_tuple(std::forward<Args>(args)...));
}
};
Expand Down
7 changes: 4 additions & 3 deletions googlemock/include/gmock/gmock-more-actions.h
Original file line number Diff line number Diff line change
Expand Up @@ -601,9 +601,10 @@ template <std::size_t index, typename... Params>
struct InvokeArgumentAction {
template <typename... Args,
typename = typename std::enable_if<(index < sizeof...(Args))>::type>
auto operator()(Args &&...args) const -> decltype(internal::InvokeArgument(
std::get<index>(std::forward_as_tuple(std::forward<Args>(args)...)),
std::declval<const Params &>()...)) {
auto operator()(Args &&...args) const
-> decltype(internal::InvokeArgument(
std::get<index>(std::forward_as_tuple(std::forward<Args>(args)...)),
std::declval<const Params &>()...)) {
internal::FlatTuple<Args &&...> args_tuple(FlatTupleConstructTag{},
std::forward<Args>(args)...);
return params.Apply([&](const Params &...unpacked_params) {
Expand Down
10 changes: 4 additions & 6 deletions googlemock/include/gmock/gmock-spec-builders.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <typename F>
class TypedExpectation;
Expand Down Expand Up @@ -1838,9 +1838,8 @@ R FunctionMocker<R(Args...)>::InvokeWith(ArgumentTuple&& args)
// Doing so slows down compilation dramatically because the *constructor* of
// std::function<T> 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);
}
Expand Down Expand Up @@ -1890,8 +1889,7 @@ R FunctionMocker<R(Args...)>::InvokeWith(ArgumentTuple&& args)
// std::function<T> 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);
Expand Down
1 change: 1 addition & 0 deletions googlemock/include/gmock/internal/gmock-port.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@

#include <assert.h>
#include <stdlib.h>

#include <cstdint>
#include <iostream>

Expand Down
8 changes: 4 additions & 4 deletions googlemock/src/gmock-cardinalities.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions googlemock/test/gmock-actions_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -441,8 +441,8 @@ TEST(DefaultValueDeathTest, GetReturnsBuiltInDefaultValueWhenUnset) {

EXPECT_EQ(0, DefaultValue<int>::Get());

EXPECT_DEATH_IF_SUPPORTED({ DefaultValue<MyNonDefaultConstructible>::Get(); },
"");
EXPECT_DEATH_IF_SUPPORTED(
{ DefaultValue<MyNonDefaultConstructible>::Get(); }, "");
}

TEST(DefaultValueTest, GetWorksForMoveOnlyIfSet) {
Expand Down Expand Up @@ -505,8 +505,8 @@ TEST(DefaultValueOfReferenceDeathTest, GetReturnsBuiltInDefaultValueWhenUnset) {
EXPECT_FALSE(DefaultValue<MyNonDefaultConstructible&>::IsSet());

EXPECT_DEATH_IF_SUPPORTED({ DefaultValue<int&>::Get(); }, "");
EXPECT_DEATH_IF_SUPPORTED({ DefaultValue<MyNonDefaultConstructible>::Get(); },
"");
EXPECT_DEATH_IF_SUPPORTED(
{ DefaultValue<MyNonDefaultConstructible>::Get(); }, "");
}

// Tests that ActionInterface can be implemented by defining the
Expand Down
1 change: 0 additions & 1 deletion googlemock/test/gmock-matchers-comparisons_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion googlemock/test/gmock_link_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 57e107a

Please sign in to comment.