diff options
author | Jason McDonald <jason.mcdonald@nokia.com> | 2011-04-19 03:55:05 (GMT) |
---|---|---|
committer | Jason McDonald <jason.mcdonald@nokia.com> | 2011-04-19 04:06:35 (GMT) |
commit | d8dc5bfdff25d72e8276c6e80080d72315abe7e0 (patch) | |
tree | 4fd5f933289bbb9f8449abcf0dcf72906f9b9fb0 | |
parent | 1191dc0c278ddd22556d6c8e5ea5a898fa7b35f6 (diff) | |
download | Qt-d8dc5bfdff25d72e8276c6e80080d72315abe7e0.zip Qt-d8dc5bfdff25d72e8276c6e80080d72315abe7e0.tar.gz Qt-d8dc5bfdff25d72e8276c6e80080d72315abe7e0.tar.bz2 |
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
-rw-r--r-- | tests/auto/qaccessibility/tst_qaccessibility.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/auto/qaccessibility/tst_qaccessibility.cpp b/tests/auto/qaccessibility/tst_qaccessibility.cpp index 8e68363..fe0200a 100644 --- a/tests/auto/qaccessibility/tst_qaccessibility.cpp +++ b/tests/auto/qaccessibility/tst_qaccessibility.cpp @@ -368,8 +368,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; } |