Run clang-format.
PiperOrigin-RevId: 655106304 Change-Id: Ie69b407fce74b31cf71d6dcc1361910d30e86bb5
This commit is contained in:
parent
cee1ba1f24
commit
57e107a10e
@ -1665,7 +1665,8 @@ template <size_t k>
|
|||||||
struct ReturnArgAction {
|
struct ReturnArgAction {
|
||||||
template <typename... Args,
|
template <typename... Args,
|
||||||
typename = typename std::enable_if<(k < sizeof...(Args))>::type>
|
typename = typename std::enable_if<(k < sizeof...(Args))>::type>
|
||||||
auto operator()(Args&&... args) const -> decltype(std::get<k>(
|
auto operator()(Args&&... args) const
|
||||||
|
-> decltype(std::get<k>(
|
||||||
std::forward_as_tuple(std::forward<Args>(args)...))) {
|
std::forward_as_tuple(std::forward<Args>(args)...))) {
|
||||||
return std::get<k>(std::forward_as_tuple(std::forward<Args>(args)...));
|
return std::get<k>(std::forward_as_tuple(std::forward<Args>(args)...));
|
||||||
}
|
}
|
||||||
|
@ -601,7 +601,8 @@ template <std::size_t index, typename... Params>
|
|||||||
struct InvokeArgumentAction {
|
struct InvokeArgumentAction {
|
||||||
template <typename... Args,
|
template <typename... Args,
|
||||||
typename = typename std::enable_if<(index < sizeof...(Args))>::type>
|
typename = typename std::enable_if<(index < sizeof...(Args))>::type>
|
||||||
auto operator()(Args &&...args) const -> decltype(internal::InvokeArgument(
|
auto operator()(Args &&...args) const
|
||||||
|
-> decltype(internal::InvokeArgument(
|
||||||
std::get<index>(std::forward_as_tuple(std::forward<Args>(args)...)),
|
std::get<index>(std::forward_as_tuple(std::forward<Args>(args)...)),
|
||||||
std::declval<const Params &>()...)) {
|
std::declval<const Params &>()...)) {
|
||||||
internal::FlatTuple<Args &&...> args_tuple(FlatTupleConstructTag{},
|
internal::FlatTuple<Args &&...> args_tuple(FlatTupleConstructTag{},
|
||||||
|
@ -1838,9 +1838,8 @@ R FunctionMocker<R(Args...)>::InvokeWith(ArgumentTuple&& args)
|
|||||||
// Doing so slows down compilation dramatically because the *constructor* of
|
// Doing so slows down compilation dramatically because the *constructor* of
|
||||||
// std::function<T> is re-instantiated with different template
|
// std::function<T> is re-instantiated with different template
|
||||||
// parameters each time.
|
// parameters each time.
|
||||||
const UninterestingCallCleanupHandler report_uninteresting_call = {
|
const UninterestingCallCleanupHandler report_uninteresting_call = {reaction,
|
||||||
reaction, ss
|
ss};
|
||||||
};
|
|
||||||
|
|
||||||
return PerformActionAndPrintResult(nullptr, std::move(args), ss.str(), ss);
|
return PerformActionAndPrintResult(nullptr, std::move(args), ss.str(), ss);
|
||||||
}
|
}
|
||||||
@ -1890,8 +1889,7 @@ R FunctionMocker<R(Args...)>::InvokeWith(ArgumentTuple&& args)
|
|||||||
// std::function<T> is re-instantiated with different template
|
// std::function<T> is re-instantiated with different template
|
||||||
// parameters each time.
|
// parameters each time.
|
||||||
const FailureCleanupHandler handle_failures = {
|
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(),
|
return PerformActionAndPrintResult(untyped_action, std::move(args), ss.str(),
|
||||||
ss);
|
ss);
|
||||||
|
@ -42,6 +42,7 @@
|
|||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
@ -53,12 +53,12 @@ class BetweenCardinalityImpl : public CardinalityInterface {
|
|||||||
: min_(min >= 0 ? min : 0), max_(max >= min_ ? max : min_) {
|
: min_(min >= 0 ? min : 0), max_(max >= min_ ? max : min_) {
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
if (min < 0) {
|
if (min < 0) {
|
||||||
ss << "The invocation lower bound must be >= 0, "
|
ss << "The invocation lower bound must be >= 0, " << "but is actually "
|
||||||
<< "but is actually " << min << ".";
|
<< min << ".";
|
||||||
internal::Expect(false, __FILE__, __LINE__, ss.str());
|
internal::Expect(false, __FILE__, __LINE__, ss.str());
|
||||||
} else if (max < 0) {
|
} else if (max < 0) {
|
||||||
ss << "The invocation upper bound must be >= 0, "
|
ss << "The invocation upper bound must be >= 0, " << "but is actually "
|
||||||
<< "but is actually " << max << ".";
|
<< max << ".";
|
||||||
internal::Expect(false, __FILE__, __LINE__, ss.str());
|
internal::Expect(false, __FILE__, __LINE__, ss.str());
|
||||||
} else if (min > max) {
|
} else if (min > max) {
|
||||||
ss << "The invocation upper bound (" << max
|
ss << "The invocation upper bound (" << max
|
||||||
|
@ -441,8 +441,8 @@ TEST(DefaultValueDeathTest, GetReturnsBuiltInDefaultValueWhenUnset) {
|
|||||||
|
|
||||||
EXPECT_EQ(0, DefaultValue<int>::Get());
|
EXPECT_EQ(0, DefaultValue<int>::Get());
|
||||||
|
|
||||||
EXPECT_DEATH_IF_SUPPORTED({ DefaultValue<MyNonDefaultConstructible>::Get(); },
|
EXPECT_DEATH_IF_SUPPORTED(
|
||||||
"");
|
{ DefaultValue<MyNonDefaultConstructible>::Get(); }, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(DefaultValueTest, GetWorksForMoveOnlyIfSet) {
|
TEST(DefaultValueTest, GetWorksForMoveOnlyIfSet) {
|
||||||
@ -505,8 +505,8 @@ TEST(DefaultValueOfReferenceDeathTest, GetReturnsBuiltInDefaultValueWhenUnset) {
|
|||||||
EXPECT_FALSE(DefaultValue<MyNonDefaultConstructible&>::IsSet());
|
EXPECT_FALSE(DefaultValue<MyNonDefaultConstructible&>::IsSet());
|
||||||
|
|
||||||
EXPECT_DEATH_IF_SUPPORTED({ DefaultValue<int&>::Get(); }, "");
|
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
|
// Tests that ActionInterface can be implemented by defining the
|
||||||
|
@ -43,7 +43,6 @@
|
|||||||
// possible loss of data and C4100, unreferenced local parameter
|
// possible loss of data and C4100, unreferenced local parameter
|
||||||
GTEST_DISABLE_MSC_WARNINGS_PUSH_(4244 4100)
|
GTEST_DISABLE_MSC_WARNINGS_PUSH_(4244 4100)
|
||||||
|
|
||||||
|
|
||||||
namespace testing {
|
namespace testing {
|
||||||
namespace gmock_matchers_test {
|
namespace gmock_matchers_test {
|
||||||
namespace {
|
namespace {
|
||||||
|
@ -186,8 +186,8 @@ using testing::SetErrnoAndReturn;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if GTEST_HAS_EXCEPTIONS
|
#if GTEST_HAS_EXCEPTIONS
|
||||||
using testing::Throw;
|
|
||||||
using testing::Rethrow;
|
using testing::Rethrow;
|
||||||
|
using testing::Throw;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
using testing::ContainsRegex;
|
using testing::ContainsRegex;
|
||||||
|
Loading…
Reference in New Issue
Block a user