Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions tests/message.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,20 @@ TEST_CASE("message constructor with char array", "[message]")
CHECK(0 == memcmp(data, hi_msg.data(), 2));
}

#ifndef _WIN32
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
#if defined(ZMQ_CPP11) && !defined(ZMQ_CPP11_PARTIAL)
TEST_CASE("message constructor with container - deprecated", "[message]")
{
zmq::message_t hi_msg("Hi"); // deprecated
REQUIRE(3u == hi_msg.size());
CHECK(0 == memcmp(data, hi_msg.data(), 3));
}
#ifndef _WIN32
#pragma GCC diagnostic pop
#endif

TEST_CASE("message constructor with container of trivial data", "[message]")
{
Expand Down Expand Up @@ -189,11 +196,18 @@ TEST_CASE("message to string", "[message]")
CHECK(b.to_string_view() == "Foo");
#endif

#ifndef _WIN32
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
#if defined(ZMQ_CPP11) && !defined(ZMQ_CPP11_PARTIAL)
const zmq::message_t depr("Foo"); // deprecated
CHECK(depr.to_string() != "Foo");
CHECK(depr.to_string() == std::string("Foo", 4));
#endif
#ifndef _WIN32
#pragma GCC diagnostic pop
#endif
}

TEST_CASE("message to debug string", "[message]")
Expand Down
9 changes: 8 additions & 1 deletion tests/socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ TEST_CASE("socket check integral options", "[socket]")
"router_mandatory", true);
#endif
#ifdef ZMQ_ROUTER_RAW
check_integral_opt<int>(zmq::sockopt::router_raw, router, "router_raw",
check_integral_opt<int>(zmq::sockopt::router_raw, router, "router_raw",
true);
#endif
#ifdef ZMQ_ROUTER_NOTIFY
Expand Down Expand Up @@ -619,9 +619,16 @@ TEST_CASE("socket send recv message_t by pointer", "[socket]")
CHECK(*res_send == 10);
CHECK(smsg.size() == 0);

#ifndef _WIN32
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
zmq::message_t rmsg;
const bool res = s.recv(&rmsg);
CHECK(res);
#ifndef _WIN32
#pragma GCC diagnostic pop
#endif
}

TEST_CASE("socket recv dontwait", "[socket]")
Expand Down