Commit b30cbfc1 authored by Simon Giesecke's avatar Simon Giesecke

Problem: test_spec_dealer not using test framework

Solution: migrate to Unity
parent d81a041f
...@@ -572,7 +572,8 @@ tests_test_spec_rep_SOURCES = tests/test_spec_rep.cpp ...@@ -572,7 +572,8 @@ tests_test_spec_rep_SOURCES = tests/test_spec_rep.cpp
tests_test_spec_rep_LDADD = src/libzmq.la tests_test_spec_rep_LDADD = src/libzmq.la
tests_test_spec_dealer_SOURCES = tests/test_spec_dealer.cpp tests_test_spec_dealer_SOURCES = tests/test_spec_dealer.cpp
tests_test_spec_dealer_LDADD = src/libzmq.la tests_test_spec_dealer_LDADD = src/libzmq.la ${UNITY_LIBS}
tests_test_spec_dealer_CPPFLAGS = ${UNITY_CPPFLAGS}
tests_test_spec_router_SOURCES = tests/test_spec_router.cpp tests_test_spec_router_SOURCES = tests/test_spec_router.cpp
tests_test_spec_router_LDADD = src/libzmq.la tests_test_spec_router_LDADD = src/libzmq.la
......
This diff is collapsed.
...@@ -217,6 +217,24 @@ void *test_context_socket_close (void *socket) ...@@ -217,6 +217,24 @@ void *test_context_socket_close (void *socket)
return socket; return socket;
} }
void *test_context_socket_close_zero_linger (void *socket)
{
const int linger = 0;
int rc = zmq_setsockopt (socket, ZMQ_LINGER, &linger, sizeof (linger));
TEST_ASSERT_TRUE (rc == 0 || zmq_errno () == ETERM);
return test_context_socket_close (socket);
}
void test_bind (void *socket,
const char *bind_address,
char *my_endpoint,
size_t len)
{
TEST_ASSERT_SUCCESS_ERRNO (zmq_bind (socket, bind_address));
TEST_ASSERT_SUCCESS_ERRNO (
zmq_getsockopt (socket, ZMQ_LAST_ENDPOINT, my_endpoint, &len));
}
void bind_loopback (void *socket, int ipv6, char *my_endpoint, size_t len) void bind_loopback (void *socket, int ipv6, char *my_endpoint, size_t len)
{ {
if (ipv6 && !is_ipv6_available ()) { if (ipv6 && !is_ipv6_available ()) {
...@@ -225,10 +243,9 @@ void bind_loopback (void *socket, int ipv6, char *my_endpoint, size_t len) ...@@ -225,10 +243,9 @@ void bind_loopback (void *socket, int ipv6, char *my_endpoint, size_t len)
TEST_ASSERT_SUCCESS_ERRNO ( TEST_ASSERT_SUCCESS_ERRNO (
zmq_setsockopt (socket, ZMQ_IPV6, &ipv6, sizeof (int))); zmq_setsockopt (socket, ZMQ_IPV6, &ipv6, sizeof (int)));
TEST_ASSERT_SUCCESS_ERRNO (
zmq_bind (socket, ipv6 ? "tcp://[::1]:*" : "tcp://127.0.0.1:*")); test_bind (socket, ipv6 ? "tcp://[::1]:*" : "tcp://127.0.0.1:*",
TEST_ASSERT_SUCCESS_ERRNO ( my_endpoint, len);
zmq_getsockopt (socket, ZMQ_LAST_ENDPOINT, my_endpoint, &len));
} }
void bind_loopback_ipv4 (void *socket, char *my_endpoint, size_t len) void bind_loopback_ipv4 (void *socket, char *my_endpoint, size_t 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