From cf5264fd6732a34a79f9a67a423fdd77fbeca19f Mon Sep 17 00:00:00 2001 From: Jan Arve Saether Date: Thu, 20 Dec 2012 16:06:48 +0100 Subject: Cleanup verifyHierarchy. Remove dead code and add indexOfChild test Change-Id: I4f423cf2f08b657329b7fb5e225e7b8b3f17e4af Reviewed-by: Frederik Gladhorn --- tests/auto/other/qaccessibility/tst_qaccessibility.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp index 09faa7a3f2..ceed38d589 100644 --- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp +++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp @@ -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()); -- cgit v1.2.3