Skip to content

Commit

Permalink
Don't crash if focus issues arise.
Browse files Browse the repository at this point in the history
The test has some strict focus requirements, but if they are not met
then the test should FAIL with a bit of explanation instead of crash.

Change-Id: I796e8a8092833f3413b3dc98a22466575dfe241d
Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
  • Loading branch information
Alan Alpert authored and Qt by Nokia committed Feb 9, 2012
1 parent 5060b58 commit 5ba6373
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/auto/qtquick2/qquicktextinput/tst_qquicktextinput.cpp
Expand Up @@ -1527,6 +1527,7 @@ void tst_qquicktextinput::positionAt()
textinputObject->setCursorPosition(0);

{ QInputMethodEvent inputEvent(preeditText, QList<QInputMethodEvent::Attribute>());
QVERIFY(qGuiApp->focusObject());
QGuiApplication::sendEvent(qGuiApp->focusObject(), &inputEvent); }

// Check all points within the preedit text return the same position.
Expand All @@ -1539,6 +1540,7 @@ void tst_qquicktextinput::positionAt()
QCOMPARE(textinputObject->positionToRectangle(1).x(), x1);

{ QInputMethodEvent inputEvent;
QVERIFY(qGuiApp->focusObject());
QGuiApplication::sendEvent(qGuiApp->focusObject(), &inputEvent); }

// With wrapping.
Expand Down

0 comments on commit 5ba6373

Please sign in to comment.