From b7c568326c969c59a5f90e4731dc5b91f260c6f0 Mon Sep 17 00:00:00 2001 From: Gennadiy Civil Date: Thu, 22 Mar 2018 15:35:37 -0400 Subject: merging, gmock -1 --- googlemock/test/gmock_output_test_.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'googlemock/test/gmock_output_test_.cc') diff --git a/googlemock/test/gmock_output_test_.cc b/googlemock/test/gmock_output_test_.cc index 44cba342..d80e2b08 100644 --- a/googlemock/test/gmock_output_test_.cc +++ b/googlemock/test/gmock_output_test_.cc @@ -47,6 +47,7 @@ using testing::NaggyMock; using testing::Ref; using testing::Return; using testing::Sequence; +using testing::Value; class MockFoo { public: @@ -268,6 +269,10 @@ TEST_F(GMockOutputTest, CatchesLeakedMocks) { // Both foo1 and foo2 are deliberately leaked. } +MATCHER_P2(IsPair, first, second, "") { + return Value(arg.first, first) && Value(arg.second, second); +} + void TestCatchesLeakedMocksInAdHocTests() { MockFoo* foo = new MockFoo; @@ -280,7 +285,6 @@ void TestCatchesLeakedMocksInAdHocTests() { int main(int argc, char **argv) { testing::InitGoogleMock(&argc, argv); - // Ensures that the tests pass no matter what value of // --gmock_catch_leaked_mocks and --gmock_verbose the user specifies. testing::GMOCK_FLAG(catch_leaked_mocks) = true; -- cgit v1.2.3 From fe402c27790ff1cc9a7e17c5d0aea4ebe7fd8a71 Mon Sep 17 00:00:00 2001 From: Gennadiy Civil Date: Thu, 5 Apr 2018 16:09:17 -0400 Subject: Merging gMock, 2 --- googlemock/test/gmock_output_test_.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'googlemock/test/gmock_output_test_.cc') diff --git a/googlemock/test/gmock_output_test_.cc b/googlemock/test/gmock_output_test_.cc index d80e2b08..ca628df6 100644 --- a/googlemock/test/gmock_output_test_.cc +++ b/googlemock/test/gmock_output_test_.cc @@ -273,6 +273,11 @@ MATCHER_P2(IsPair, first, second, "") { return Value(arg.first, first) && Value(arg.second, second); } +TEST_F(GMockOutputTest, PrintsMatcher) { + const testing::Matcher m1 = Ge(48); + EXPECT_THAT((std::pair(42, true)), IsPair(m1, true)); +} + void TestCatchesLeakedMocksInAdHocTests() { MockFoo* foo = new MockFoo; -- cgit v1.2.3 From 5fe8de5ded685541a63b0ac22b1cfb4c59406dfd Mon Sep 17 00:00:00 2001 From: Gennadiy Civil Date: Fri, 6 Apr 2018 11:40:04 -0400 Subject: more warnings --- googlemock/test/gmock_output_test_.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'googlemock/test/gmock_output_test_.cc') diff --git a/googlemock/test/gmock_output_test_.cc b/googlemock/test/gmock_output_test_.cc index ca628df6..d5f909d9 100644 --- a/googlemock/test/gmock_output_test_.cc +++ b/googlemock/test/gmock_output_test_.cc @@ -39,6 +39,14 @@ #include "gtest/gtest.h" + +// Silence C4100 (unreferenced formal parameter) for MSVC +#ifdef _MSC_VER +# pragma warning(push) +# pragma warning(disable:4100) +#endif + + using testing::_; using testing::AnyNumber; using testing::Ge; @@ -298,3 +306,7 @@ int main(int argc, char **argv) { TestCatchesLeakedMocksInAdHocTests(); return RUN_ALL_TESTS(); } + +#ifdef _MSC_VER +# pragma warning(pop) +#endif -- cgit v1.2.3 From 055f32199a81a159eebeaabb6666d6de11127064 Mon Sep 17 00:00:00 2001 From: Gennadiy Civil Date: Mon, 9 Apr 2018 15:38:38 -0400 Subject: tuning --- googlemock/test/gmock_output_test_.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'googlemock/test/gmock_output_test_.cc') diff --git a/googlemock/test/gmock_output_test_.cc b/googlemock/test/gmock_output_test_.cc index d5f909d9..4166c6c6 100644 --- a/googlemock/test/gmock_output_test_.cc +++ b/googlemock/test/gmock_output_test_.cc @@ -42,8 +42,10 @@ // Silence C4100 (unreferenced formal parameter) for MSVC #ifdef _MSC_VER -# pragma warning(push) -# pragma warning(disable:4100) +# if _MSC_VER <= 1900 +# pragma warning(push) +# pragma warning(disable:4100) +# endif #endif @@ -308,5 +310,7 @@ int main(int argc, char **argv) { } #ifdef _MSC_VER -# pragma warning(pop) +# if _MSC_VER <= 1900 +# pragma warning(pop) +# endif #endif -- cgit v1.2.3 From 2de24fbf7a26e679e8dc7d185addd3dc820f347c Mon Sep 17 00:00:00 2001 From: Gennadiy Civil Date: Mon, 9 Apr 2018 15:39:12 -0400 Subject: tuning --- googlemock/test/gmock_output_test_.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'googlemock/test/gmock_output_test_.cc') diff --git a/googlemock/test/gmock_output_test_.cc b/googlemock/test/gmock_output_test_.cc index 4166c6c6..56a00b21 100644 --- a/googlemock/test/gmock_output_test_.cc +++ b/googlemock/test/gmock_output_test_.cc @@ -40,7 +40,7 @@ #include "gtest/gtest.h" -// Silence C4100 (unreferenced formal parameter) for MSVC +// Silence C4100 (unreferenced formal parameter) for MSVC 14 and 15 #ifdef _MSC_VER # if _MSC_VER <= 1900 # pragma warning(push) -- cgit v1.2.3 From 05b5a53898c2466e49f37e84324644949d279b34 Mon Sep 17 00:00:00 2001 From: Gennadiy Civil Date: Mon, 9 Apr 2018 15:50:19 -0400 Subject: formatting --- googlemock/test/gmock_output_test_.cc | 2 -- 1 file changed, 2 deletions(-) (limited to 'googlemock/test/gmock_output_test_.cc') diff --git a/googlemock/test/gmock_output_test_.cc b/googlemock/test/gmock_output_test_.cc index 56a00b21..a01b95e5 100644 --- a/googlemock/test/gmock_output_test_.cc +++ b/googlemock/test/gmock_output_test_.cc @@ -39,7 +39,6 @@ #include "gtest/gtest.h" - // Silence C4100 (unreferenced formal parameter) for MSVC 14 and 15 #ifdef _MSC_VER # if _MSC_VER <= 1900 @@ -48,7 +47,6 @@ # endif #endif - using testing::_; using testing::AnyNumber; using testing::Ge; -- cgit v1.2.3 From 64d24b810f37681680a84d615f2601ac73dea78a Mon Sep 17 00:00:00 2001 From: Gennadiy Civil Date: Mon, 9 Apr 2018 16:24:30 -0400 Subject: ... and this --- googlemock/test/gmock_output_test_.cc | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'googlemock/test/gmock_output_test_.cc') diff --git a/googlemock/test/gmock_output_test_.cc b/googlemock/test/gmock_output_test_.cc index a01b95e5..1b59eb3f 100644 --- a/googlemock/test/gmock_output_test_.cc +++ b/googlemock/test/gmock_output_test_.cc @@ -39,12 +39,10 @@ #include "gtest/gtest.h" -// Silence C4100 (unreferenced formal parameter) for MSVC 14 and 15 +// Silence C4100 (unreferenced formal parameter) #ifdef _MSC_VER -# if _MSC_VER <= 1900 -# pragma warning(push) -# pragma warning(disable:4100) -# endif +# pragma warning(push) +# pragma warning(disable:4100) #endif using testing::_; @@ -308,7 +306,5 @@ int main(int argc, char **argv) { } #ifdef _MSC_VER -# if _MSC_VER <= 1900 -# pragma warning(pop) -# endif +# pragma warning(pop) #endif -- cgit v1.2.3 From ca54b673034f6f182ff22ac554efcd1176f5808c Mon Sep 17 00:00:00 2001 From: Gennadiy Civil Date: Mon, 9 Apr 2018 22:10:12 -0400 Subject: Revert "gmock actions 2" --- googlemock/test/gmock_output_test_.cc | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'googlemock/test/gmock_output_test_.cc') diff --git a/googlemock/test/gmock_output_test_.cc b/googlemock/test/gmock_output_test_.cc index 1b59eb3f..ca628df6 100644 --- a/googlemock/test/gmock_output_test_.cc +++ b/googlemock/test/gmock_output_test_.cc @@ -39,12 +39,6 @@ #include "gtest/gtest.h" -// Silence C4100 (unreferenced formal parameter) -#ifdef _MSC_VER -# pragma warning(push) -# pragma warning(disable:4100) -#endif - using testing::_; using testing::AnyNumber; using testing::Ge; @@ -304,7 +298,3 @@ int main(int argc, char **argv) { TestCatchesLeakedMocksInAdHocTests(); return RUN_ALL_TESTS(); } - -#ifdef _MSC_VER -# pragma warning(pop) -#endif -- cgit v1.2.3 From e1071eb9497304a38e69737e90a88b4877b8b736 Mon Sep 17 00:00:00 2001 From: Gennadiy Civil Date: Tue, 10 Apr 2018 15:57:16 -0400 Subject: RE-Doing the merge, this time with gcc on mac in the PR so I can catch errors before merging the PR --- googlemock/test/gmock_output_test_.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'googlemock/test/gmock_output_test_.cc') diff --git a/googlemock/test/gmock_output_test_.cc b/googlemock/test/gmock_output_test_.cc index d5f909d9..1b59eb3f 100644 --- a/googlemock/test/gmock_output_test_.cc +++ b/googlemock/test/gmock_output_test_.cc @@ -39,14 +39,12 @@ #include "gtest/gtest.h" - -// Silence C4100 (unreferenced formal parameter) for MSVC +// Silence C4100 (unreferenced formal parameter) #ifdef _MSC_VER # pragma warning(push) # pragma warning(disable:4100) #endif - using testing::_; using testing::AnyNumber; using testing::Ge; -- cgit v1.2.3 From 9bc82ce7251b01ac3abfb28efc9793b56fa835d6 Mon Sep 17 00:00:00 2001 From: Gennadiy Civil Date: Tue, 10 Apr 2018 16:22:50 -0400 Subject: merging --- googlemock/test/gmock_output_test_.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'googlemock/test/gmock_output_test_.cc') diff --git a/googlemock/test/gmock_output_test_.cc b/googlemock/test/gmock_output_test_.cc index 59ea51bd..1b59eb3f 100644 --- a/googlemock/test/gmock_output_test_.cc +++ b/googlemock/test/gmock_output_test_.cc @@ -39,14 +39,12 @@ #include "gtest/gtest.h" - -// Silence C4100 (unreferenced formal parameter) for MSVC +// Silence C4100 (unreferenced formal parameter) #ifdef _MSC_VER # pragma warning(push) # pragma warning(disable:4100) #endif - using testing::_; using testing::AnyNumber; using testing::Ge; @@ -306,3 +304,7 @@ int main(int argc, char **argv) { TestCatchesLeakedMocksInAdHocTests(); return RUN_ALL_TESTS(); } + +#ifdef _MSC_VER +# pragma warning(pop) +#endif -- cgit v1.2.3 From a3c0dd0f4d58e6c01a1432fdc69a9aff937309a9 Mon Sep 17 00:00:00 2001 From: Gennadiy Civil Date: Tue, 14 Aug 2018 14:04:07 -0400 Subject: Comments changes, no functionality changes --- googlemock/test/gmock_output_test_.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'googlemock/test/gmock_output_test_.cc') diff --git a/googlemock/test/gmock_output_test_.cc b/googlemock/test/gmock_output_test_.cc index 1b59eb3f..3955c733 100644 --- a/googlemock/test/gmock_output_test_.cc +++ b/googlemock/test/gmock_output_test_.cc @@ -26,8 +26,7 @@ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Author: wan@google.com (Zhanyong Wan) + // Tests Google Mock's output in various scenarios. This ensures that // Google Mock's messages are readable and useful. -- cgit v1.2.3