diff --git a/src/private/DockRegistry.cpp b/src/private/DockRegistry.cpp index 078e8b5c..6e28b01b 100644 --- a/src/private/DockRegistry.cpp +++ b/src/private/DockRegistry.cpp @@ -68,11 +68,12 @@ bool DockRegistry::isEmpty() const return m_dockWidgets.isEmpty() && m_mainWindows.isEmpty() && m_nestedWindows.isEmpty(); } -void DockRegistry::checkSanityAll() +void DockRegistry::checkSanityAll(bool dumpLayout) { for (auto layout : m_layouts) { layout->checkSanity(); - //layout->dumpDebug(); + if (dumpLayout) + layout->dumpDebug(); } } diff --git a/src/private/DockRegistry_p.h b/src/private/DockRegistry_p.h index 27d362c0..42930eaf 100644 --- a/src/private/DockRegistry_p.h +++ b/src/private/DockRegistry_p.h @@ -125,10 +125,12 @@ public: /** * @brief Calls MultisplitterLayout::checkSanity() on all layouts. * + * @param dumpDebug If true then each layout is dumped too + * * This is called by the unit-tests or the fuzzer. If during this the framework spits a qWarning() * then the app will qFatal() */ - void checkSanityAll(); + void checkSanityAll(bool dumpDebug = false); /** * @brief Returns whether we're processing a QEvent::Quit diff --git a/tests/fuzzer/Fuzzer.cpp b/tests/fuzzer/Fuzzer.cpp index 12eaf910..62e003eb 100644 --- a/tests/fuzzer/Fuzzer.cpp +++ b/tests/fuzzer/Fuzzer.cpp @@ -92,6 +92,15 @@ void Fuzzer::runTest(const Test &test) for (const auto &op : operations) { index++; + +#if 0 + // Uncomment to set a breakpoint! Check the last good index printed in the terminal + if (index == 82) { + qDebug() << "About to run the bad guy. Layout:"; + DockRegistry::self()->checkSanityAll(/*dumpDebug=*/true); + qDebug() << "Running the bad guy:"; + } +#endif op->execute(); if (op->hasParams()) qDebug() << "Ran" << op->description() << index;