From 13e51ea48758337397164a548d4c82d079067ae3 Mon Sep 17 00:00:00 2001 From: Kari Oikarinen Date: Mon, 19 Feb 2018 14:53:04 +0200 Subject: 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 Reviewed-by: Frederik Gladhorn Reviewed-by: Sami Nurmenniemi --- tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp') 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() -- cgit v1.2.3