summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2023-02-28 09:58:12 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-03-02 05:21:43 +0000
commit474e2c9208a9cc7398b1882dd73b4034da6d44b6 (patch)
treeb172f4a28b01ec4c853982c6150c844d97037071
parentf77356c6e99a89c2d198b054ad9161b0fb36a52f (diff)
downloadqtbase-474e2c9208a9cc7398b1882dd73b4034da6d44b6.tar.gz
tst_QMutex: use constexpr variables instead of 'enum-trick'
C++20 doesn't like arithmetic with enums anymore. While this hasn't caused immediate pain, yet, fix it pro-actively for an imminent patch. As a drive-by, fix the missing space at start of comment. Change-Id: Id08bb227c587bc7b900c593a7b6d2655ca32eefd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit b8966021ffb2cfddc77aee6dbe145eb74ef22f9d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--tests/auto/corelib/thread/qmutex/tst_qmutex.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/corelib/thread/qmutex/tst_qmutex.cpp b/tests/auto/corelib/thread/qmutex/tst_qmutex.cpp
index c03c0c0969..e4f98608ae 100644
--- a/tests/auto/corelib/thread/qmutex/tst_qmutex.cpp
+++ b/tests/auto/corelib/thread/qmutex/tst_qmutex.cpp
@@ -1038,8 +1038,8 @@ void tst_QMutex::lock_unlock_locked_tryLock()
}
}
-enum { one_minute = 6 * 1000, //not really one minute, but else it is too long.
- threadCount = 10 };
+constexpr int one_minute = 6 * 1000; // not really one minute, but else it is too long.
+constexpr int threadCount = 10;
class StressTestThread : public QThread
{