0
0
mirror of https://github.com/zeromq/libzmq.git synced 2024-12-27 07:31:03 +08:00

Merge pull request #3897 from bluca/fuzzers

Problem: test_hello_msg binds to hard-coded port and fails when it's in use
This commit is contained in:
Luca Boccassi 2020-05-05 20:36:26 +01:00 committed by GitHub
commit c2ffe2e6d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,16 +36,17 @@ void test (const char *address)
{
// Create a router
void *router = test_context_socket (ZMQ_ROUTER);
char my_endpoint[MAX_SOCKET_STRING];
// set router socket options
TEST_ASSERT_SUCCESS_ERRNO (zmq_setsockopt (router, ZMQ_HELLO_MSG, "H", 1));
// bind router
TEST_ASSERT_SUCCESS_ERRNO (zmq_bind (router, address));
test_bind (router, address, my_endpoint, MAX_SOCKET_STRING);
// Create a dealer
void *dealer = test_context_socket (ZMQ_DEALER);
TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (dealer, address));
TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (dealer, my_endpoint));
// Receive the hello message
recv_string_expect_success (dealer, "H", 0);
@ -57,7 +58,7 @@ void test (const char *address)
void test_tcp ()
{
test ("tcp://127.0.0.1:5569");
test ("tcp://127.0.0.1:*");
}
void test_inproc ()