From 54318131a568dafcb0d84d89d2fcb2472c9e97f9 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Tue, 25 Oct 2011 14:48:25 +1000 Subject: [PATCH] Remove QSKIPs from qgraphicsgridlayout test If the test decides not to do some extra testing for certain styles, but doesn't find any failures in what it has done so far, it should pass rather than skipping. Removing the QSKIPs also corrects the leakage of the memory pointed to by "widget". Change-Id: Id4cf7e8dc48f836d2c6dcde57dde87797a2fe036 Reviewed-by: Rohan McGovern --- .../qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/auto/widgets/graphicsview/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp b/tests/auto/widgets/graphicsview/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp index 5d9d4afcb6..26b8616231 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp @@ -1053,13 +1053,13 @@ void tst_QGraphicsGridLayout::horizontalSpacing() layout->setContentsMargins(0, 0, 0, 0); qreal w = layout->sizeHint(Qt::PreferredSize, QSizeF()).width(); qreal oldSpacing = layout->horizontalSpacing(); + + // The remainder of this test is only applicable if the current style uses uniform layout spacing if (oldSpacing != -1) { layout->setHorizontalSpacing(horizontalSpacing); QApplication::processEvents(); qreal new_w = layout->sizeHint(Qt::PreferredSize, QSizeF()).width(); QCOMPARE(new_w, w - (3-1)*(oldSpacing - horizontalSpacing)); - } else { - QSKIP("The current style uses non-uniform layout spacing"); } delete widget; } @@ -1638,14 +1638,14 @@ void tst_QGraphicsGridLayout::setSpacing() QSizeF sh = layout->sizeHint(Qt::PreferredSize, QSizeF()); qreal oldVSpacing = layout->verticalSpacing(); qreal oldHSpacing = layout->horizontalSpacing(); + + // The remainder of this test is only applicable if the current style uses uniform layout spacing if (oldVSpacing != -1) { layout->setSpacing(spacing); QApplication::processEvents(); QSizeF newSH = layout->sizeHint(Qt::PreferredSize, QSizeF()); QCOMPARE(newSH.height(), sh.height() - (2-1)*(oldVSpacing - spacing)); QCOMPARE(newSH.width(), sh.width() - (3-1)*(oldHSpacing - spacing)); - } else { - QSKIP("The current style uses non-uniform layout spacing"); } delete widget; } @@ -1753,13 +1753,13 @@ void tst_QGraphicsGridLayout::verticalSpacing() layout->setContentsMargins(0, 0, 0, 0); qreal h = layout->sizeHint(Qt::PreferredSize, QSizeF()).height(); qreal oldSpacing = layout->verticalSpacing(); + + // The remainder of this test is only applicable if the current style uses uniform layout spacing if (oldSpacing != -1) { layout->setVerticalSpacing(verticalSpacing); QApplication::processEvents(); qreal new_h = layout->sizeHint(Qt::PreferredSize, QSizeF()).height(); QCOMPARE(new_h, h - (2-1)*(oldSpacing - verticalSpacing)); - } else { - QSKIP("The current style uses non-uniform layout spacing"); } delete widget; }