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>
This commit is contained in:
Jan Arve Saether 2013-01-18 10:40:38 +01:00 committed by The Qt Project
parent e93a69349f
commit fb4aef9c70

View File

@ -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);