diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2024-02-09 11:05:49 +0100 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2024-02-09 15:11:50 +0100 |
commit | a8da9829dc26c51b93156b1cdcce7034bb48283f (patch) | |
tree | d8d34e34928bd11a44a38b1a85796194fefaf365 | |
parent | 28ecb523ce8490bff38b251b3df703c72e057519 (diff) |
QTest: rename local `timeout` variable in QTRY_IMPL macro
`timeout` is a likely name for a variable in the scope in which a
QTRY_ macro is used, so don't use that name in the macro itself. The
other variables are all prefixed with `qt_test_`, so do that here as
well, and be explicit about what the variable stores.
Amends d4bb448cddce63e0c6a84a86020fa59dd32b2293.
Task-number: QTBUG-121746
Change-Id: If05dccdc24a66e95a08156b820d185f184783ad6
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
-rw-r--r-- | src/testlib/qtestcase.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/testlib/qtestcase.h b/src/testlib/qtestcase.h index 7724e0504b..edb220f6d0 100644 --- a/src/testlib/qtestcase.h +++ b/src/testlib/qtestcase.h @@ -199,13 +199,13 @@ inline void useVerifyThrowsException() {} } #define QTRY_IMPL(expr, timeoutAsGiven)\ - const auto timeout = [&] { \ + const auto qt_test_timeoutAsMs = [&] { \ /* make 5s work w/o user action: */ \ using namespace std::chrono_literals; \ return std::chrono::milliseconds{timeoutAsGiven}; \ }(); \ - const int qt_test_step = timeout.count() < 350 ? timeout.count() / 7 + 1 : 50; \ - const int qt_test_timeoutValue = timeout.count(); \ + const int qt_test_step = qt_test_timeoutAsMs.count() < 350 ? qt_test_timeoutAsMs.count() / 7 + 1 : 50; \ + const int qt_test_timeoutValue = qt_test_timeoutAsMs.count(); \ { QTRY_LOOP_IMPL(expr, qt_test_timeoutValue, qt_test_step) } \ QTRY_TIMEOUT_DEBUG_IMPL(expr, qt_test_timeoutValue, qt_test_step) // Ends with an if-block, so doesn't want a following semicolon. |