From 92923cd40b645af844c5ed1055a0a45c6daa3c89 Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Sat, 28 Aug 2010 08:44:12 +0200 Subject: bug in pipe deactivation fixed --- tests/test_pair.cpp | 7 ++++--- tests/test_reqrep.cpp | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/test_pair.cpp b/tests/test_pair.cpp index 381874f..c10e0a6 100644 --- a/tests/test_pair.cpp +++ b/tests/test_pair.cpp @@ -39,9 +39,10 @@ int main () { const string returned = zmqtestutil::ping_pong (p, expect); assert (expect == returned); + // Adjust socket state so that poll shows only 1 pending message. zmq::message_t mx ; - p.first->recv(&mx, 0); + p.first->recv (&mx, 0); } { @@ -58,8 +59,7 @@ int main () p.first->send (m1, 0); - // Now use polling. Timout makes test abort on error. - int rc = zmq::poll (&items [0], 2, 1000); + int rc = zmq::poll (&items [0], 2, -1); assert (rc == 1); assert ((items [1].revents & ZMQ_POLLIN) != 0); @@ -74,4 +74,5 @@ int main () delete (p.second); return 0 ; +assert (false); } diff --git a/tests/test_reqrep.cpp b/tests/test_reqrep.cpp index f33b4b5..eab7e8b 100644 --- a/tests/test_reqrep.cpp +++ b/tests/test_reqrep.cpp @@ -39,6 +39,7 @@ int main() { const string returned = zmqtestutil::ping_pong (p, expect); assert (expect == returned); + // Adjust socket state, so that first is clean for another send. zmq::message_t mx ; p.first->recv(&mx, 0); @@ -58,8 +59,7 @@ int main() p.first->send (m1, 0); - // Now use polling. Timout makes test abort on error. - int rc = zmq::poll(&items [0], 2, 1000); + int rc = zmq::poll(&items [0], 2, -1); assert (rc == 1); assert ((items [1].revents & ZMQ_POLLIN) != 0); -- cgit v1.2.3