From ecb1c3ddb6cf7d7df10bfbafdd374ca3d412992b Mon Sep 17 00:00:00 2001 From: Dariusz Ostolski Date: Sat, 14 Oct 2017 18:33:19 +0200 Subject: #1282: Doc typo fix --- googlemock/docs/CheatSheet.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'googlemock') diff --git a/googlemock/docs/CheatSheet.md b/googlemock/docs/CheatSheet.md index c94c2dac..c6367fdd 100644 --- a/googlemock/docs/CheatSheet.md +++ b/googlemock/docs/CheatSheet.md @@ -65,7 +65,7 @@ can specify it by appending `_WITH_CALLTYPE` to any of the macros described in the previous two sections and supplying the calling convention as the first argument to the macro. For example, ``` - MOCK_METHOD_1_WITH_CALLTYPE(STDMETHODCALLTYPE, Foo, bool(int n)); + MOCK_METHOD1_WITH_CALLTYPE(STDMETHODCALLTYPE, Foo, bool(int n)); MOCK_CONST_METHOD2_WITH_CALLTYPE(STDMETHODCALLTYPE, Bar, int(double x, double y)); ``` where `STDMETHODCALLTYPE` is defined by `` on Windows. -- cgit v1.2.3 From 2641b021fc2ab12896cf868d90f19936ef4b4696 Mon Sep 17 00:00:00 2001 From: Arkadiy Shapkin Date: Wed, 3 May 2017 13:40:33 +0300 Subject: Fix tests with VS2015 and VS2017 --- googlemock/test/gmock-generated-matchers_test.cc | 8 ++++---- googlemock/test/gmock-matchers_test.cc | 5 +++++ 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'googlemock') diff --git a/googlemock/test/gmock-generated-matchers_test.cc b/googlemock/test/gmock-generated-matchers_test.cc index 8234858d..6cba726d 100644 --- a/googlemock/test/gmock-generated-matchers_test.cc +++ b/googlemock/test/gmock-generated-matchers_test.cc @@ -120,7 +120,7 @@ TEST(ArgsTest, AcceptsOneTemplateArg) { } TEST(ArgsTest, AcceptsTwoTemplateArgs) { - const tuple t(4, 5, 6L); // NOLINT + const tuple t(static_cast(4), 5, 6L); // NOLINT EXPECT_THAT(t, (Args<0, 1>(Lt()))); EXPECT_THAT(t, (Args<1, 2>(Lt()))); @@ -128,13 +128,13 @@ TEST(ArgsTest, AcceptsTwoTemplateArgs) { } TEST(ArgsTest, AcceptsRepeatedTemplateArgs) { - const tuple t(4, 5, 6L); // NOLINT + const tuple t(static_cast(4), 5, 6L); // NOLINT EXPECT_THAT(t, (Args<0, 0>(Eq()))); EXPECT_THAT(t, Not(Args<1, 1>(Ne()))); } TEST(ArgsTest, AcceptsDecreasingTemplateArgs) { - const tuple t(4, 5, 6L); // NOLINT + const tuple t(static_cast(4), 5, 6L); // NOLINT EXPECT_THAT(t, (Args<2, 0>(Gt()))); EXPECT_THAT(t, Not(Args<2, 1>(Lt()))); } @@ -159,7 +159,7 @@ TEST(ArgsTest, AcceptsMoreTemplateArgsThanArityOfOriginalTuple) { } TEST(ArgsTest, CanBeNested) { - const tuple t(4, 5, 6L, 6); // NOLINT + const tuple t(static_cast(4), 5, 6L, 6); // NOLINT EXPECT_THAT(t, (Args<1, 2, 3>(Args<1, 2>(Eq())))); EXPECT_THAT(t, (Args<0, 1, 3>(Args<0, 2>(Lt())))); } diff --git a/googlemock/test/gmock-matchers_test.cc b/googlemock/test/gmock-matchers_test.cc index fc867487..207c6fdd 100644 --- a/googlemock/test/gmock-matchers_test.cc +++ b/googlemock/test/gmock-matchers_test.cc @@ -58,6 +58,11 @@ # include // NOLINT #endif +// Disable MSVC2015 warning for std::pair: "decorated name length exceeded, name was truncated". +#if defined(_MSC_VER) && (_MSC_VER == 1900) +# pragma warning(disable:4503) +#endif + namespace testing { namespace internal { -- cgit v1.2.3 From 840c711e7bd7240b3f451821473c759ad3578412 Mon Sep 17 00:00:00 2001 From: Arkady Shapkin Date: Thu, 8 Jun 2017 02:28:17 +0300 Subject: Fix gmock tests when std::unary_function unavailable --- googlemock/test/gmock-matchers_test.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'googlemock') diff --git a/googlemock/test/gmock-matchers_test.cc b/googlemock/test/gmock-matchers_test.cc index 207c6fdd..4beaec4c 100644 --- a/googlemock/test/gmock-matchers_test.cc +++ b/googlemock/test/gmock-matchers_test.cc @@ -3936,8 +3936,11 @@ TEST(ResultOfTest, WorksForFunctionReferences) { // Tests that ResultOf(f, ...) compiles and works as expected when f is a // function object. -struct Functor : public ::std::unary_function { - result_type operator()(argument_type input) const { +struct Functor { + typedef std::string result_type; + typedef int argument_type; + + std::string operator()(int input) const { return IntToStringFunction(input); } }; -- cgit v1.2.3 From 20e2de7d8bba9f3735c9a67b000f04853927a0f8 Mon Sep 17 00:00:00 2001 From: Romain Geissler Date: Fri, 21 Oct 2016 17:42:48 +0200 Subject: Remove gcc 6 misleading indentations. --- .../include/gmock/gmock-generated-matchers.h | 36 ++++++++++++++-------- .../include/gmock/gmock-generated-matchers.h.pump | 3 +- 2 files changed, 26 insertions(+), 13 deletions(-) (limited to 'googlemock') diff --git a/googlemock/include/gmock/gmock-generated-matchers.h b/googlemock/include/gmock/gmock-generated-matchers.h index 525f8a71..1655bcd3 100644 --- a/googlemock/include/gmock/gmock-generated-matchers.h +++ b/googlemock/include/gmock/gmock-generated-matchers.h @@ -1376,7 +1376,8 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { // ================ // // To learn more about using these macros, please search for 'MATCHER' -// on https://github.com/google/googletest/blob/master/googlemock/docs/CookBook.md +// on https://github.com/google/googletest/blob/master/googlemock/docs/ +// CookBook.md #define MATCHER(name, description)\ class name##Matcher {\ @@ -1397,8 +1398,9 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { private:\ ::testing::internal::string FormatDescription(bool negation) const {\ const ::testing::internal::string gmock_description = (description);\ - if (!gmock_description.empty())\ + if (!gmock_description.empty()) {\ return gmock_description;\ + }\ return ::testing::internal::FormatMatcherDescription(\ negation, #name, \ ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ @@ -1446,8 +1448,9 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { private:\ ::testing::internal::string FormatDescription(bool negation) const {\ const ::testing::internal::string gmock_description = (description);\ - if (!gmock_description.empty())\ + if (!gmock_description.empty()) {\ return gmock_description;\ + }\ return ::testing::internal::FormatMatcherDescription(\ negation, #name, \ ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ @@ -1499,8 +1502,9 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { private:\ ::testing::internal::string FormatDescription(bool negation) const {\ const ::testing::internal::string gmock_description = (description);\ - if (!gmock_description.empty())\ + if (!gmock_description.empty()) {\ return gmock_description;\ + }\ return ::testing::internal::FormatMatcherDescription(\ negation, #name, \ ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ @@ -1557,8 +1561,9 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { private:\ ::testing::internal::string FormatDescription(bool negation) const {\ const ::testing::internal::string gmock_description = (description);\ - if (!gmock_description.empty())\ + if (!gmock_description.empty()) {\ return gmock_description;\ + }\ return ::testing::internal::FormatMatcherDescription(\ negation, #name, \ ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ @@ -1620,8 +1625,9 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { private:\ ::testing::internal::string FormatDescription(bool negation) const {\ const ::testing::internal::string gmock_description = (description);\ - if (!gmock_description.empty())\ + if (!gmock_description.empty()) {\ return gmock_description;\ + }\ return ::testing::internal::FormatMatcherDescription(\ negation, #name, \ ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ @@ -1691,8 +1697,9 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { private:\ ::testing::internal::string FormatDescription(bool negation) const {\ const ::testing::internal::string gmock_description = (description);\ - if (!gmock_description.empty())\ + if (!gmock_description.empty()) {\ return gmock_description;\ + }\ return ::testing::internal::FormatMatcherDescription(\ negation, #name, \ ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ @@ -1765,8 +1772,9 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { private:\ ::testing::internal::string FormatDescription(bool negation) const {\ const ::testing::internal::string gmock_description = (description);\ - if (!gmock_description.empty())\ + if (!gmock_description.empty()) {\ return gmock_description;\ + }\ return ::testing::internal::FormatMatcherDescription(\ negation, #name, \ ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ @@ -1843,8 +1851,9 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { private:\ ::testing::internal::string FormatDescription(bool negation) const {\ const ::testing::internal::string gmock_description = (description);\ - if (!gmock_description.empty())\ + if (!gmock_description.empty()) {\ return gmock_description;\ + }\ return ::testing::internal::FormatMatcherDescription(\ negation, #name, \ ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ @@ -1928,8 +1937,9 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { private:\ ::testing::internal::string FormatDescription(bool negation) const {\ const ::testing::internal::string gmock_description = (description);\ - if (!gmock_description.empty())\ + if (!gmock_description.empty()) {\ return gmock_description;\ + }\ return ::testing::internal::FormatMatcherDescription(\ negation, #name, \ ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ @@ -2019,8 +2029,9 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { private:\ ::testing::internal::string FormatDescription(bool negation) const {\ const ::testing::internal::string gmock_description = (description);\ - if (!gmock_description.empty())\ + if (!gmock_description.empty()) {\ return gmock_description;\ + }\ return ::testing::internal::FormatMatcherDescription(\ negation, #name, \ ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ @@ -2115,8 +2126,9 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { private:\ ::testing::internal::string FormatDescription(bool negation) const {\ const ::testing::internal::string gmock_description = (description);\ - if (!gmock_description.empty())\ + if (!gmock_description.empty()) {\ return gmock_description;\ + }\ return ::testing::internal::FormatMatcherDescription(\ negation, #name, \ ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ diff --git a/googlemock/include/gmock/gmock-generated-matchers.h.pump b/googlemock/include/gmock/gmock-generated-matchers.h.pump index f91b1eab..25d2da99 100644 --- a/googlemock/include/gmock/gmock-generated-matchers.h.pump +++ b/googlemock/include/gmock/gmock-generated-matchers.h.pump @@ -639,8 +639,9 @@ $var param_field_decls2 = [[$for j private:\ ::testing::internal::string FormatDescription(bool negation) const {\ const ::testing::internal::string gmock_description = (description);\ - if (!gmock_description.empty())\ + if (!gmock_description.empty()) {\ return gmock_description;\ + }\ return ::testing::internal::FormatMatcherDescription(\ negation, #name, \ ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ -- cgit v1.2.3