diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2018-11-13 11:15:44 +0100 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2018-11-14 14:40:08 +0000 |
commit | cd201b2c2c2849fea0c5a38ffd979cd9d5b24997 (patch) | |
tree | b8084db8c1cdbcb00ad0db437d50c0f9b412a29e /src/testlib | |
parent | 15b1c3fd9b82c8a29148c73be7aa4e8b2e07add1 (diff) |
Adjust QTRY_IMPL()'s default timestep
It was previously using 50ms steps, which was a bad choice for client
code whose total time-out was comparable to 50ms or less. Reduce the
time-step so that we loop several times within the timeout (but make
sure it's never zero, by adding 1ms).
Change-Id: I0428a7741c0741dfb312e40ae1eda900050195ab
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
Diffstat (limited to 'src/testlib')
-rw-r--r-- | src/testlib/qtestcase.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/testlib/qtestcase.h b/src/testlib/qtestcase.h index 54669c11de..fbc251a2a2 100644 --- a/src/testlib/qtestcase.h +++ b/src/testlib/qtestcase.h @@ -150,7 +150,7 @@ do {\ // Ideally we'd use qWaitFor instead of QTRY_LOOP_IMPL, but due // to a compiler bug on MSVC < 2017 we can't (see QTBUG-59096) #define QTRY_IMPL(expr, timeout)\ - const int qt_test_step = 50; \ + const int qt_test_step = timeout < 350 ? timeout / 7 + 1 : 50; \ const int qt_test_timeoutValue = timeout; \ QTRY_LOOP_IMPL((expr), qt_test_timeoutValue, qt_test_step); \ QTRY_TIMEOUT_DEBUG_IMPL((expr), qt_test_timeoutValue, qt_test_step)\ |