Unverified Commit 45681798 authored by Luca Boccassi's avatar Luca Boccassi Committed by GitHub

Merge pull request #3011 from sigiesec/migrate-to-unity

Migrate test_reqrep_tcp to unity
parents 15b3dccf 84a3767d
......@@ -460,7 +460,8 @@ tests_test_reqrep_inproc_LDADD = src/libzmq.la
tests_test_reqrep_tcp_SOURCES = \
tests/test_reqrep_tcp.cpp \
tests/testutil.hpp
tests_test_reqrep_tcp_LDADD = src/libzmq.la
tests_test_reqrep_tcp_LDADD = src/libzmq.la ${UNITY_LIBS}
tests_test_reqrep_tcp_CPPFLAGS = ${UNITY_CPPFLAGS}
tests_test_hwm_SOURCES = tests/test_hwm.cpp tests/testutil_unity.hpp
tests_test_hwm_LDADD = src/libzmq.la ${UNITY_LIBS}
......
This diff is collapsed.
......@@ -192,9 +192,21 @@ void *test_context_socket_close (void *socket)
return socket;
}
void bind_loopback_ipv4 (void *socket, char *my_endpoint, size_t len)
void bind_loopback (void *socket, int ipv6, char *my_endpoint, size_t len)
{
TEST_ASSERT_SUCCESS_ERRNO (zmq_bind (socket, "tcp://127.0.0.1:*"));
if (ipv6 && !is_ipv6_available ()) {
TEST_IGNORE_MESSAGE ("ipv6 is not available");
}
TEST_ASSERT_SUCCESS_ERRNO (
zmq_setsockopt (socket, ZMQ_IPV6, &ipv6, sizeof (int)));
TEST_ASSERT_SUCCESS_ERRNO (
zmq_bind (socket, ipv6 ? "tcp://[::1]:*" : "tcp://127.0.0.1:*"));
TEST_ASSERT_SUCCESS_ERRNO (
zmq_getsockopt (socket, ZMQ_LAST_ENDPOINT, my_endpoint, &len));
}
void bind_loopback_ipv4 (void *socket, char *my_endpoint, size_t len)
{
bind_loopback (socket, false, my_endpoint, len);
}
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