Commit 10becae7 authored by Uli Köhler's avatar Uli Köhler

Added zmq_send_const test

parent e2c322cf
......@@ -36,6 +36,27 @@ int main (void)
assert (rc == 0);
bounce (sb, sc);
// Test zmq_send_const
rc = zmq_send_const (sb, "foo", 3, ZMQ_SNDMORE);
assert (rc == 3);
rc = zmq_send_const (sb, "foobar", 6, 0);
assert (rc == 6);
zmq_msg_t msg;
rc = zmq_msg_init (&msg);
assert (rc == 0);
rc = zmq_msg_recv (&msg, sc, 0);
assert (rc == 3);
assert (zmq_msg_size (&msg) == 3);
void* data = zmq_msg_data (&msg);
assert (memcmp ("foo", data, 3) == 0);
rc = zmq_msg_recv (&msg, sc, 0);
assert (rc == 6);
data = zmq_msg_data (&msg);
assert (memcmp ("foobar", data, 3) == 0);
// Cleanup
rc = zmq_close (sc);
assert (rc == 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment