diff --git a/tests/tst_docks.cpp b/tests/tst_docks.cpp index 95e56e96..cda26e59 100644 --- a/tests/tst_docks.cpp +++ b/tests/tst_docks.cpp @@ -397,13 +397,8 @@ void TestDocks::tst_restoreSimple() dock3->morphIntoFloatingWindow(); // as it would take 1 event loop. Do it now so we can compare already. QCOMPARE(dock3->window()->pos(), dock3FloatingPoint); - - // Cleanup - dock3->deleteLater(); - QVERIFY(Testing::waitForDeleted(dock3)); } - void TestDocks::tst_doesntHaveNativeTitleBar() { // Tests that a floating window doesn't have a native title bar diff --git a/tests/utils.h b/tests/utils.h index cc5bf494..a419270f 100644 --- a/tests/utils.h +++ b/tests/utils.h @@ -101,13 +101,16 @@ struct EnsureTopLevelsDeleted ~EnsureTopLevelsDeleted() { - auto dr = DockRegistry::self(); + qDeleteAll(DockRegistry::self()->floatingWindows(/*includeBeingDeleted=*/ true)); + qDeleteAll(DockRegistry::self()->dockwidgets()); - if (!dr->isEmpty()) + if (!DockRegistry::self()->isEmpty()) { + auto dr = DockRegistry::self(); qWarning() << "There's still top-level widgets present!" << "\nfloatings:" << dr->floatingWindows(/*includeBeingDeleted=*/ true) << "\nmainwindows:" << dr->mainWindowsNames() << "\ndocks:" << dr->dockWidgetNames(); + } // Other cleanup, since we use this class everywhere Config::self().setDockWidgetFactoryFunc(nullptr);