Skip to content

Commit

Permalink
test,unix: fix logic error in test runner
Browse files Browse the repository at this point in the history
Fix the logic that guards against the system clock jumping back in time.

Fixes: #667
PR-URL: #670
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
  • Loading branch information
bnoordhuis committed Jan 4, 2016
1 parent a0057d9 commit bcecc3d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/runner-unix.c
Expand Up @@ -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 =
Expand Down

0 comments on commit bcecc3d

Please sign in to comment.