From 06329e07437f56260c2c74ba9e272bc6d484cc81 Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Fri, 13 Apr 2012 07:26:54 +0200 Subject: Checking for correct timeout in the test suite improved This patch introduces 1/2 second tolerance for the timeouts in the tests. This will hopefully make tests not fail even on slow or heavily loaded machines. Signed-off-by: Martin Sustrik --- tests/timeo.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'tests/timeo.cpp') diff --git a/tests/timeo.cpp b/tests/timeo.cpp index 92c578b..2281556 100644 --- a/tests/timeo.cpp +++ b/tests/timeo.cpp @@ -66,9 +66,7 @@ int XS_TEST_MAIN () assert (rc == -1); assert (xs_errno () == EAGAIN); unsigned long elapsed = xs_stopwatch_stop (watch) / 1000; -#if !defined _WIN32 || !defined _DEBUG - assert (elapsed > 440 && elapsed < 550); -#endif + time_assert (elapsed, timeout); // Check whether connection during the wait doesn't distort the timeout. timeout = 2000; @@ -81,9 +79,7 @@ int XS_TEST_MAIN () assert (rc == -1); assert (xs_errno () == EAGAIN); elapsed = xs_stopwatch_stop (watch) / 1000; -#if !defined _WIN32 || !defined _DEBUG - assert (elapsed > 1900 && elapsed < 2100); -#endif + time_assert (elapsed, timeout); thread_join (thread); // Check that timeouts don't break normal message transfer. -- cgit v1.2.3