diff options
author | Kari Oikarinen <kari.oikarinen@qt.io> | 2018-02-19 14:53:04 +0200 |
---|---|---|
committer | Kari Oikarinen <kari.oikarinen@qt.io> | 2018-02-19 14:24:09 +0000 |
commit | 13e51ea48758337397164a548d4c82d079067ae3 (patch) | |
tree | 57b3609bd80a4c894f208abc1b8e28c0130869fe /tests/auto/widgets/widgets/qlineedit | |
parent | 0d4ce766ae7dd2eb36dc2d64b97808763457e915 (diff) |
QLineEdit: Clear input context commit string after test functions
Since the PlatformInputContext is shared between test cases, the set commit
string from inputMethod() was otherwise saved and could pollute other tests.
For example on Windows PlatformInputContext::commit() was called when the
QLineEdit was first clicked onto in tst_QLineEdit::testQuickSelectionWithMouse()
and inserted "text" in the middle of the text, rather than starting selection as
intended.
This led to tst_QLineEdit::testQuickSelectionWithMouse() failing on Windows at
first in CI, but then always passing the repeats when it was tested alone.
Task-number: QTBUG-66499
Task-number: QTBUG-66216
Change-Id: Id6bdd263d57fd6d08fb48f013542b55b132907ea
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
Diffstat (limited to 'tests/auto/widgets/widgets/qlineedit')
-rw-r--r-- | tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp index 1513025f16..0be8d319c2 100644 --- a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp +++ b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp @@ -411,6 +411,7 @@ void tst_QLineEdit::cleanup() { delete m_testWidget; m_testWidget = 0; + m_platformInputContext.m_commitString.clear(); } void tst_QLineEdit::experimental() |