summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/tools/qatomicscopedvaluerollback/CMakeLists.txt
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-05-30 13:48:52 +0200
committerMarc Mutz <marc.mutz@qt.io>2022-05-31 19:25:52 +0200
commit5e48a51608485cbc87b68498fd54ab36f001d584 (patch)
tree83a088b06111b0a58ee9dd6c19db03c0adb01537 /tests/auto/corelib/tools/qatomicscopedvaluerollback/CMakeLists.txt
parent4fc66d760376d736a3f85c945bdaed83ccdfcfe3 (diff)
Long live QAtomicScopedValueRollback (private API)!
QScopedValueRollback has a few users that apply it on QAtomicInt, which happens to work as QAtomicInt is copy-constructible and its ctors are implicit. But that's of course nonsense. We don't need to store the oldValue in an atomic, nor do we need to pass the new value into the ctor as an atomic. So, add a QAtomicScopedValueRollback which works on std::atomic as well as the Qt atomics, but distinguishes between the reference (which is atomic) and the value (which isn't), and use it in one of the users, tst_QList. Keep it private until we know whether there's an actual need for this. The test is a copy of tst_qscopedvaluefallback, so the occasional oddity (like atomic op*=) should be ignored. Task-number: QTBUG-103835 Change-Id: I3c05b3e51f465698657a02ca5521ed465386e9a6 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/corelib/tools/qatomicscopedvaluerollback/CMakeLists.txt')
-rw-r--r--tests/auto/corelib/tools/qatomicscopedvaluerollback/CMakeLists.txt6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/auto/corelib/tools/qatomicscopedvaluerollback/CMakeLists.txt b/tests/auto/corelib/tools/qatomicscopedvaluerollback/CMakeLists.txt
new file mode 100644
index 0000000000..3ba7cb9a6b
--- /dev/null
+++ b/tests/auto/corelib/tools/qatomicscopedvaluerollback/CMakeLists.txt
@@ -0,0 +1,6 @@
+qt_internal_add_test(tst_qatomicscopedvaluerollback
+ SOURCES
+ tst_qatomicscopedvaluerollback.cpp
+ PUBLIC_LIBRARIES
+ Qt::CorePrivate
+)