start uncommenting tests
This commit is contained in:
@@ -44,7 +44,7 @@ add_subdirectory(src)
|
||||
|
||||
if (OPTION_DEVELOPER_MODE)
|
||||
if (NOT OPTION_QTQUICK)
|
||||
# add_subdirectory(tests)
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
|
||||
# examples use <kddockwidget/ qualified includes so need to be installed first
|
||||
|
||||
@@ -61,6 +61,7 @@
|
||||
|
||||
using namespace KDDockWidgets;
|
||||
using namespace KDDockWidgets::Tests;
|
||||
using namespace Layouting;
|
||||
|
||||
static int staticAnchorLength()
|
||||
{
|
||||
@@ -139,7 +140,7 @@ struct ExpectedRectForDrop // struct for testing MultiSplitterLayout::availableL
|
||||
typedef QVector<ExpectedRectForDrop> ExpectedRectsForDrop;
|
||||
Q_DECLARE_METATYPE(ExpectedRectForDrop)
|
||||
|
||||
static int osWindowMinWidth()
|
||||
/*static int osWindowMinWidth()
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
return GetSystemMetrics(SM_CXMIN);
|
||||
@@ -147,7 +148,7 @@ static int osWindowMinWidth()
|
||||
return 140; // Some random value for our windows. It's only important on Windows
|
||||
#endif
|
||||
}
|
||||
/*
|
||||
|
||||
static int osWindowMinHeight()
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
@@ -242,137 +243,137 @@ public:
|
||||
static void nestDockWidget(DockWidgetBase *dock, DropArea *dropArea, Frame *relativeTo, KDDockWidgets::Location location);
|
||||
|
||||
private Q_SLOTS:
|
||||
void tst_simple1();
|
||||
void tst_simple2();
|
||||
void tst_shutdown();
|
||||
void tst_mainWindowAlwaysHasCentralWidget();
|
||||
// void tst_simple1();
|
||||
// void tst_simple2();
|
||||
// void tst_shutdown();
|
||||
// void tst_mainWindowAlwaysHasCentralWidget();
|
||||
void tst_createFloatingWindow();
|
||||
void tst_dock2FloatingWidgetsTabbed();
|
||||
void tst_close();
|
||||
void tst_doubleClose();
|
||||
void tst_preventClose();
|
||||
void tst_closeAllDockWidgets();
|
||||
// void tst_preventClose();
|
||||
// void tst_closeAllDockWidgets();
|
||||
void tst_dockDockWidgetNested();
|
||||
void tst_dockFloatingWindowNested();
|
||||
void tst_anchorsFromTo();
|
||||
void tst_dockWindowWithTwoSideBySideFramesIntoCenter();
|
||||
void tst_dockWindowWithTwoSideBySideFramesIntoLeft();
|
||||
void tst_dockWindowWithTwoSideBySideFramesIntoRight();
|
||||
void tst_posAfterLeftDetach();
|
||||
void tst_propagateMinSize();
|
||||
void tst_dockInternal();
|
||||
void tst_propagateSizeHonoursMinSize();
|
||||
// void tst_anchorsFromTo();
|
||||
// void tst_dockWindowWithTwoSideBySideFramesIntoCenter();
|
||||
// void tst_dockWindowWithTwoSideBySideFramesIntoLeft();
|
||||
// void tst_dockWindowWithTwoSideBySideFramesIntoRight();
|
||||
// void tst_posAfterLeftDetach();
|
||||
// void tst_propagateMinSize();
|
||||
// void tst_dockInternal();
|
||||
// void tst_propagateSizeHonoursMinSize();
|
||||
|
||||
void tst_addDockWidgetAsTabToDockWidget();
|
||||
void tst_addDockWidgetToMainWindow(); // Tests MainWindow::addDockWidget();
|
||||
void tst_addDockWidgetToContainingWindow();
|
||||
void tst_addToSmallMainWindow();
|
||||
void tst_fairResizeAfterRemoveWidget();
|
||||
void tst_notClosable();
|
||||
void tst_maximizeAndRestore();
|
||||
void tst_propagateResize2();
|
||||
// void tst_addDockWidgetAsTabToDockWidget();
|
||||
// void tst_addDockWidgetToMainWindow(); // Tests MainWindow::addDockWidget();
|
||||
// void tst_addDockWidgetToContainingWindow();
|
||||
// void tst_addToSmallMainWindow();
|
||||
// void tst_fairResizeAfterRemoveWidget();
|
||||
// void tst_notClosable();
|
||||
// void tst_maximizeAndRestore();
|
||||
// void tst_propagateResize2();
|
||||
|
||||
void tst_availableLengthForDrop_data();
|
||||
void tst_availableLengthForDrop();
|
||||
// void tst_availableLengthForDrop_data();
|
||||
// void tst_availableLengthForDrop();
|
||||
|
||||
void tst_clear();
|
||||
void tst_constraintsAfterPlaceholder();
|
||||
void tst_rectForDrop_data();
|
||||
void tst_rectForDrop();
|
||||
void tst_rectForDropMath_data();
|
||||
void tst_rectForDropMath();
|
||||
void tst_crash(); // tests some crash I got
|
||||
void tst_crash2_data();
|
||||
void tst_crash2();
|
||||
void tst_setFloatingWhenWasTabbed();
|
||||
void tst_setFloatingWhenSideBySide();
|
||||
void tst_setFloatingAfterDraggedFromTabToSideBySide();
|
||||
void tst_setFloatingAFrameWithTabs();
|
||||
void tst_setVisibleFalseWhenSideBySide();
|
||||
void tst_refUnrefItem();
|
||||
void tst_addAndReadd();
|
||||
void tst_placeholderCount();
|
||||
void tst_availableLengthForOrientation();
|
||||
void tst_setAstCurrentTab();
|
||||
void tst_closeShowWhenNoCentralFrame();
|
||||
void tst_placeholderDisappearsOnReadd();
|
||||
void tst_placeholdersAreRemovedPropertly();
|
||||
void tst_embeddedMainWindow();
|
||||
void tst_toggleMiddleDockCrash(); // tests some crash I got
|
||||
void tst_28NestedWidgets();
|
||||
void tst_28NestedWidgets_data();
|
||||
void tst_invalidPlaceholderPosition_data();
|
||||
void tst_invalidPlaceholderPosition();
|
||||
void tst_invalidAnchorGroup();
|
||||
void tst_resizeViaAnchorsAfterPlaceholderCreation();
|
||||
void tst_negativeAnchorPosition();
|
||||
void tst_negativeAnchorPosition2();
|
||||
void tst_negativeAnchorPosition3();
|
||||
void tst_negativeAnchorPosition4();
|
||||
void tst_negativeAnchorPosition5();
|
||||
void tst_negativeAnchorPosition6();
|
||||
void tst_negativeAnchorPosition7();
|
||||
void tst_negativeAnchorPositionWhenEmbedded_data();
|
||||
void tst_negativeAnchorPositionWhenEmbedded();
|
||||
void tst_availableSizeWithPlaceholders();
|
||||
void tst_stealFrame();
|
||||
void tst_addAsPlaceholder();
|
||||
void tst_removeItem();
|
||||
void tst_startHidden();
|
||||
void tst_startClosed();
|
||||
void tst_sizeConstraintWarning();
|
||||
void tst_invalidLayoutAfterRestore();
|
||||
void tst_samePositionAfterHideRestore();
|
||||
void tst_anchorFollowingItselfAssert();
|
||||
void tst_positionWhenShown();
|
||||
void tst_restoreEmpty();
|
||||
void tst_restoreSimple();
|
||||
void tst_restoreNestedAndTabbed();
|
||||
void tst_restoreCentralFrame();
|
||||
void tst_restoreCrash();
|
||||
void tst_restoreTwice();
|
||||
void tst_restoreSideBySide();
|
||||
void tst_restoreWithPlaceholder();
|
||||
void tst_restoreWithNonClosableWidget();
|
||||
void tst_restoreAfterResize();
|
||||
void tst_restoreWithAffinity();
|
||||
void tst_marginsAfterRestore();
|
||||
void tst_restoreEmbeddedMainWindow();
|
||||
void tst_restoreWithDockFactory();
|
||||
// void tst_clear();
|
||||
// void tst_constraintsAfterPlaceholder();
|
||||
// void tst_rectForDrop_data();
|
||||
// void tst_rectForDrop();
|
||||
// void tst_rectForDropMath_data();
|
||||
// void tst_rectForDropMath();
|
||||
// void tst_crash(); // tests some crash I got
|
||||
// void tst_crash2_data();
|
||||
// void tst_crash2();
|
||||
// void tst_setFloatingWhenWasTabbed();
|
||||
// void tst_setFloatingWhenSideBySide();
|
||||
// void tst_setFloatingAfterDraggedFromTabToSideBySide();
|
||||
// void tst_setFloatingAFrameWithTabs();
|
||||
// void tst_setVisibleFalseWhenSideBySide();
|
||||
// void tst_refUnrefItem();
|
||||
// void tst_addAndReadd();
|
||||
// void tst_placeholderCount();
|
||||
// void tst_availableLengthForOrientation();
|
||||
// void tst_setAstCurrentTab();
|
||||
// void tst_closeShowWhenNoCentralFrame();
|
||||
// void tst_placeholderDisappearsOnReadd();
|
||||
// void tst_placeholdersAreRemovedPropertly();
|
||||
// void tst_embeddedMainWindow();
|
||||
// void tst_toggleMiddleDockCrash(); // tests some crash I got
|
||||
// void tst_28NestedWidgets();
|
||||
// void tst_28NestedWidgets_data();
|
||||
// void tst_invalidPlaceholderPosition_data();
|
||||
// void tst_invalidPlaceholderPosition();
|
||||
// void tst_invalidAnchorGroup();
|
||||
// void tst_resizeViaAnchorsAfterPlaceholderCreation();
|
||||
// void tst_negativeAnchorPosition();
|
||||
// void tst_negativeAnchorPosition2();
|
||||
// void tst_negativeAnchorPosition3();
|
||||
// void tst_negativeAnchorPosition4();
|
||||
// void tst_negativeAnchorPosition5();
|
||||
// void tst_negativeAnchorPosition6();
|
||||
// void tst_negativeAnchorPosition7();
|
||||
// void tst_negativeAnchorPositionWhenEmbedded_data();
|
||||
// void tst_negativeAnchorPositionWhenEmbedded();
|
||||
// void tst_availableSizeWithPlaceholders();
|
||||
// void tst_stealFrame();
|
||||
// void tst_addAsPlaceholder();
|
||||
// void tst_removeItem();
|
||||
// void tst_startHidden();
|
||||
// void tst_startClosed();
|
||||
// void tst_sizeConstraintWarning();
|
||||
// void tst_invalidLayoutAfterRestore();
|
||||
// void tst_samePositionAfterHideRestore();
|
||||
// void tst_anchorFollowingItselfAssert();
|
||||
// void tst_positionWhenShown();
|
||||
// void tst_restoreEmpty();
|
||||
// void tst_restoreSimple();
|
||||
// void tst_restoreNestedAndTabbed();
|
||||
// void tst_restoreCentralFrame();
|
||||
// void tst_restoreCrash();
|
||||
// void tst_restoreTwice();
|
||||
// void tst_restoreSideBySide();
|
||||
// void tst_restoreWithPlaceholder();
|
||||
// void tst_restoreWithNonClosableWidget();
|
||||
// void tst_restoreAfterResize();
|
||||
// void tst_restoreWithAffinity();
|
||||
// void tst_marginsAfterRestore();
|
||||
// void tst_restoreEmbeddedMainWindow();
|
||||
// void tst_restoreWithDockFactory();
|
||||
|
||||
void tst_resizeWindow_data();
|
||||
void tst_resizeWindow();
|
||||
void tst_resizeWindow2();
|
||||
void tst_rectForDropCrash();
|
||||
// void tst_resizeWindow_data();
|
||||
// void tst_resizeWindow();
|
||||
// void tst_resizeWindow2();
|
||||
// void tst_rectForDropCrash();
|
||||
|
||||
void tst_tabBarWithHiddenTitleBar_data();
|
||||
void tst_tabBarWithHiddenTitleBar();
|
||||
void tst_toggleDockWidgetWithHiddenTitleBar();
|
||||
void tst_dragByTabBar_data();
|
||||
void tst_dragByTabBar();
|
||||
void tst_dragBySingleTab();
|
||||
// void tst_tabBarWithHiddenTitleBar_data();
|
||||
// void tst_tabBarWithHiddenTitleBar();
|
||||
// void tst_toggleDockWidgetWithHiddenTitleBar();
|
||||
// void tst_dragByTabBar_data();
|
||||
// void tst_dragByTabBar();
|
||||
// void tst_dragBySingleTab();
|
||||
|
||||
void tst_addToHiddenMainWindow();
|
||||
void tst_minSizeChanges();
|
||||
void tst_complex();
|
||||
void tst_titlebar_getter();
|
||||
void tst_staticAnchorThickness_data();
|
||||
void tst_staticAnchorThickness();
|
||||
void tst_honourGeometryOfHiddenWindow();
|
||||
void tst_registry();
|
||||
void tst_dockNotFillingSpace();
|
||||
void tst_floatingLastPosAfterDoubleClose();
|
||||
void tst_addingOptionHiddenTabbed();
|
||||
void tst_flagDoubleClick();
|
||||
void tst_floatingWindowDeleted();
|
||||
void tst_raise();
|
||||
// void tst_addToHiddenMainWindow();
|
||||
// void tst_minSizeChanges();
|
||||
// void tst_complex();
|
||||
// void tst_titlebar_getter();
|
||||
// void tst_staticAnchorThickness_data();
|
||||
// void tst_staticAnchorThickness();
|
||||
// void tst_honourGeometryOfHiddenWindow();
|
||||
// void tst_registry();
|
||||
// void tst_dockNotFillingSpace();
|
||||
// void tst_floatingLastPosAfterDoubleClose();
|
||||
// void tst_addingOptionHiddenTabbed();
|
||||
// void tst_flagDoubleClick();
|
||||
// void tst_floatingWindowDeleted();
|
||||
// void tst_raise();
|
||||
|
||||
private:
|
||||
std::unique_ptr<MultiSplitter> createMultiSplitterFromSetup(MultiSplitterSetup setup, QHash<QWidget *, Frame *> &frameMap) const;
|
||||
};
|
||||
}
|
||||
|
||||
static EmbeddedWindow *createEmbeddedMainWindow(QSize sz)
|
||||
/*static EmbeddedWindow *createEmbeddedMainWindow(QSize sz)
|
||||
{
|
||||
static int count = 0;
|
||||
count++;
|
||||
@@ -386,7 +387,7 @@ static EmbeddedWindow *createEmbeddedMainWindow(QSize sz)
|
||||
window->show();
|
||||
window->resize(sz);
|
||||
return window;
|
||||
}
|
||||
}*/
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -463,10 +464,6 @@ void TestDocks::nestDockWidget(DockWidgetBase *dock, DropArea *dropArea, Frame *
|
||||
frame->addWidget(dock);
|
||||
dock->frame()->setObjectName(dock->objectName());
|
||||
|
||||
qDebug() << "Adding widget" << frame
|
||||
<< "; min width=" << widgetMinLength(frame, Qt::Vertical)
|
||||
<< "; min height=" << widgetMinLength(frame, Qt::Horizontal);
|
||||
|
||||
dropArea->multiSplitterLayout()->addWidget(frame, location, relativeTo);
|
||||
QVERIFY(dropArea->checkSanity());
|
||||
qDebug() << "Size after adding: " << frame->size();
|
||||
@@ -774,7 +771,7 @@ void TestDocks::tst_doubleClose()
|
||||
Testing::waitForDeleted(window.data());
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
void TestDocks::tst_preventClose()
|
||||
{
|
||||
EnsureTopLevelsDeleted e;
|
||||
@@ -803,7 +800,7 @@ void TestDocks::tst_preventClose()
|
||||
dock1->deleteLater();
|
||||
QVERIFY(Testing::waitForDeleted(dock1));
|
||||
}
|
||||
|
||||
#endif
|
||||
void TestDocks::tst_dockDockWidgetNested()
|
||||
{
|
||||
EnsureTopLevelsDeleted e;
|
||||
@@ -819,6 +816,8 @@ void TestDocks::tst_dockFloatingWindowNested()
|
||||
// TODO
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
void TestDocks::tst_anchorsFromTo()
|
||||
{
|
||||
EnsureTopLevelsDeleted e;
|
||||
@@ -1872,7 +1871,7 @@ void TestDocks::tst_addToSmallMainWindow()
|
||||
|
||||
auto fw = dock2->morphIntoFloatingWindow();
|
||||
QVERIFY(fw->isVisible());
|
||||
QVERIFY(dropArea->checkSanity(MultiSplitterLayout::AnchorSanity_Intersections));
|
||||
QVERIFY(dropArea->checkSanity());
|
||||
|
||||
dragFloatingWindowTo(fw, dropArea, DropIndicatorOverlayInterface::DropLocation_Right);
|
||||
QVERIFY(m->dropArea()->checkSanity());
|
||||
@@ -1894,7 +1893,7 @@ void TestDocks::tst_addToSmallMainWindow()
|
||||
Testing::waitForResize(m.get());
|
||||
|
||||
const int item2MinHeight = layout->itemForFrame(dock2->frame())->minLength(Qt::Horizontal);
|
||||
QCOMPARE(dropArea->height(), dock1->frame()->height() + item2MinHeight + Anchor::thickness(true)*2 + Anchor::thickness(false));
|
||||
QCOMPARE(dropArea->height(), dock1->frame()->height() + item2MinHeight + Item::separatorThickness());
|
||||
}
|
||||
|
||||
qDebug() << "Test 5";
|
||||
@@ -5557,5 +5556,7 @@ void TestDocks::tst_raise()
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
QTEST_MAIN(KDDockWidgets::TestDocks)
|
||||
#include "tst_docks.moc"
|
||||
|
||||
Reference in New Issue
Block a user