Remove QSKIPs from qgraphicslinearlayout test
authorJason McDonald <jason.mcdonald@nokia.com>
Tue, 25 Oct 2011 04:59:27 +0000 (14:59 +1000)
committerQt by Nokia <qt-info@nokia.com>
Tue, 25 Oct 2011 06:42:23 +0000 (08:42 +0200)
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: Ibd0f3f0605660c92e9bab2a3d1d9f31b52192575
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp

index 9769ff0..3c458b0 100644 (file)
@@ -936,6 +936,7 @@ void tst_QGraphicsLinearLayout::setSpacing()
     widget->setLayout(&layout);
     layout.setContentsMargins(0, 0, 0, 0);
 
+    // The remainder of this test is only applicable if the style uses uniform spacing
     qreal oldSpacing = layout.spacing();
     if (oldSpacing != -1) {
         for (int i = 0; i < 3; ++i)
@@ -951,8 +952,6 @@ void tst_QGraphicsLinearLayout::setSpacing()
         QSizeF newSizeHint = layout.sizeHint(Qt::PreferredSize);
 
         QCOMPARE(oldSizeHint.width() - oldSpacing * 2, newSizeHint.width() - spacing * 2);
-    } else {
-        QSKIP("This style uses non-uniform spacings (layoutSpacingImplementation() is reimplemented)");
     }
     delete widget;
 }
@@ -995,10 +994,10 @@ void tst_QGraphicsLinearLayout::setItemSpacing()
     view.show();
     QApplication::processEvents();
     QSizeF newSizeHint = layout->sizeHint(Qt::PreferredSize);
+
+    // The remainder of this test is only applicable if the style uses uniform spacing
     if (oldSpacing >= 0) {
         QCOMPARE(newSizeHint.width() - spacing, oldSizeHint.width() - oldSpacing);
-    } else {
-        QSKIP("This style uses non-uniform spacings (layoutSpacingImplementation() is reimplemented)");
     }
     delete widget;
 }