summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2011-04-21 05:33:01 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2011-05-03 00:16:09 (GMT)
commit2c64404e2edd3b792b8a1d04c773860d40c04c4c (patch)
tree2bed0022734b80511b1e0acad5db896207b8b604 /tests
parent60e5ed805af1e11aaec426b823df209b4c895c29 (diff)
downloadQt-2c64404e2edd3b792b8a1d04c773860d40c04c4c.zip
Qt-2c64404e2edd3b792b8a1d04c773860d40c04c4c.tar.gz
Qt-2c64404e2edd3b792b8a1d04c773860d40c04c4c.tar.bz2
Remove Q_ASSERTs from qgraphicsanchorlayout1 test
Sanity-check the test data when using it rather than when creating it. Change-Id: Ie5d5e1ff3fc439d196096f17cb6f97680927a90c Task-number: QTBUG-17582 Reviewed-by: Rohan McGovern
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp22
1 files changed, 6 insertions, 16 deletions
diff --git a/tests/auto/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp b/tests/auto/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp
index a03f7bc..ee25291 100644
--- a/tests/auto/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp
+++ b/tests/auto/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp
@@ -2585,15 +2585,11 @@ void tst_QGraphicsAnchorLayout1::testSizeDistribution_data()
sizeHints1.insert( Qt::MinimumSize, 30 );
sizeHints1.insert( Qt::PreferredSize, 35 );
sizeHints1.insert( Qt::MaximumSize, 40 );
- Q_ASSERT( sizeHints1.value( Qt::MinimumSize ) <= sizeHints1.value( Qt::PreferredSize ) );
- Q_ASSERT( sizeHints1.value( Qt::PreferredSize ) <= sizeHints1.value( Qt::MaximumSize ) );
SizeHintArray sizeHints2;
sizeHints2.insert( Qt::MinimumSize, 5 );
sizeHints2.insert( Qt::PreferredSize, 35 );
sizeHints2.insert( Qt::MaximumSize, 300 );
- Q_ASSERT( sizeHints2.value( Qt::MinimumSize ) <= sizeHints2.value( Qt::PreferredSize ) );
- Q_ASSERT( sizeHints2.value( Qt::PreferredSize ) <= sizeHints2.value( Qt::MaximumSize ) );
const qreal width1 = 35;
const qreal width2 = 100-10-10-10-width1;
@@ -2605,15 +2601,11 @@ void tst_QGraphicsAnchorLayout1::testSizeDistribution_data()
sizeHints1.insert( Qt::MinimumSize, 0 );
sizeHints1.insert( Qt::PreferredSize, 20 );
sizeHints1.insert( Qt::MaximumSize, 100 );
- Q_ASSERT( sizeHints1.value( Qt::MinimumSize ) <= sizeHints1.value( Qt::PreferredSize ) );
- Q_ASSERT( sizeHints1.value( Qt::PreferredSize ) <= sizeHints1.value( Qt::MaximumSize ) );
SizeHintArray sizeHints2;
sizeHints2.insert( Qt::MinimumSize, 0 );
sizeHints2.insert( Qt::PreferredSize, 50 );
sizeHints2.insert( Qt::MaximumSize, 100 );
- Q_ASSERT( sizeHints2.value( Qt::MinimumSize ) <= sizeHints2.value( Qt::PreferredSize ) );
- Q_ASSERT( sizeHints2.value( Qt::PreferredSize ) <= sizeHints2.value( Qt::MaximumSize ) );
const qreal width1 = 20;
const qreal width2 = 100-10-10-10-width1;
@@ -2625,15 +2617,11 @@ void tst_QGraphicsAnchorLayout1::testSizeDistribution_data()
sizeHints1.insert( Qt::MinimumSize, 0 );
sizeHints1.insert( Qt::PreferredSize, 40 );
sizeHints1.insert( Qt::MaximumSize, 100 );
- Q_ASSERT( sizeHints1.value( Qt::MinimumSize ) <= sizeHints1.value( Qt::PreferredSize ) );
- Q_ASSERT( sizeHints1.value( Qt::PreferredSize ) <= sizeHints1.value( Qt::MaximumSize ) );
SizeHintArray sizeHints2;
sizeHints2.insert( Qt::MinimumSize, 0 );
sizeHints2.insert( Qt::PreferredSize, 60 );
sizeHints2.insert( Qt::MaximumSize, 100 );
- Q_ASSERT( sizeHints2.value( Qt::MinimumSize ) <= sizeHints2.value( Qt::PreferredSize ) );
- Q_ASSERT( sizeHints2.value( Qt::PreferredSize ) <= sizeHints2.value( Qt::MaximumSize ) );
const qreal width1 = 28; // got from manual calculation
const qreal width2 = 100-10-10-10-width1;
@@ -2645,15 +2633,11 @@ void tst_QGraphicsAnchorLayout1::testSizeDistribution_data()
sizeHints1.insert( Qt::MinimumSize, 0 );
sizeHints1.insert( Qt::PreferredSize, 10 );
sizeHints1.insert( Qt::MaximumSize, 100 );
- Q_ASSERT( sizeHints1.value( Qt::MinimumSize ) <= sizeHints1.value( Qt::PreferredSize ) );
- Q_ASSERT( sizeHints1.value( Qt::PreferredSize ) <= sizeHints1.value( Qt::MaximumSize ) );
SizeHintArray sizeHints2;
sizeHints2.insert( Qt::MinimumSize, 0 );
sizeHints2.insert( Qt::PreferredSize, 40 );
sizeHints2.insert( Qt::MaximumSize, 100 );
- Q_ASSERT( sizeHints2.value( Qt::MinimumSize ) <= sizeHints2.value( Qt::PreferredSize ) );
- Q_ASSERT( sizeHints2.value( Qt::PreferredSize ) <= sizeHints2.value( Qt::MaximumSize ) );
const qreal width1 = 22; // got from manual calculation
const qreal width2 = 100-10-10-10-width1;
@@ -2669,6 +2653,12 @@ void tst_QGraphicsAnchorLayout1::testSizeDistribution()
QFETCH(qreal, width1);
QFETCH(qreal, width2);
+ // sanity-check the test data - MinimumSize <= PreferredSize <= MaximumSize
+ QVERIFY( sizeHints1.value( Qt::MinimumSize ) <= sizeHints1.value( Qt::PreferredSize ) );
+ QVERIFY( sizeHints1.value( Qt::PreferredSize ) <= sizeHints1.value( Qt::MaximumSize ) );
+ QVERIFY( sizeHints2.value( Qt::MinimumSize ) <= sizeHints2.value( Qt::PreferredSize ) );
+ QVERIFY( sizeHints2.value( Qt::PreferredSize ) <= sizeHints2.value( Qt::MaximumSize ) );
+
// create objects
QGraphicsWidget widget;
TheAnchorLayout *layout = new TheAnchorLayout;