From 95ec02845997c2dee796c680186c46ab29e5e9ce Mon Sep 17 00:00:00 2001 From: "Eduardo M. Fleury" Date: Wed, 4 Nov 2009 16:11:58 -0300 Subject: QGAL (test): Test parent widget size besides children sizes Sometimes a test fails due to a wrong child size and we spend a lot of time trying to understand why but, in fact the problem is in the parent size. This commit adds a test to check whether the parent widget was properly resized. Signed-off-by: Eduardo M. Fleury Reviewed-by: Caio Marcelo de Oliveira Filho --- .../qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'tests') diff --git a/tests/auto/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp b/tests/auto/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp index a7ce9be79f..57e5c41be9 100644 --- a/tests/auto/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp +++ b/tests/auto/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp @@ -1720,10 +1720,8 @@ void tst_QGraphicsAnchorLayout1::testBasicLayout() widget->setLayout(layout); widget->setContentsMargins(0,0,0,0); - widget->setMinimumSize(size); - widget->setMaximumSize(size); - -// QTest::qWait(500); // layouting is asynchronous.. + widget->resize(size); + QCOMPARE(widget->size(), size); // Validate for (int i = 0; i < result.count(); ++i) { @@ -2231,8 +2229,8 @@ void tst_QGraphicsAnchorLayout1::testRemoveCenterAnchor() widget->setLayout(layout); widget->setContentsMargins(0,0,0,0); - widget->setMinimumSize(size); - widget->setMaximumSize(size); + widget->resize(size); + QCOMPARE(widget->size(), size); // Validate for (int i = 0; i < result.count(); ++i) { @@ -3072,8 +3070,8 @@ void tst_QGraphicsAnchorLayout1::testComplexCases() widget->setLayout(layout); widget->setContentsMargins(0,0,0,0); - widget->setMinimumSize(size); - widget->setMaximumSize(size); + widget->resize(size); + QCOMPARE(widget->size(), size); // QTest::qWait(500); // layouting is asynchronous.. -- cgit v1.2.3