summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2011-05-03 00:38:03 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2011-05-04 03:16:29 (GMT)
commitd1011fc9328fa335bc69a065b29e77ce60608c55 (patch)
tree8b396815aee1eeabffb207a6966b14475c821a04 /tests/auto
parent4b5a7eeacee997f0129354c9669b8e0d66ca4efa (diff)
downloadQt-d1011fc9328fa335bc69a065b29e77ce60608c55.zip
Qt-d1011fc9328fa335bc69a065b29e77ce60608c55.tar.gz
Qt-d1011fc9328fa335bc69a065b29e77ce60608c55.tar.bz2
Remove Q_ASSERT from qgraphicsanchorlayout test
Q_ASSERT will only catch a violation of the precondition of the checkReverseDirection function in a debug build. This commit replaces the Q_ASSERT with QVERIFY'ing the precondition (that the widget has a layout) before calling the function. Change-Id: Ibaa2b52b7d67fa20784e0df022e8c8169da0e50e Task-number: QTBUG-17582 Reviewed-by: Rohan McGovern
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp b/tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp
index 67e9b0a..7b33081 100644
--- a/tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp
+++ b/tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp
@@ -135,7 +135,6 @@ static void setAnchor(QGraphicsAnchorLayout *l,
static bool checkReverseDirection(QGraphicsWidget *widget)
{
QGraphicsLayout *layout = widget->layout();
- Q_ASSERT(layout);
qreal left, top, right, bottom;
layout->getContentsMargins(&left, &top, &right, &bottom);
widget->setLayoutDirection(Qt::LeftToRight);
@@ -345,6 +344,7 @@ void tst_QGraphicsAnchorLayout::layoutDirection()
p->show();
view->show();
+ QVERIFY(p->layout());
QCOMPARE(checkReverseDirection(p), true);
if (hasSimplification) {
@@ -445,6 +445,7 @@ void tst_QGraphicsAnchorLayout::diagonal()
QVERIFY(!usedSimplex(l, Qt::Vertical));
}
+ QVERIFY(p.layout());
QCOMPARE(checkReverseDirection(&p), true);
c->setMinimumWidth(300);
@@ -735,6 +736,7 @@ void tst_QGraphicsAnchorLayout::snakeOppositeDirections()
QCOMPARE(c->geometry(), QRectF(90.0, 200.0, 100.0, 100.0));
QCOMPARE(p.size(), layoutMaximumSize);
+ QVERIFY(p.layout());
QCOMPARE(checkReverseDirection(&p), true);
}