From 00d9f68c411a336e451065ae71b8d0fb0d44da60 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 31 Mar 2020 11:56:53 +0200 Subject: Speed up tst_QApplication::testDeleteLaterProcessEvents2() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Quit the event loop once the object is destroyed. Change-Id: I6df1cfe867daacb6af56eb84646be91d98a2f545 Reviewed-by: Alex Trotsenko Reviewed-by: MÃ¥rten Nordheim --- tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests/auto/widgets/kernel') diff --git a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp index a7a000a01e..3debfd4231 100644 --- a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp +++ b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp @@ -1366,10 +1366,11 @@ void tst_QApplication::testDeleteLaterProcessEvents2() // If you call deleteLater() on an object when there is no parent // event loop, and then enter an event loop, the object will get // deleted. + QEventLoop loop; object = new QObject; + connect(object, &QObject::destroyed, &loop, &QEventLoop::quit); p = object; object->deleteLater(); - QEventLoop loop; QTimer::singleShot(1000, &loop, &QEventLoop::quit); loop.exec(); QVERIFY(!p); -- cgit v1.2.3