From bcecc3dda3090d3b9fa787d315c9609f6174a7ef Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Mon, 4 Jan 2016 10:56:02 +0100 Subject: [PATCH] test,unix: fix logic error in test runner MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix the logic that guards against the system clock jumping back in time. Fixes: https://github.com/libuv/libuv/issues/667 PR-URL: https://github.com/libuv/libuv/pull/670 Reviewed-By: Saúl Ibarra Corretgé --- test/runner-unix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/runner-unix.c b/test/runner-unix.c index 2264d1e8..2405fa87 100644 --- a/test/runner-unix.c +++ b/test/runner-unix.c @@ -226,7 +226,7 @@ int process_wait(process_info_t* vec, int n, int timeout) { tv = timebase; for (;;) { /* Check that gettimeofday() doesn't jump back in time. */ - assert(tv.tv_sec == timebase.tv_sec || + assert(tv.tv_sec > timebase.tv_sec || (tv.tv_sec == timebase.tv_sec && tv.tv_usec >= timebase.tv_usec)); elapsed_ms =