diff --git a/src/raw_engine.cpp b/src/raw_engine.cpp index 5910cd99..3eac5871 100644 --- a/src/raw_engine.cpp +++ b/src/raw_engine.cpp @@ -124,7 +124,7 @@ void zmq::raw_engine_t::error (error_reason_t reason_) // so that it knows the peer has been disconnected. msg_t terminator; terminator.init (); - (this->*_process_msg) (&terminator); + push_raw_msg_to_session (&terminator); terminator.close (); } stream_engine_base_t::error (reason_); diff --git a/tests/test_pubsub_topics_count.cpp b/tests/test_pubsub_topics_count.cpp index f4fdbcc0..5f6d9ecf 100644 --- a/tests/test_pubsub_topics_count.cpp +++ b/tests/test_pubsub_topics_count.cpp @@ -126,11 +126,11 @@ void test_nested_topic_prefixes () // Subscribe to other 3 (nested) topics TEST_ASSERT_SUCCESS_ERRNO ( - zmq_setsockopt (subscriber, ZMQ_SUBSCRIBE, "xyz", strlen ("a"))); + zmq_setsockopt (subscriber, ZMQ_SUBSCRIBE, "xyz", strlen ("xyz"))); TEST_ASSERT_SUCCESS_ERRNO ( - zmq_setsockopt (subscriber, ZMQ_SUBSCRIBE, "xy", strlen ("ab"))); + zmq_setsockopt (subscriber, ZMQ_SUBSCRIBE, "xy", strlen ("xy"))); TEST_ASSERT_SUCCESS_ERRNO ( - zmq_setsockopt (subscriber, ZMQ_SUBSCRIBE, "x", strlen ("abc"))); + zmq_setsockopt (subscriber, ZMQ_SUBSCRIBE, "x", strlen ("x"))); TEST_ASSERT_EQUAL_INT (get_subscription_count (subscriber), 6); TEST_ASSERT_EQUAL_INT (get_subscription_count (publisher), 6); diff --git a/tests/test_zmq_ppoll_signals.cpp b/tests/test_zmq_ppoll_signals.cpp index 44d90b0b..255734a6 100644 --- a/tests/test_zmq_ppoll_signals.cpp +++ b/tests/test_zmq_ppoll_signals.cpp @@ -73,7 +73,17 @@ void recv_string_expect_success_or_eagain (void *socket_, void test_ppoll_signals () { #ifdef ZMQ_HAVE_PPOLL + size_t len = MAX_SOCKET_STRING; + char my_endpoint[MAX_SOCKET_STRING]; pid_t child_pid; + + /* Get a random TCP port first */ + setup_test_context (); + void *sb = test_context_socket (ZMQ_REP); + bind_loopback (sb, 0, my_endpoint, len); + test_context_socket_close (sb); + teardown_test_context (); + do { child_pid = fork (); } while (child_pid == -1); // retry if fork fails @@ -85,7 +95,7 @@ void test_ppoll_signals () int recv_timeout = 5000; TEST_ASSERT_SUCCESS_ERRNO (zmq_setsockopt ( socket, ZMQ_RCVTIMEO, &recv_timeout, sizeof (recv_timeout))); - TEST_ASSERT_SUCCESS_ERRNO (zmq_bind (socket, "tcp://*:6660")); + TEST_ASSERT_SUCCESS_ERRNO (zmq_bind (socket, my_endpoint)); // bind is on the master process to avoid zombie children to hold on to binds // first send a test message to check whether the signal mask is setup in the child process @@ -102,6 +112,7 @@ void test_ppoll_signals () // finish test_context_socket_close (socket); + teardown_test_context (); // wait for child int status = 0; @@ -139,8 +150,7 @@ void test_ppoll_signals () TEST_ASSERT_SUCCESS_ERRNO (sigaction (SIGTERM, &sa, NULL)); void *socket = test_context_socket (ZMQ_REP); - TEST_ASSERT_SUCCESS_ERRNO ( - zmq_connect (socket, "tcp://127.0.0.1:6660")); + TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (socket, my_endpoint)); zmq_pollitem_t pollitems[] = { {socket, 0, ZMQ_POLLIN, 0}, @@ -167,6 +177,7 @@ void test_ppoll_signals () // wait before closing socket, so that parent has time to receive sleep (1); test_context_socket_close (socket); + teardown_test_context (); _Exit (0); } #else