mirror of
https://github.com/zeromq/libzmq.git
synced 2025-01-19 00:46:05 +01:00
Problem: use of extra context
Solution: use test context instead
This commit is contained in:
parent
924d47f818
commit
f083e60d8c
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user