diff options
author | Martin Sustrik <sustrik@250bpm.com> | 2012-03-22 12:45:20 +0100 |
---|---|---|
committer | Martin Sustrik <sustrik@250bpm.com> | 2012-03-23 08:06:27 +0100 |
commit | 84997053d4d170de80a2ac1ed5a742b75f5064ee (patch) | |
tree | 16614fb53bbaa362219bf62a50e62883fe79ad30 /tests/polltimeo.cpp | |
parent | 836ecfaf92c894eb36f8c41c8201607b68ef4185 (diff) |
Ignore distorted timeouts on Windows in debug mode
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Diffstat (limited to 'tests/polltimeo.cpp')
-rw-r--r-- | tests/polltimeo.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/polltimeo.cpp b/tests/polltimeo.cpp index 087d125..73d7f53 100644 --- a/tests/polltimeo.cpp +++ b/tests/polltimeo.cpp @@ -57,8 +57,10 @@ int XS_TEST_MAIN () void *watch = xs_stopwatch_start (); rc = xs_poll (&pi, 1, 500); assert (rc == 0); - unsigned long elapsed = xs_stopwatch_stop (watch); - assert (elapsed > 440000 && elapsed < 550000); + unsigned long elapsed = xs_stopwatch_stop (watch) / 1000; +#if !defined _WIN32 || !defined _DEBUG + assert (elapsed > 440 && elapsed < 550); +#endif // Check whether connection during the wait doesn't distort the timeout. void *thread = thread_create (polltimeo_worker, ctx); @@ -66,8 +68,10 @@ int XS_TEST_MAIN () watch = xs_stopwatch_start (); rc = xs_poll (&pi, 1, 2000); assert (rc == 0); - elapsed = xs_stopwatch_stop (watch); - assert (elapsed > 1900000 && elapsed < 2100000); + elapsed = xs_stopwatch_stop (watch) / 1000; +#if !defined _WIN32 || !defined _DEBUG + assert (elapsed > 1900 && elapsed < 2100); +#endif thread_join (thread); // Clean-up. |