From 841750438b459ac9eaf2158b51f1d20f471ac1bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Fl=C3=B6ser?= Date: Thu, 15 Nov 2018 17:56:07 +0100 Subject: [PATCH] Fix KeyboardLayoutTest::testNumLock Summary: The layout from previous test leaked into this test if all tests are run together. This change ensures that a proper layout for this test is set. Test Plan: Test passes alone and when run together Reviewers: #kwin Subscribers: kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D16903 --- autotests/integration/keyboard_layout_test.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/autotests/integration/keyboard_layout_test.cpp b/autotests/integration/keyboard_layout_test.cpp index 13fbc9ca48..da97603471 100644 --- a/autotests/integration/keyboard_layout_test.cpp +++ b/autotests/integration/keyboard_layout_test.cpp @@ -462,7 +462,15 @@ void KeyboardLayoutTest::testApplicationPolicy() void KeyboardLayoutTest::testNumLock() { qputenv("KWIN_FORCE_NUM_LOCK_EVALUATION", "1"); + KConfigGroup layoutGroup = kwinApp()->kxkbConfig()->group("Layout"); + layoutGroup.writeEntry("LayoutList", QStringLiteral("us")); + layoutGroup.sync(); + reconfigureLayouts(); + auto xkb = input()->keyboard()->xkb(); + QTRY_COMPARE(xkb->numberOfLayouts(), 1u); + QTRY_COMPARE(xkb->layoutName(), QStringLiteral("English (US)")); + // by default not set QVERIFY(!xkb->modifiers().testFlag(Qt::KeypadModifier)); quint32 timestamp = 0;