diff --git a/tests/test_ipc_wildcard.cpp b/tests/test_ipc_wildcard.cpp index ff369615..2f0ae176 100644 --- a/tests/test_ipc_wildcard.cpp +++ b/tests/test_ipc_wildcard.cpp @@ -35,12 +35,8 @@ SETUP_TEARDOWN_TESTCONTEXT void test_ipc_wildcard () { void *sb = test_context_socket (ZMQ_PAIR); - TEST_ASSERT_SUCCESS_ERRNO (zmq_bind (sb, "ipc://*")); - char endpoint[200]; - size_t size = sizeof (endpoint); - TEST_ASSERT_SUCCESS_ERRNO ( - zmq_getsockopt (sb, ZMQ_LAST_ENDPOINT, endpoint, &size)); + bind_loopback_ipc (sb, endpoint, sizeof endpoint); void *sc = test_context_socket (ZMQ_PAIR); TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (sc, endpoint)); diff --git a/tests/test_pair_ipc.cpp b/tests/test_pair_ipc.cpp index 28bb20be..81cad180 100644 --- a/tests/test_pair_ipc.cpp +++ b/tests/test_pair_ipc.cpp @@ -35,12 +35,9 @@ SETUP_TEARDOWN_TESTCONTEXT void test_roundtrip () { char my_endpoint[256]; - size_t len = sizeof (my_endpoint); void *sb = test_context_socket (ZMQ_PAIR); - TEST_ASSERT_SUCCESS_ERRNO (zmq_bind (sb, "ipc://*")); - TEST_ASSERT_SUCCESS_ERRNO ( - zmq_getsockopt (sb, ZMQ_LAST_ENDPOINT, my_endpoint, &len)); + bind_loopback_ipc (sb, my_endpoint, sizeof my_endpoint); void *sc = test_context_socket (ZMQ_PAIR); TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (sc, my_endpoint)); diff --git a/tests/test_reqrep_ipc.cpp b/tests/test_reqrep_ipc.cpp index 090c5c56..90b99039 100644 --- a/tests/test_reqrep_ipc.cpp +++ b/tests/test_reqrep_ipc.cpp @@ -39,10 +39,7 @@ void test_leak () char my_endpoint[256]; void *sb = test_context_socket (ZMQ_REP); - TEST_ASSERT_SUCCESS_ERRNO (zmq_bind (sb, "ipc://*")); - size_t len = sizeof (my_endpoint); - TEST_ASSERT_SUCCESS_ERRNO ( - zmq_getsockopt (sb, ZMQ_LAST_ENDPOINT, my_endpoint, &len)); + bind_loopback_ipc (sb, my_endpoint, sizeof my_endpoint); void *sc = test_context_socket (ZMQ_REQ); TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (sc, my_endpoint)); @@ -67,10 +64,7 @@ void test_simple (void) char my_endpoint[256]; void *sb = test_context_socket (ZMQ_REP); - TEST_ASSERT_SUCCESS_ERRNO (zmq_bind (sb, "ipc://*")); - size_t len = sizeof (my_endpoint); - TEST_ASSERT_SUCCESS_ERRNO ( - zmq_getsockopt (sb, ZMQ_LAST_ENDPOINT, my_endpoint, &len)); + bind_loopback_ipc (sb, my_endpoint, sizeof my_endpoint); void *sc = test_context_socket (ZMQ_REQ); TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (sc, my_endpoint));