Problem: test_bind used with explicit endpoint where bind_loopback_ipv4 could be used

Solution: use bind_loopback_ipv4 instead
This commit is contained in:
Simon Giesecke 2019-03-24 12:35:19 -04:00
parent 454c0b834a
commit 2b80dd7add
2 changed files with 4 additions and 9 deletions

View File

@ -87,8 +87,7 @@ void test_app_meta_reqrep ()
TEST_ASSERT_EQUAL_INT (-1, rc);
}
test_bind (rep_sock, "tcp://127.0.0.1:*", connect_address,
sizeof (connect_address));
bind_loopback_ipv4 (rep_sock, connect_address, sizeof connect_address);
l = 0;
rc = zmq_setsockopt (req_sock, ZMQ_LINGER, &l, sizeof (l));

View File

@ -159,8 +159,7 @@ void test_router_notify_helper (int opt_notify)
TEST_ASSERT_SUCCESS_ERRNO (zmq_setsockopt (
router, ZMQ_ROUTER_NOTIFY, &opt_notify, sizeof (opt_notify)));
test_bind (router, "tcp://127.0.0.1:*", connect_address,
sizeof (connect_address));
bind_loopback_ipv4 (router, connect_address, sizeof connect_address);
void *dealer = test_context_socket (ZMQ_DEALER);
const char *dealer_routing_id = "X";
@ -246,8 +245,7 @@ void test_handshake_fail ()
TEST_ASSERT_SUCCESS_ERRNO (zmq_setsockopt (
router, ZMQ_RCVTIMEO, &opt_timeout, sizeof (opt_timeout)));
test_bind (router, "tcp://127.0.0.1:*", connect_address,
sizeof (connect_address));
bind_loopback_ipv4 (router, connect_address, sizeof connect_address);
// send something on raw tcp
void *stream = test_context_socket (ZMQ_STREAM);
@ -291,9 +289,7 @@ void test_error_during_multipart ()
TEST_ASSERT_SUCCESS_ERRNO (zmq_setsockopt (
router, ZMQ_MAXMSGSIZE, &opt_maxmsgsize, sizeof (opt_maxmsgsize)));
test_bind (router, "tcp://127.0.0.1:*", connect_address,
sizeof (connect_address));
bind_loopback_ipv4 (router, connect_address, sizeof connect_address);
// setup dealer
void *dealer = test_context_socket (ZMQ_DEALER);