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:
parent
e93a69349f
commit
fb4aef9c70
@ -2458,6 +2458,12 @@ void tst_QAccessibility::listTest()
|
|||||||
void tst_QAccessibility::treeTest()
|
void tst_QAccessibility::treeTest()
|
||||||
{
|
{
|
||||||
QTreeWidget *treeView = new QTreeWidget;
|
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);
|
treeView->setColumnCount(2);
|
||||||
QTreeWidgetItem *header = new QTreeWidgetItem;
|
QTreeWidgetItem *header = new QTreeWidgetItem;
|
||||||
header->setText(0, "Artist");
|
header->setText(0, "Artist");
|
||||||
@ -2493,7 +2499,6 @@ void tst_QAccessibility::treeTest()
|
|||||||
QCoreApplication::processEvents();
|
QCoreApplication::processEvents();
|
||||||
QTest::qWait(100);
|
QTest::qWait(100);
|
||||||
|
|
||||||
QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(treeView);
|
|
||||||
QCOMPARE(verifyHierarchy(iface), 0);
|
QCOMPARE(verifyHierarchy(iface), 0);
|
||||||
|
|
||||||
QCOMPARE((int)iface->role(), (int)QAccessible::Tree);
|
QCOMPARE((int)iface->role(), (int)QAccessible::Tree);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user