Problem: use of extra context

Solution: use test context instead
This commit is contained in:
Simon Giesecke 2019-03-22 06:52:54 -04:00
parent 924d47f818
commit f083e60d8c

View File

@ -191,12 +191,8 @@ int test_inproc_connect_and_close_first (int send_hwm_, int recv_hwm_)
int test_inproc_bind_and_close_first (int send_hwm_, int /* recv_hwm */)
{
void *ctx = zmq_ctx_new ();
TEST_ASSERT_NOT_NULL (ctx);
// Set up bind socket
void *bind_socket = zmq_socket (ctx, ZMQ_PUSH);
TEST_ASSERT_NOT_NULL (bind_socket);
void *bind_socket = test_context_socket (ZMQ_PUSH);
TEST_ASSERT_SUCCESS_ERRNO (
zmq_setsockopt (bind_socket, ZMQ_SNDHWM, &send_hwm_, sizeof (send_hwm_)));
TEST_ASSERT_SUCCESS_ERRNO (zmq_bind (bind_socket, "inproc://a"));
@ -208,12 +204,11 @@ int test_inproc_bind_and_close_first (int send_hwm_, int /* recv_hwm */)
++send_count;
// Close bind
TEST_ASSERT_SUCCESS_ERRNO (zmq_close (bind_socket));
test_context_socket_close (bind_socket);
/* TODO Can't currently do connect without then wiring up a bind as things hang, this needs top be fixed.
// Set up connect socket
void *connect_socket = zmq_socket (ctx, ZMQ_PULL);
TEST_ASSERT_NOT_NULL(connect_socket);
void *connect_socket = test_context_socket (ZMQ_PULL);
TEST_ASSERT_SUCCESS_ERRNO (zmq_setsockopt (connect_socket, ZMQ_RCVHWM, &recv_hwm, sizeof (recv_hwm)));
TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (connect_socket, "inproc://a"));
@ -226,9 +221,7 @@ int test_inproc_bind_and_close_first (int send_hwm_, int /* recv_hwm */)
*/
// Clean up
//TEST_ASSERT_SUCCESS_ERRNO (zmq_close (connect_socket));
TEST_ASSERT_SUCCESS_ERRNO (zmq_ctx_term (ctx));
//test_context_socket_close (connect_socket);
return send_count;
}