summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorThorbjørn Lund Martsum <tmartsum@gmail.com>2012-06-25 06:31:58 +0200
committerQt by Nokia <qt-info@nokia.com>2012-07-04 18:00:41 +0200
commit524c3e05e811d81fbcd71eedb377b7eaa0a21ef3 (patch)
treedddcab9e6de9d19b3a58669ac6cf3b0ee812295c /tests/auto
parente78b3e80e6f9310ca82ba1a1f1a59b2166ac872e (diff)
QHeaderView - prevent negative default+minimum section sizes
In 96f1fe8855082017fbbecccdab1eb11fd8c1f870 we agreed that sections with negative sizes did not make sense. Of the same reason default section sizes and minimum section sizes should be not negative. Change-Id: I6a770e7f510d8e2bb90bfd8f38b4fa0566fc137b Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
index 75a7360699..45839d2ab3 100644
--- a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
+++ b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
@@ -338,23 +338,21 @@ void tst_QHeaderView::getSetCheck()
// int QHeaderView::defaultSectionSize()
// void QHeaderView::setDefaultSectionSize(int)
+ obj1.setDefaultSectionSize(-1);
+ QVERIFY(obj1.defaultSectionSize() >= 0);
obj1.setDefaultSectionSize(0);
QCOMPARE(0, obj1.defaultSectionSize());
- obj1.setDefaultSectionSize(INT_MIN);
- QCOMPARE(INT_MIN, obj1.defaultSectionSize());
obj1.setDefaultSectionSize(INT_MAX);
QCOMPARE(INT_MAX, obj1.defaultSectionSize());
- // ### the test above does not make sense for values below 0
// int QHeaderView::minimumSectionSize()
// void QHeaderView::setMinimumSectionSize(int)
+ obj1.setMinimumSectionSize(-1);
+ QVERIFY(obj1.minimumSectionSize() >= 0);
obj1.setMinimumSectionSize(0);
QCOMPARE(0, obj1.minimumSectionSize());
- obj1.setMinimumSectionSize(INT_MIN);
- QCOMPARE(INT_MIN, obj1.minimumSectionSize());
obj1.setMinimumSectionSize(INT_MAX);
QCOMPARE(INT_MAX, obj1.minimumSectionSize());
- // ### the test above does not make sense for values below 0
// int QHeaderView::offset()
// void QHeaderView::setOffset(int)