diff options
author | Jesus Sanchez-Palencia <jesus.palencia@openbossa.org> | 2009-09-17 22:15:12 (GMT) |
---|---|---|
committer | Jan-Arve Sæther <jan-arve.saether@nokia.com> | 2009-09-25 10:49:21 (GMT) |
commit | 91196d46565e1650847d8befa1b971989e5bc894 (patch) | |
tree | 934173a0b4af5690c02b3d33490aa5ac360289b2 /tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp | |
parent | 71c811ac3c1954c78e09dd16b661ea4c54afb140 (diff) | |
download | Qt-91196d46565e1650847d8befa1b971989e5bc894.zip Qt-91196d46565e1650847d8befa1b971989e5bc894.tar.gz Qt-91196d46565e1650847d8befa1b971989e5bc894.tar.bz2 |
QGraphicsAnchorLayout: Adding hasConflicts() verifications on anchor tests
Signed-off-by: Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
Reviewed-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
Diffstat (limited to 'tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp')
-rw-r--r-- | tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp b/tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp index 08baf26..c24cce9 100644 --- a/tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp +++ b/tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp @@ -154,6 +154,8 @@ void tst_QGraphicsAnchorLayout::simple() QGraphicsWidget p; p.setLayout(l); + QVERIFY(l->hasConflicts() == false); + QCOMPARE(l->count(), 2); } @@ -183,6 +185,8 @@ void tst_QGraphicsAnchorLayout::simple_center() setAnchor(l, b, Qt::AnchorBottom, c, Qt::AnchorTop, 0); setAnchor(l, c, Qt::AnchorBottom, l, Qt::AnchorBottom, 0); + QVERIFY(l->hasConflicts() == false); + QCOMPARE(l->count(), 3); QGraphicsWidget *p = new QGraphicsWidget(0, Qt::Window); @@ -230,6 +234,8 @@ void tst_QGraphicsAnchorLayout::simple_semifloat() setAnchor(l, a, Qt::AnchorBottom, l, Qt::AnchorBottom, 0); setAnchor(l, b, Qt::AnchorBottom, l, Qt::AnchorBottom, 0); + QVERIFY(l->hasConflicts() == false); + QCOMPARE(l->count(), 4); QGraphicsWidget *p = new QGraphicsWidget(0, Qt::Window); @@ -290,6 +296,7 @@ void tst_QGraphicsAnchorLayout::layoutDirection() view->show(); QCOMPARE(checkReverseDirection(p), true); + QVERIFY(l->hasConflicts() == false); delete p; delete view; @@ -333,6 +340,8 @@ void tst_QGraphicsAnchorLayout::diagonal() l->addAnchor(e, Qt::AnchorRight, l, Qt::AnchorRight); l->addAnchor(d, Qt::AnchorRight, e, Qt::AnchorLeft); + QVERIFY(l->hasConflicts() == false); + QCOMPARE(l->count(), 5); QGraphicsWidget p; @@ -380,6 +389,9 @@ void tst_QGraphicsAnchorLayout::diagonal() QCOMPARE(p.size(), testA); QCOMPARE(checkReverseDirection(&p), true); + + c->setMinimumWidth(300); + QVERIFY(l->hasConflicts()); } void tst_QGraphicsAnchorLayout::parallel() @@ -472,6 +484,8 @@ void tst_QGraphicsAnchorLayout::parallel() QCOMPARE(e->geometry(), QRectF(375, 400, 175, 100)); QCOMPARE(f->geometry(), QRectF(550, 500, 200, 100)); QCOMPARE(p.size(), layoutMaximumSize); + + QVERIFY(l->hasConflicts() == false); } void tst_QGraphicsAnchorLayout::parallel2() @@ -496,6 +510,7 @@ void tst_QGraphicsAnchorLayout::parallel2() l->addAnchor(l, Qt::AnchorLeft, b, Qt::AnchorLeft); l->addAnchor(b, Qt::AnchorRight, a, Qt::AnchorRight); + QVERIFY(l->hasConflicts() == false); QCOMPARE(l->count(), 2); QGraphicsWidget p; @@ -577,6 +592,8 @@ void tst_QGraphicsAnchorLayout::snake() QCOMPARE(b->geometry(), QRectF(90.0, 100.0, 10.0, 100.0)); QCOMPARE(c->geometry(), QRectF(90.0, 200.0, 100.0, 100.0)); QCOMPARE(p.size(), layoutMaximumSize); + + QVERIFY(l->hasConflicts() == false); } void tst_QGraphicsAnchorLayout::snakeOppositeDirections() @@ -610,6 +627,7 @@ void tst_QGraphicsAnchorLayout::snakeOppositeDirections() l->addAnchor(c, Qt::AnchorRight, l, Qt::AnchorRight); + QVERIFY(l->hasConflicts() == false); QCOMPARE(l->count(), 3); QGraphicsWidget p; @@ -713,6 +731,8 @@ void tst_QGraphicsAnchorLayout::fairDistribution() QCOMPARE(c->geometry(), QRectF(200.0, 200.0, 100.0, 100.0)); QCOMPARE(d->geometry(), QRectF(0.0, 300.0, 300.0, 100.0)); QCOMPARE(p.size(), layoutMaximumSize); + + QVERIFY(l->hasConflicts() == false); } void tst_QGraphicsAnchorLayout::fairDistributionOppositeDirections() @@ -789,6 +809,8 @@ void tst_QGraphicsAnchorLayout::fairDistributionOppositeDirections() QCOMPARE(a->size(), d->size()); QCOMPARE(e->size().width(), 4 * a->size().width()); QCOMPARE(p.size(), layoutMaximumSize); + + QVERIFY(l->hasConflicts() == false); } void tst_QGraphicsAnchorLayout::proportionalPreferred() @@ -851,6 +873,8 @@ void tst_QGraphicsAnchorLayout::proportionalPreferred() QCOMPARE(a->size().width(), 10 * factor); QCOMPARE(c->size().width(), 14 * factor); QCOMPARE(p.size(), QSizeF(12, 400)); + + QVERIFY(l->hasConflicts() == false); } void tst_QGraphicsAnchorLayout::example() @@ -904,6 +928,7 @@ void tst_QGraphicsAnchorLayout::example() l->addAnchor(l, Qt::AnchorLeft, g, Qt::AnchorLeft); l->addAnchor(f, Qt::AnchorRight, g, Qt::AnchorRight); + QVERIFY(l->hasConflicts() == false); QCOMPARE(l->count(), 7); QGraphicsWidget p; @@ -992,6 +1017,8 @@ void tst_QGraphicsAnchorLayout::setSpacing() QCOMPARE(b->geometry(), QRectF(24, 0, 20, 20)); QCOMPARE(c->geometry(), QRectF(0, 20, 44, 20)); + QVERIFY(l->hasConflicts() == false); + delete p; delete view; } @@ -1076,6 +1103,7 @@ void tst_QGraphicsAnchorLayout::hardComplexS60() QSizeF layoutMaximumSize = l->effectiveSizeHint(Qt::MaximumSize); QCOMPARE(layoutMaximumSize, QSizeF(240, 40)); + QVERIFY(l->hasConflicts() == false); delete p; } @@ -1138,6 +1166,7 @@ void tst_QGraphicsAnchorLayout::delete_anchor() QGraphicsWidget *p = new QGraphicsWidget; p->setLayout(l); + QVERIFY(l->hasConflicts() == false); QCOMPARE(l->count(), 3); scene.addItem(p); |