From 5b4f0521c1cafed640c56eaee6a2612641a07e01 Mon Sep 17 00:00:00 2001 From: Will Hoy <2185386+willhoy@users.noreply.github.com> Date: Tue, 8 Aug 2023 18:07:33 +0100 Subject: [PATCH] gtestupgrade fixes: 1) removed gtest hdr which does not exist 2) defined operator << for the type validated in EXPECT_THAT macro. (#104) Co-authored-by: BHARAT MATHE --- tests/amqpprox_dnsresolver.t.cpp | 1 - tests/amqpprox_session.t.cpp | 10 ++++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/amqpprox_dnsresolver.t.cpp b/tests/amqpprox_dnsresolver.t.cpp index f5f9b30..1767aa5 100644 --- a/tests/amqpprox_dnsresolver.t.cpp +++ b/tests/amqpprox_dnsresolver.t.cpp @@ -17,7 +17,6 @@ #include #include -#include #include #include #include diff --git a/tests/amqpprox_session.t.cpp b/tests/amqpprox_session.t.cpp index 1213cff..e215ca5 100644 --- a/tests/amqpprox_session.t.cpp +++ b/tests/amqpprox_session.t.cpp @@ -89,6 +89,16 @@ using ConnectComplete = TestSocketState::ConnectComplete; const char LOCAL_HOSTNAME[] = "amqpprox-host"; +// To fix compilation error (gtest ver >=1.12.1) in EXPECT_THAT macro when +// validating TestSocketState::Item. Since TestSocketState::Item is a variant, +// googletest requires operator<< / PrintTo to be defined for every member of +// the variant. +void PrintTo(const TestSocketState::Func &, std::ostream *stream) +{ + *stream << "invoked PrintTo for object of type 'const " + "TestSocketState::Func'\n"; +} + struct SelectorMock : public ConnectionSelectorInterface { virtual ~SelectorMock() {}