X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/a06ee3399bece608790e419054f95807a017a020..1e5bc5b3d6ba344da09369802d822f6cd6da7c4c:/src/tests/dolphinsearchboxtest.cpp diff --git a/src/tests/dolphinsearchboxtest.cpp b/src/tests/dolphinsearchboxtest.cpp index 862a398a5..bda60909d 100644 --- a/src/tests/dolphinsearchboxtest.cpp +++ b/src/tests/dolphinsearchboxtest.cpp @@ -1,40 +1,34 @@ -/*************************************************************************** - * Copyright (C) 2011 by Peter Penz * - * * - * 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 Peter Penz + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ #include "search/dolphinsearchbox.h" +#include #include class DolphinSearchBoxTest : public QObject { Q_OBJECT -private slots: +private Q_SLOTS: + void initTestCase(); void init(); void cleanup(); void testTextClearing(); private: - DolphinSearchBox* m_searchBox; + DolphinSearchBox *m_searchBox; }; +void DolphinSearchBoxTest::initTestCase() +{ + QStandardPaths::setTestModeEnabled(true); +} + void DolphinSearchBoxTest::init() { m_searchBox = new DolphinSearchBox(); @@ -52,13 +46,13 @@ void DolphinSearchBoxTest::cleanup() */ void DolphinSearchBoxTest::testTextClearing() { - m_searchBox->show(); + m_searchBox->setVisible(true, WithoutAnimation); QVERIFY(m_searchBox->text().isEmpty()); m_searchBox->setText("xyz"); - m_searchBox->hide(); - m_searchBox->show(); - QCOMPARE(m_searchBox->text(), QString("xyz")); + m_searchBox->setVisible(false, WithoutAnimation); + m_searchBox->setVisible(true, WithoutAnimation); + QCOMPARE(m_searchBox->text(), QStringLiteral("xyz")); QTest::keyClick(m_searchBox, Qt::Key_Escape); QVERIFY(m_searchBox->text().isEmpty());