diff --git a/tests/test_pair_ipc.cpp b/tests/test_pair_ipc.cpp index 87c347e9..12022f77 100644 --- a/tests/test_pair_ipc.cpp +++ b/tests/test_pair_ipc.cpp @@ -37,12 +37,12 @@ int main (void) void *sb = zmq_socket (ctx, ZMQ_PAIR); assert (sb); - int rc = zmq_bind (sb, "ipc:///tmp/tester"); + int rc = zmq_bind (sb, "ipc:///tmp/test_pair_ipc"); assert (rc == 0); void *sc = zmq_socket (ctx, ZMQ_PAIR); assert (sc); - rc = zmq_connect (sc, "ipc:///tmp/tester"); + rc = zmq_connect (sc, "ipc:///tmp/test_pair_ipc"); assert (rc == 0); bounce (sb, sc); diff --git a/tests/test_reqrep_ipc.cpp b/tests/test_reqrep_ipc.cpp index 38d3822f..394a4fda 100644 --- a/tests/test_reqrep_ipc.cpp +++ b/tests/test_reqrep_ipc.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file + Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. @@ -32,17 +32,21 @@ int main (void) { setup_test_environment(); + char my_endpoint[256]; void *ctx = zmq_ctx_new (); assert (ctx); void *sb = zmq_socket (ctx, ZMQ_REP); assert (sb); - int rc = zmq_bind (sb, "ipc:///tmp/tester"); + int rc = zmq_bind (sb, "ipc://*"); + assert (rc == 0); + size_t len = sizeof(my_endpoint); + rc = zmq_getsockopt (sb, ZMQ_LAST_ENDPOINT, my_endpoint, &len); assert (rc == 0); void *sc = zmq_socket (ctx, ZMQ_REQ); assert (sc); - rc = zmq_connect (sc, "ipc:///tmp/tester"); + rc = zmq_connect (sc, my_endpoint); assert (rc == 0); bounce (sb, sc); diff --git a/tests/test_use_fd_ipc.cpp b/tests/test_use_fd_ipc.cpp index f79ab79c..f1d8528a 100644 --- a/tests/test_use_fd_ipc.cpp +++ b/tests/test_use_fd_ipc.cpp @@ -64,14 +64,14 @@ void test_req_rep () void *sb = zmq_socket (ctx, ZMQ_REP); assert (sb); - pre_allocate_sock(sb, "/tmp/tester"); + pre_allocate_sock(sb, "/tmp/test_use_fd_ipc"); - int rc = zmq_bind (sb, "ipc:///tmp/tester"); + int rc = zmq_bind (sb, "ipc:///tmp/test_use_fd_ipc"); assert (rc == 0); void *sc = zmq_socket (ctx, ZMQ_REQ); assert (sc); - rc = zmq_connect (sc, "ipc:///tmp/tester"); + rc = zmq_connect (sc, "ipc:///tmp/test_use_fd_ipc"); assert (rc == 0); bounce (sb, sc); @@ -85,7 +85,7 @@ void test_req_rep () rc = zmq_ctx_term (ctx); assert (rc == 0); - rc = unlink ("/tmp/tester"); + rc = unlink ("/tmp/test_use_fd_ipc"); assert (rc == 0); } @@ -97,14 +97,14 @@ void test_pair () void *sb = zmq_socket (ctx, ZMQ_PAIR); assert (sb); - pre_allocate_sock(sb, "/tmp/tester"); + pre_allocate_sock(sb, "/tmp/test_use_fd_ipc"); - int rc = zmq_bind (sb, "ipc:///tmp/tester"); + int rc = zmq_bind (sb, "ipc:///tmp/test_use_fd_ipc"); assert (rc == 0); void *sc = zmq_socket (ctx, ZMQ_PAIR); assert (sc); - rc = zmq_connect (sc, "ipc:///tmp/tester"); + rc = zmq_connect (sc, "ipc:///tmp/test_use_fd_ipc"); assert (rc == 0); bounce (sb, sc); @@ -118,7 +118,7 @@ void test_pair () rc = zmq_ctx_term (ctx); assert (rc == 0); - rc = unlink ("/tmp/tester"); + rc = unlink ("/tmp/test_use_fd_ipc"); assert (rc == 0); } @@ -131,14 +131,14 @@ void test_client_server () void *sb = zmq_socket (ctx, ZMQ_SERVER); assert (sb); - pre_allocate_sock(sb, "/tmp/tester"); + pre_allocate_sock(sb, "/tmp/test_use_fd_ipc"); - int rc = zmq_bind (sb, "ipc:///tmp/tester"); + int rc = zmq_bind (sb, "ipc:///tmp/test_use_fd_ipc"); assert (rc == 0); void *sc = zmq_socket (ctx, ZMQ_CLIENT); assert (sc); - rc = zmq_connect (sc, "ipc:///tmp/tester"); + rc = zmq_connect (sc, "ipc:///tmp/test_use_fd_ipc"); assert (rc == 0); zmq_msg_t msg; @@ -199,7 +199,7 @@ void test_client_server () rc = zmq_ctx_term (ctx); assert (rc == 0); - rc = unlink ("/tmp/tester"); + rc = unlink ("/tmp/test_use_fd_ipc"); assert (rc == 0); #endif }