summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/thread/qthread/tst_qthread.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2021-05-19 10:25:45 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2021-05-26 11:02:48 +0000
commitae021882330abc5f6fbaadca290e6e5670c89028 (patch)
tree99821d2caae31319e00a89a5ecf858e38ebf4f6e /tests/auto/corelib/thread/qthread/tst_qthread.cpp
parent25a7034d78aeb12726a1052d64c0aa3314a1f69d (diff)
QTestlib: Add formatting for QObject * in QCOMPARE
Output object name and class in QCOMPARE(). This should help to debug flaky QWidget tests that for example check on focusWidget(). [ChangeLog][QtTestLib] QCOMPARE() now reports QObject * values by class and objectName(). Task-number: QTBUG-64446 Change-Id: Ife04e89bba04fc78d077c8f0f07af17a17c9cf8c Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'tests/auto/corelib/thread/qthread/tst_qthread.cpp')
-rw-r--r--tests/auto/corelib/thread/qthread/tst_qthread.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/auto/corelib/thread/qthread/tst_qthread.cpp b/tests/auto/corelib/thread/qthread/tst_qthread.cpp
index 7e06e7f51f..29c72b9bf9 100644
--- a/tests/auto/corelib/thread/qthread/tst_qthread.cpp
+++ b/tests/auto/corelib/thread/qthread/tst_qthread.cpp
@@ -779,8 +779,9 @@ void tst_QThread::adoptedThreadAffinity()
thread.startAndWait(adoptedThreadAffinityFunction, affinity);
thread.join();
- // adopted thread should have affinity to itself
- QCOMPARE(affinity[0], affinity[1]);
+ // adopted thread (deleted) should have affinity to itself
+ QCOMPARE(static_cast<const void *>(affinity[0]),
+ static_cast<const void *>(affinity[1]));
}
void tst_QThread::adoptedThreadSetPriority()