summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAxel Spoerl <axel.spoerl@qt.io>2022-11-09 09:31:00 +0100
committerAxel Spoerl <axel.spoerl@qt.io>2022-11-10 17:16:59 +0100
commit3cadb68a593d4c5ecb0fbb55e5b38c42be73a530 (patch)
treed3acadfad35f9104d4fa1c721dbbee817b19e9dd /tests
parente4125863f0cf2736d933e514762f898752c901e5 (diff)
Fix unused variable compiler warning in tst_qpalette
Debug serials and detatch numbers of deep and shallow detatch in test function cacheKey, if it fails. That implicitly removes a compiler warning about these variables being unused. Change-Id: I481f4b63e3ed0d50fb442dffc658b97d913059bc Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/gui/kernel/qpalette/tst_qpalette.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/gui/kernel/qpalette/tst_qpalette.cpp b/tests/auto/gui/kernel/qpalette/tst_qpalette.cpp
index 2e9a484b8b..f9b0792960 100644
--- a/tests/auto/gui/kernel/qpalette/tst_qpalette.cpp
+++ b/tests/auto/gui/kernel/qpalette/tst_qpalette.cpp
@@ -285,6 +285,10 @@ void tst_QPalette::cacheKey()
const auto differentDataKey = copyDifferentData.cacheKey();
const auto differentDataSerNo = differentDataKey >> 32;
const auto differentDataDetachNo = differentDataKey & 0xffffffff;
+ auto loggerDeepDetach = qScopeGuard([&](){
+ qDebug() << "Deep detach serial" << differentDataSerNo;
+ qDebug() << "Deep detach detach number" << differentDataDetachNo;
+ });
QCOMPARE_NE(copyDifferentData.cacheKey(), defaultCacheKey);
QCOMPARE(defaultPalette.cacheKey(), defaultCacheKey);
@@ -294,6 +298,11 @@ void tst_QPalette::cacheKey()
const auto differentMaskKey = copyDifferentMask.cacheKey();
const auto differentMaskSerNo = differentMaskKey >> 32;
const auto differentMaskDetachNo = differentMaskKey & 0xffffffff;
+ auto loggerShallowDetach = qScopeGuard([&](){
+ qDebug() << "Shallow detach serial" << differentMaskSerNo;
+ qDebug() << "Shallow detach detach number" << differentMaskDetachNo;
+ });
+
QCOMPARE(differentMaskSerNo, defaultSerNo);
QCOMPARE_NE(differentMaskSerNo, defaultDetachNo);
QCOMPARE_NE(differentMaskKey, defaultCacheKey);
@@ -319,6 +328,9 @@ void tst_QPalette::cacheKey()
QCOMPARE_NE(modifiedAllKey, defaultCacheKey);
QCOMPARE_NE(modifiedAllKey, differentDataKey);
QCOMPARE_NE(modifiedAllKey, modifiedCacheKey);
+
+ loggerDeepDetach.dismiss();
+ loggerShallowDetach.dismiss();
}
QTEST_MAIN(tst_QPalette)