Cleanup verifyHierarchy. Remove dead code and add indexOfChild test

Change-Id: I4f423cf2f08b657329b7fb5e225e7b8b3f17e4af
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
bb10
Jan Arve Saether 2012-12-20 16:06:48 +01:00 committed by The Qt Project
parent 25c6908c80
commit cf5264fd67
1 changed files with 3 additions and 5 deletions

View File

@ -184,7 +184,8 @@ static inline int indexOfChild(QAccessibleInterface *parentInterface, QWidget *c
do { \
if (!errorAt && !(cond)) { \
errorAt = __LINE__; \
qWarning("level: %d, middle: %d, role: %d (%s)", treelevel, middle, iface->role(), #cond); \
qWarning("level: %d, role: %d (%s)", treelevel, iface->role(), #cond); \
break; \
} \
} while (0)
@ -195,13 +196,10 @@ static int verifyHierarchy(QAccessibleInterface *iface)
QAIPtr middleChild;
QAIPtr if2;
++treelevel;
int middle = iface->childCount()/2 + 1;
if (iface->childCount() >= 2) {
middleChild = QAIPtr(iface->child(middle - 1));
}
for (int i = 0; i < iface->childCount() && !errorAt; ++i) {
if2 = QAIPtr(iface->child(i));
EXPECT(if2 != 0);
EXPECT(iface->indexOfChild(if2.data()) == i);
// navigate Ancestor
QAIPtr parent(if2->parent());
EXPECT(iface->object() == parent->object());