Problem: no test case for previously existing send functionality

Solution: added test case
This commit is contained in:
Simon Giesecke 2018-08-21 13:36:01 +02:00
parent ab09f5da98
commit 120c7ae3f2

View File

@ -14,3 +14,16 @@ TEST(socket, create_by_enum_destroy)
zmq::socket_t socket(context, zmq::socket_type::router);
}
#endif
TEST(socket, send_receive_const_buffer)
{
zmq::context_t context;
zmq::socket_t sender(context, ZMQ_PAIR);
zmq::socket_t receiver(context, ZMQ_PAIR);
receiver.bind("inproc://test");
sender.connect("inproc://test");
ASSERT_EQ(2, sender.send("Hi", 2));
char buf[2];
ASSERT_EQ(2, receiver.recv(buf, 2));
ASSERT_EQ(0, memcmp(buf, "Hi", 2));
}