summaryrefslogtreecommitdiffstats
path: root/googlemock
diff options
context:
space:
mode:
Diffstat (limited to 'googlemock')
-rw-r--r--googlemock/include/gmock/gmock-actions.h52
-rw-r--r--googlemock/include/gmock/gmock-function-mocker.h5
-rw-r--r--googlemock/include/gmock/gmock-matchers.h7
-rw-r--r--googlemock/include/gmock/gmock-more-actions.h21
-rw-r--r--googlemock/test/gmock-actions_test.cc4
-rw-r--r--googlemock/test/gmock-matchers-misc_test.cc4
-rw-r--r--googlemock/test/gmock-matchers_test.h6
7 files changed, 50 insertions, 49 deletions
diff --git a/googlemock/include/gmock/gmock-actions.h b/googlemock/include/gmock/gmock-actions.h
index aad07d5..a6c2489 100644
--- a/googlemock/include/gmock/gmock-actions.h
+++ b/googlemock/include/gmock/gmock-actions.h
@@ -1420,19 +1420,19 @@ struct WithArgsAction {
// providing a call operator because even with a particular set of arguments
// they don't have a fixed return type.
- template <typename R, typename... Args,
- typename std::enable_if<
- std::is_convertible<
- InnerAction,
- // Unfortunately we can't use the InnerSignature alias here;
- // MSVC complains about the I parameter pack not being
- // expanded (error C3520) despite it being expanded in the
- // type alias.
- // TupleElement is also an MSVC workaround.
- // See its definition for details.
- OnceAction<R(internal::TupleElement<
- I, std::tuple<Args...>>...)>>::value,
- int>::type = 0>
+ template <
+ typename R, typename... Args,
+ typename std::enable_if<
+ std::is_convertible<InnerAction,
+ // Unfortunately we can't use the InnerSignature
+ // alias here; MSVC complains about the I
+ // parameter pack not being expanded (error C3520)
+ // despite it being expanded in the type alias.
+ // TupleElement is also an MSVC workaround.
+ // See its definition for details.
+ OnceAction<R(internal::TupleElement<
+ I, std::tuple<Args...>>...)>>::value,
+ int>::type = 0>
operator OnceAction<R(Args...)>() && { // NOLINT
struct OA {
OnceAction<InnerSignature<R, Args...>> inner_action;
@@ -1447,19 +1447,19 @@ struct WithArgsAction {
return OA{std::move(inner_action)};
}
- template <typename R, typename... Args,
- typename std::enable_if<
- std::is_convertible<
- const InnerAction&,
- // Unfortunately we can't use the InnerSignature alias here;
- // MSVC complains about the I parameter pack not being
- // expanded (error C3520) despite it being expanded in the
- // type alias.
- // TupleElement is also an MSVC workaround.
- // See its definition for details.
- Action<R(internal::TupleElement<
- I, std::tuple<Args...>>...)>>::value,
- int>::type = 0>
+ template <
+ typename R, typename... Args,
+ typename std::enable_if<
+ std::is_convertible<const InnerAction&,
+ // Unfortunately we can't use the InnerSignature
+ // alias here; MSVC complains about the I
+ // parameter pack not being expanded (error C3520)
+ // despite it being expanded in the type alias.
+ // TupleElement is also an MSVC workaround.
+ // See its definition for details.
+ Action<R(internal::TupleElement<
+ I, std::tuple<Args...>>...)>>::value,
+ int>::type = 0>
operator Action<R(Args...)>() const { // NOLINT
Action<InnerSignature<R, Args...>> converted(inner_action);
diff --git a/googlemock/include/gmock/gmock-function-mocker.h b/googlemock/include/gmock/gmock-function-mocker.h
index 7306549..1a1f126 100644
--- a/googlemock/include/gmock/gmock-function-mocker.h
+++ b/googlemock/include/gmock/gmock-function-mocker.h
@@ -180,8 +180,9 @@ using internal::FunctionMocker;
_Signature)>::Result \
GMOCK_INTERNAL_EXPAND(_CallType) \
_MethodName(GMOCK_PP_REPEAT(GMOCK_INTERNAL_PARAMETER, _Signature, _N)) \
- GMOCK_PP_IF(_Constness, const, ) _RefSpec _NoexceptSpec \
- GMOCK_PP_IF(_Override, override, ) GMOCK_PP_IF(_Final, final, ) { \
+ GMOCK_PP_IF(_Constness, const, ) \
+ _RefSpec _NoexceptSpec GMOCK_PP_IF(_Override, override, ) \
+ GMOCK_PP_IF(_Final, final, ) { \
GMOCK_MOCKER_(_N, _Constness, _MethodName) \
.SetOwnerAndName(this, #_MethodName); \
return GMOCK_MOCKER_(_N, _Constness, _MethodName) \
diff --git a/googlemock/include/gmock/gmock-matchers.h b/googlemock/include/gmock/gmock-matchers.h
index 9e634f7..fc00c35 100644
--- a/googlemock/include/gmock/gmock-matchers.h
+++ b/googlemock/include/gmock/gmock-matchers.h
@@ -3317,8 +3317,8 @@ class FieldsAreMatcherImpl<Struct, IndexSequence<I...>>
std::vector<StringMatchResultListener> inner_listener(sizeof...(I));
VariadicExpand(
- {failed_pos == ~size_t{}&& !std::get<I>(matchers_).MatchAndExplain(
- std::get<I>(tuple), &inner_listener[I])
+ {failed_pos == ~size_t{} && !std::get<I>(matchers_).MatchAndExplain(
+ std::get<I>(tuple), &inner_listener[I])
? failed_pos = I
: 0 ...});
if (failed_pos != ~size_t{}) {
@@ -5474,8 +5474,7 @@ PolymorphicMatcher<internal::ExceptionMatcherImpl<Err>> ThrowsMessage(
inline name##Matcher GMOCK_INTERNAL_WARNING_PUSH() \
GMOCK_INTERNAL_WARNING_CLANG(ignored, "-Wunused-function") \
GMOCK_INTERNAL_WARNING_CLANG(ignored, "-Wunused-member-function") \
- name \
- GMOCK_INTERNAL_WARNING_POP()() { \
+ name GMOCK_INTERNAL_WARNING_POP()() { \
return {}; \
} \
template <typename arg_type> \
diff --git a/googlemock/include/gmock/gmock-more-actions.h b/googlemock/include/gmock/gmock-more-actions.h
index 148ac01..78169b1 100644
--- a/googlemock/include/gmock/gmock-more-actions.h
+++ b/googlemock/include/gmock/gmock-more-actions.h
@@ -526,9 +526,10 @@
GMOCK_INTERNAL_LIST_##value_params)){}) \
GMOCK_ACTION_CLASS_(name, value_params)(const GMOCK_ACTION_CLASS_( \
name, value_params) &) noexcept GMOCK_INTERNAL_DEFN_COPY_ \
- ##value_params GMOCK_ACTION_CLASS_(name, value_params)( \
- GMOCK_ACTION_CLASS_(name, value_params) &&) noexcept \
- GMOCK_INTERNAL_DEFN_COPY_##value_params template <typename F> \
+ ##value_params \
+ GMOCK_ACTION_CLASS_(name, value_params)(GMOCK_ACTION_CLASS_( \
+ name, value_params) &&) noexcept GMOCK_INTERNAL_DEFN_COPY_ \
+ ##value_params template <typename F> \
operator ::testing::Action<F>() const { \
return GMOCK_PP_IF( \
GMOCK_PP_IS_EMPTY(GMOCK_INTERNAL_COUNT_##value_params), \
@@ -602,13 +603,13 @@ 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(
+ 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) {
- auto&& callable = args_tuple.template Get<index>();
+ std::declval<const Params &>()...)) {
+ internal::FlatTuple<Args &&...> args_tuple(FlatTupleConstructTag{},
+ std::forward<Args>(args)...);
+ return params.Apply([&](const Params &...unpacked_params) {
+ auto &&callable = args_tuple.template Get<index>();
return internal::InvokeArgument(
std::forward<decltype(callable)>(callable), unpacked_params...);
});
@@ -648,7 +649,7 @@ struct InvokeArgumentAction {
// later.
template <std::size_t index, typename... Params>
internal::InvokeArgumentAction<index, typename std::decay<Params>::type...>
-InvokeArgument(Params&&... params) {
+InvokeArgument(Params &&...params) {
return {internal::FlatTuple<typename std::decay<Params>::type...>(
internal::FlatTupleConstructTag{}, std::forward<Params>(params)...)};
}
diff --git a/googlemock/test/gmock-actions_test.cc b/googlemock/test/gmock-actions_test.cc
index 510d15c..295470e 100644
--- a/googlemock/test/gmock-actions_test.cc
+++ b/googlemock/test/gmock-actions_test.cc
@@ -1410,7 +1410,7 @@ TEST(DoAll, ProvidesLvalueReferencesToInitialActions) {
void operator()(Obj&&) const { FAIL() << "Unexpected call"; }
};
- MockFunction<void(Obj &&)> mock;
+ MockFunction<void(Obj&&)> mock;
EXPECT_CALL(mock, Call)
.WillOnce(DoAll(InitialAction{}, InitialAction{}, [](Obj&&) {}))
.WillRepeatedly(DoAll(InitialAction{}, InitialAction{}, [](Obj&&) {}));
@@ -1438,7 +1438,7 @@ TEST(DoAll, ProvidesLvalueReferencesToInitialActions) {
void operator()(Obj&) && {}
};
- MockFunction<void(Obj &&)> mock;
+ MockFunction<void(Obj&&)> mock;
EXPECT_CALL(mock, Call)
.WillOnce(DoAll(InitialAction{}, InitialAction{}, [](Obj&&) {}));
diff --git a/googlemock/test/gmock-matchers-misc_test.cc b/googlemock/test/gmock-matchers-misc_test.cc
index 42a0e44..f99bbf4 100644
--- a/googlemock/test/gmock-matchers-misc_test.cc
+++ b/googlemock/test/gmock-matchers-misc_test.cc
@@ -1792,8 +1792,8 @@ TEST(ThrowsPredicateCompilesTest, ExceptionMatcherAcceptsBroadType) {
{
Matcher<uint64_t> inner = Eq(10);
Matcher<std::function<void()>> matcher = Throws<uint32_t>(inner);
- EXPECT_TRUE(matcher.Matches([]() { throw(uint32_t) 10; }));
- EXPECT_FALSE(matcher.Matches([]() { throw(uint32_t) 11; }));
+ EXPECT_TRUE(matcher.Matches([]() { throw (uint32_t)10; }));
+ EXPECT_FALSE(matcher.Matches([]() { throw (uint32_t)11; }));
}
}
diff --git a/googlemock/test/gmock-matchers_test.h b/googlemock/test/gmock-matchers_test.h
index 6c986e9..5695607 100644
--- a/googlemock/test/gmock-matchers_test.h
+++ b/googlemock/test/gmock-matchers_test.h
@@ -148,9 +148,9 @@ class GreaterThanMatcher : public MatcherInterface<T> {
};
// Names and instantiates a new instance of GTestMatcherTestP.
-#define INSTANTIATE_GTEST_MATCHER_TEST_P(TestSuite) \
- using TestSuite##P = GTestMatcherTestP; \
- INSTANTIATE_TEST_SUITE_P(MatcherInterface, TestSuite##P, Values(false)); \
+#define INSTANTIATE_GTEST_MATCHER_TEST_P(TestSuite) \
+ using TestSuite##P = GTestMatcherTestP; \
+ INSTANTIATE_TEST_SUITE_P(MatcherInterface, TestSuite##P, Values(false)); \
INSTANTIATE_TEST_SUITE_P(GtestMatcher, TestSuite##P, Values(true))
class GTestMatcherTestP : public testing::TestWithParam<bool> {