diff options
author | Jan Arve Saether <jan-arve.saether@digia.com> | 2013-01-18 10:40:38 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-01-21 15:28:28 +0100 |
commit | fb4aef9c70ac29bde97b39b7737171c1879899ed (patch) | |
tree | 08b524cc3b0260eb7f8c4457a12dcfc11d9041c3 | |
parent | e93a69349f3cbca12d2f084798d48f2091ae4f3f (diff) |
Accessibility: Test for do not crash if the column count is 0
This tests the fix submitted in bb5e11b56dd2f5fe2957f151a38
Task-number: QTBUG-28611
Change-Id: I7b15aa6b46be3607bd7079294d8e7d18bd507d1c
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
-rw-r--r-- | tests/auto/other/qaccessibility/tst_qaccessibility.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp index 2d0dd71cdb..ea322b20a1 100644 --- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp +++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp @@ -2458,6 +2458,12 @@ void tst_QAccessibility::listTest() void tst_QAccessibility::treeTest() { QTreeWidget *treeView = new QTreeWidget; + + // Empty model (do not crash, etc) + treeView->setColumnCount(0); + QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(treeView); + QCOMPARE(iface->child(0), static_cast<QAccessibleInterface*>(0)); + treeView->setColumnCount(2); QTreeWidgetItem *header = new QTreeWidgetItem; header->setText(0, "Artist"); @@ -2493,7 +2499,6 @@ void tst_QAccessibility::treeTest() QCoreApplication::processEvents(); QTest::qWait(100); - QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(treeView); QCOMPARE(verifyHierarchy(iface), 0); QCOMPARE((int)iface->role(), (int)QAccessible::Tree); |