Remove QSKIPs from qgraphicslinearlayout 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: Ibd0f3f0605660c92e9bab2a3d1d9f31b52192575 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
This commit is contained in:
parent
54318131a5
commit
f6b05d5075
@ -936,6 +936,7 @@ void tst_QGraphicsLinearLayout::setSpacing()
|
|||||||
widget->setLayout(&layout);
|
widget->setLayout(&layout);
|
||||||
layout.setContentsMargins(0, 0, 0, 0);
|
layout.setContentsMargins(0, 0, 0, 0);
|
||||||
|
|
||||||
|
// The remainder of this test is only applicable if the style uses uniform spacing
|
||||||
qreal oldSpacing = layout.spacing();
|
qreal oldSpacing = layout.spacing();
|
||||||
if (oldSpacing != -1) {
|
if (oldSpacing != -1) {
|
||||||
for (int i = 0; i < 3; ++i)
|
for (int i = 0; i < 3; ++i)
|
||||||
@ -951,8 +952,6 @@ void tst_QGraphicsLinearLayout::setSpacing()
|
|||||||
QSizeF newSizeHint = layout.sizeHint(Qt::PreferredSize);
|
QSizeF newSizeHint = layout.sizeHint(Qt::PreferredSize);
|
||||||
|
|
||||||
QCOMPARE(oldSizeHint.width() - oldSpacing * 2, newSizeHint.width() - spacing * 2);
|
QCOMPARE(oldSizeHint.width() - oldSpacing * 2, newSizeHint.width() - spacing * 2);
|
||||||
} else {
|
|
||||||
QSKIP("This style uses non-uniform spacings (layoutSpacingImplementation() is reimplemented)");
|
|
||||||
}
|
}
|
||||||
delete widget;
|
delete widget;
|
||||||
}
|
}
|
||||||
@ -995,10 +994,10 @@ void tst_QGraphicsLinearLayout::setItemSpacing()
|
|||||||
view.show();
|
view.show();
|
||||||
QApplication::processEvents();
|
QApplication::processEvents();
|
||||||
QSizeF newSizeHint = layout->sizeHint(Qt::PreferredSize);
|
QSizeF newSizeHint = layout->sizeHint(Qt::PreferredSize);
|
||||||
|
|
||||||
|
// The remainder of this test is only applicable if the style uses uniform spacing
|
||||||
if (oldSpacing >= 0) {
|
if (oldSpacing >= 0) {
|
||||||
QCOMPARE(newSizeHint.width() - spacing, oldSizeHint.width() - oldSpacing);
|
QCOMPARE(newSizeHint.width() - spacing, oldSizeHint.width() - oldSpacing);
|
||||||
} else {
|
|
||||||
QSKIP("This style uses non-uniform spacings (layoutSpacingImplementation() is reimplemented)");
|
|
||||||
}
|
}
|
||||||
delete widget;
|
delete widget;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user