summaryrefslogtreecommitdiffstats
path: root/tests/auto/qcombobox
diff options
context:
space:
mode:
authorStian Sandvik Thomassen <stian.thomassen@nokia.com>2009-10-15 03:31:39 (GMT)
committerStian Sandvik Thomassen <stian.thomassen@nokia.com>2009-10-15 03:31:39 (GMT)
commit03c587f510f2a5f9126b53a0c3913ac06bb86c79 (patch)
treeb7d97af9f7a90fcb9466e0a4698ff344d43de47a /tests/auto/qcombobox
parente49d92f620313c0921ece291548a8a9c6a809586 (diff)
downloadQt-03c587f510f2a5f9126b53a0c3913ac06bb86c79.zip
Qt-03c587f510f2a5f9126b53a0c3913ac06bb86c79.tar.gz
Qt-03c587f510f2a5f9126b53a0c3913ac06bb86c79.tar.bz2
Removed assertion from QComboBox::removeItem()
Made QComboBox::removeItem() do nothing instead of asserting if index is out of range. Reviewed-by: Andy Shaw
Diffstat (limited to 'tests/auto/qcombobox')
-rw-r--r--tests/auto/qcombobox/tst_qcombobox.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/qcombobox/tst_qcombobox.cpp b/tests/auto/qcombobox/tst_qcombobox.cpp
index e76f0f7..0d3469d 100644
--- a/tests/auto/qcombobox/tst_qcombobox.cpp
+++ b/tests/auto/qcombobox/tst_qcombobox.cpp
@@ -151,6 +151,7 @@ private slots:
void subControlRectsWithOffset_data();
void subControlRectsWithOffset();
void task260974_menuItemRectangleForComboBoxPopup();
+ void removeItem();
protected slots:
void onEditTextChanged( const QString &newString );
@@ -2398,5 +2399,22 @@ void tst_QComboBox::task260974_menuItemRectangleForComboBoxPopup()
#endif
}
+void tst_QComboBox::removeItem()
+{
+ QComboBox cb;
+ cb.removeItem(-1);
+ cb.removeItem(1);
+ cb.removeItem(0);
+ QCOMPARE(cb.count(), 0);
+
+ cb.addItem("foo");
+ cb.removeItem(-1);
+ QCOMPARE(cb.count(), 1);
+ cb.removeItem(1);
+ QCOMPARE(cb.count(), 1);
+ cb.removeItem(0);
+ QCOMPARE(cb.count(), 0);
+}
+
QTEST_MAIN(tst_QComboBox)
#include "tst_qcombobox.moc"