summaryrefslogtreecommitdiffstats
path: root/tests/auto/qaccessibility
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2011-04-19 13:55:05 +1000
committerRohan McGovern <rohan.mcgovern@nokia.com>2011-05-18 10:46:40 +1000
commit6bc4d8b58fb3bc152c00ac75f67eb6a460ae639a (patch)
tree1122b1fbedb269ec2450d86872b93fb90c2aa07c /tests/auto/qaccessibility
parent29851474c70c5e2a5e3d521c0db3abf0837d8df0 (diff)
Remove Q_ASSERT from accessibility autotest
Instead of crashing when we can't get a QAccessibleInterface for a widget, output a useful warning and return a value that makes the test fail gracefully. Change-Id: I0b292cdd8f5a59e26bdc9b0b67cea2b58591df7d Task-number: QTBUG-17582 Reviewed-by: Rohan McGovern (cherry picked from commit d8dc5bfdff25d72e8276c6e80080d72315abe7e0)
Diffstat (limited to 'tests/auto/qaccessibility')
-rw-r--r--tests/auto/qaccessibility/tst_qaccessibility.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/auto/qaccessibility/tst_qaccessibility.cpp b/tests/auto/qaccessibility/tst_qaccessibility.cpp
index 6e580cbba3..5841e95165 100644
--- a/tests/auto/qaccessibility/tst_qaccessibility.cpp
+++ b/tests/auto/qaccessibility/tst_qaccessibility.cpp
@@ -371,8 +371,9 @@ static QString stateNames(int state)
QAccessible::State state(QWidget * const widget)
{
QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(widget);
- Q_ASSERT(iface);
- QAccessible::State state = iface->state(0);
+ if (!iface)
+ qWarning() << "Cannot get QAccessibleInterface for widget";
+ QAccessible::State state = (iface ? iface->state(0) : static_cast<QAccessible::State>(0));
delete iface;
return state;
}