mirror of
https://github.com/zeromq/cppzmq.git
synced 2024-12-13 10:52:57 +01:00
Unit tests for message_t::get()
Testing ZMQ_SHARED property only, since other properties (ZMQ_MORE and ZMQ_SRCFD) depend on socket operations.
This commit is contained in:
parent
7d59f129c8
commit
a91522f65e
@ -137,3 +137,20 @@ TEST_CASE("message group persists", "[message]")
|
|||||||
CHECK(std::string(msg.group()) == "mygroup");
|
CHECK(std::string(msg.group()) == "mygroup");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(3, 2, 0)
|
||||||
|
TEST_CASE("message is not shared", "[message]")
|
||||||
|
{
|
||||||
|
zmq::message_t msg;
|
||||||
|
CHECK(msg.get(ZMQ_SHARED) == 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_CASE("message is shared", "[message]")
|
||||||
|
{
|
||||||
|
size_t msg_sz = 1024; // large enough to be a type_lmsg
|
||||||
|
zmq::message_t msg1(msg_sz);
|
||||||
|
zmq::message_t msg2;
|
||||||
|
msg2.copy(&msg1);
|
||||||
|
CHECK(msg2.get(ZMQ_SHARED) == 1);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user