X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/a5ce798f282b6cf9e153bba89f9caea0cec37da0..50b2bce82d6604702e327f594448c7fee0f85a4a:/src/tests/kitemlistkeyboardsearchmanagertest.cpp diff --git a/src/tests/kitemlistkeyboardsearchmanagertest.cpp b/src/tests/kitemlistkeyboardsearchmanagertest.cpp index 53ef9ec3c..bbdb9c397 100644 --- a/src/tests/kitemlistkeyboardsearchmanagertest.cpp +++ b/src/tests/kitemlistkeyboardsearchmanagertest.cpp @@ -1,32 +1,21 @@ -/*************************************************************************** - * Copyright (C) 2011 by Frank Reininghaus * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - ***************************************************************************/ +/* + * SPDX-FileCopyrightText: 2011 Frank Reininghaus + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ #include "kitemviews/private/kitemlistkeyboardsearchmanager.h" -#include #include +#include +#include class KItemListKeyboardSearchManagerTest : public QObject { Q_OBJECT -private slots: +private Q_SLOTS: + void initTestCase(); void init(); void testBasicKeyboardSearch(); @@ -38,6 +27,11 @@ private: KItemListKeyboardSearchManager m_keyboardSearchManager; }; +void KItemListKeyboardSearchManagerTest::initTestCase() +{ + QStandardPaths::setTestModeEnabled(true); +} + void KItemListKeyboardSearchManagerTest::init() { // Make sure that the previous search string is cleared @@ -51,7 +45,7 @@ void KItemListKeyboardSearchManagerTest::testBasicKeyboardSearch() m_keyboardSearchManager.addKeys("f"); QCOMPARE(spy.count(), 1); - QCOMPARE(spy.takeFirst(), QList() << "f" << false); + QCOMPARE(spy.takeFirst(), QList() << "f" << true); m_keyboardSearchManager.addKeys("i"); QCOMPARE(spy.count(), 1); @@ -77,7 +71,7 @@ void KItemListKeyboardSearchManagerTest::testAbortedKeyboardSearch() m_keyboardSearchManager.addKeys("f"); QCOMPARE(spy.count(), 1); - QCOMPARE(spy.takeFirst(), QList() << "f" << false); + QCOMPARE(spy.takeFirst(), QList() << "f" << true); m_keyboardSearchManager.addKeys("i"); QCOMPARE(spy.count(), 1); @@ -100,7 +94,7 @@ void KItemListKeyboardSearchManagerTest::testAbortedKeyboardSearch() m_keyboardSearchManager.addKeys("a"); QCOMPARE(spy.count(), 1); - QCOMPARE(spy.takeFirst(), QList() << "a" << false); + QCOMPARE(spy.takeFirst(), QList() << "a" << true); } void KItemListKeyboardSearchManagerTest::testRepeatedKeyPress() @@ -116,7 +110,7 @@ void KItemListKeyboardSearchManagerTest::testRepeatedKeyPress() m_keyboardSearchManager.addKeys("p"); QCOMPARE(spy.count(), 1); - QCOMPARE(spy.takeFirst(), QList() << "p" << false); + QCOMPARE(spy.takeFirst(), QList() << "p" << true); m_keyboardSearchManager.addKeys("p"); QCOMPARE(spy.count(), 1); @@ -145,7 +139,7 @@ void KItemListKeyboardSearchManagerTest::testPressShift() // Simulate that the user enters "a_b". m_keyboardSearchManager.addKeys("a"); QCOMPARE(spy.count(), 1); - QCOMPARE(spy.takeFirst(), QList() << "a" << false); + QCOMPARE(spy.takeFirst(), QList() << "a" << true); m_keyboardSearchManager.addKeys(""); QCOMPARE(spy.count(), 0);