summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJan Arve Saether <jan-arve.saether@digia.com>2012-12-20 16:06:48 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-01-03 20:18:06 +0100
commitcf5264fd6732a34a79f9a67a423fdd77fbeca19f (patch)
tree3348f9b27c93e89a0d8e4d35aa7113f59f4edf3f /tests
parent25c6908c80217ab7cae46e971ec5b04e3fab361e (diff)
Cleanup verifyHierarchy. Remove dead code and add indexOfChild test
Change-Id: I4f423cf2f08b657329b7fb5e225e7b8b3f17e4af Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/other/qaccessibility/tst_qaccessibility.cpp8
1 files changed, 3 insertions, 5 deletions
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());