Skip to content

Commit

Permalink
gtestupgrade fixes: 1) removed gtest hdr which does not exist 2) defi…
Browse files Browse the repository at this point in the history
…ned operator << for the type validated in EXPECT_THAT macro. (#104)

Co-authored-by: BHARAT MATHE <[email protected]>
  • Loading branch information
willhoy and BHARAT MATHE authored Aug 8, 2023
1 parent 7af384b commit 5b4f052
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 0 additions & 1 deletion tests/amqpprox_dnsresolver.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include <amqpprox_dnsresolver.h>

#include <chrono>
#include <gmock/gmock-generated-matchers.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <thread>
Expand Down
10 changes: 10 additions & 0 deletions tests/amqpprox_session.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() {}

Expand Down

0 comments on commit 5b4f052

Please sign in to comment.