mirror of
https://github.com/zeromq/cppzmq.git
synced 2025-01-06 00:31:14 +01:00
Problem: no test case for previously existing send functionality
Solution: added test case
This commit is contained in:
parent
ab09f5da98
commit
120c7ae3f2
@ -14,3 +14,16 @@ TEST(socket, create_by_enum_destroy)
|
|||||||
zmq::socket_t socket(context, zmq::socket_type::router);
|
zmq::socket_t socket(context, zmq::socket_type::router);
|
||||||
}
|
}
|
||||||
#endif
|
#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));
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user