mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-29 12:18:04 +01:00
Problem: tests use hard-coded fixed IPC file path
Solution: use wildcards or random directories to avoid races when multiple users are running the same test on the same machine
This commit is contained in:
@@ -44,11 +44,16 @@ void tearDown ()
|
||||
|
||||
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:///tmp/test_pair_ipc"));
|
||||
TEST_ASSERT_SUCCESS_ERRNO (zmq_bind (sb, "ipc://*"));
|
||||
TEST_ASSERT_SUCCESS_ERRNO (
|
||||
zmq_getsockopt (sb, ZMQ_LAST_ENDPOINT, my_endpoint, &len));
|
||||
|
||||
void *sc = test_context_socket (ZMQ_PAIR);
|
||||
TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (sc, "ipc:///tmp/test_pair_ipc"));
|
||||
TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (sc, my_endpoint));
|
||||
|
||||
bounce (sb, sc);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user