]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Enable test mode in all test
authorElvis Angelaccio <elvis.angelaccio@kde.org>
Sat, 13 Mar 2021 16:18:53 +0000 (17:18 +0100)
committerElvis Angelaccio <elvis.angelaccio@kde.org>
Sat, 13 Mar 2021 16:18:53 +0000 (17:18 +0100)
13 files changed:
src/tests/dolphinquerytest.cpp
src/tests/dolphinsearchboxtest.cpp
src/tests/draganddrophelpertest.cpp
src/tests/kfileitemlistviewtest.cpp
src/tests/kfileitemmodelbenchmark.cpp
src/tests/kfileitemmodeltest.cpp
src/tests/kitemlistcontrollertest.cpp
src/tests/kitemlistkeyboardsearchmanagertest.cpp
src/tests/kitemlistselectionmanagertest.cpp
src/tests/kitemrangetest.cpp
src/tests/kitemsettest.cpp
src/tests/kstandarditemmodeltest.cpp
src/tests/viewpropertiestest.cpp

index dfee3dbd5b0fde4ce27f46f04b9713c50074af75..d0a590233495165289812530fed6b94d81f39f20 100644 (file)
@@ -11,6 +11,7 @@
 #include <QJsonDocument>
 #include <QJsonObject>
 #include <QStringList>
+#include <QStandardPaths>
 #include <QUrl>
 #include <QUrlQuery>
 
@@ -19,6 +20,7 @@ class DolphinSearchBoxTest : public QObject
     Q_OBJECT
 
 private Q_SLOTS:
+    void initTestCase();
     void testBalooSearchParsing_data();
     void testBalooSearchParsing();
 };
@@ -45,6 +47,11 @@ QUrl balooQueryUrl(const QString& searchString)
     return searchUrl;
 }
 
+void DolphinSearchBoxTest::initTestCase()
+{
+    QStandardPaths::setTestModeEnabled(true);
+}
+
 /**
  * Defines the parameters for the test cases in testBalooSearchParsing()
  */
index 0a2113facb66d65196a01751564379d621207f2f..56420e56e9f1fafe1b18954b3287360060623a3f 100644 (file)
@@ -6,6 +6,7 @@
 
 #include "search/dolphinsearchbox.h"
 
+#include <QStandardPaths>
 #include <QTest>
 
 class DolphinSearchBoxTest : public QObject
@@ -13,6 +14,7 @@ class DolphinSearchBoxTest : public QObject
     Q_OBJECT
 
 private Q_SLOTS:
+    void initTestCase();
     void init();
     void cleanup();
 
@@ -22,6 +24,11 @@ private:
     DolphinSearchBox* m_searchBox;
 };
 
+void DolphinSearchBoxTest::initTestCase()
+{
+    QStandardPaths::setTestModeEnabled(true);
+}
+
 void DolphinSearchBoxTest::init()
 {
     m_searchBox = new DolphinSearchBox();
index 9379347f0a0bd716e972fce294e731167510e079..a82e75c7b814bbccc45c1ea0cce58d860420cb22 100644 (file)
@@ -4,6 +4,7 @@
  * SPDX-License-Identifier: GPL-2.0-or-later
  */
 
+#include <QStandardPaths>
 #include <QTest>
 #include <views/draganddrophelper.h>
 
@@ -12,10 +13,16 @@ class DragAndDropHelperTest : public QObject
     Q_OBJECT
 
 private Q_SLOTS:
+    void initTestCase();
     void testUrlListMatchesUrl_data();
     void testUrlListMatchesUrl();
 };
 
+void DragAndDropHelperTest::initTestCase()
+{
+    QStandardPaths::setTestModeEnabled(true);
+}
+
 void DragAndDropHelperTest::testUrlListMatchesUrl_data()
 {
     QTest::addColumn<QList<QUrl>>("urlList");
index 2aa9941c7dd6ade2aea1ba2c7c61df3d710fd2fa..4a5cd063021dffc612ef49d0382e9d0448fe3341 100644 (file)
 #include <QGraphicsView>
 #include <QTest>
 #include <QSignalSpy>
+#include <QStandardPaths>
 
 class KFileItemListViewTest : public QObject
 {
     Q_OBJECT
 
 private Q_SLOTS:
+    void initTestCase();
     void init();
     void cleanup();
     void testGroupedItemChanges();
@@ -29,6 +31,11 @@ private:
     QGraphicsView* m_graphicsView;
 };
 
+void KFileItemListViewTest::initTestCase()
+{
+    QStandardPaths::setTestModeEnabled(true);
+}
+
 void KFileItemListViewTest::init()
 {
     qRegisterMetaType<KItemRangeList>("KItemRangeList");
index 5c44a354f613b4eb4cfa60ccf3db30211a7b2bba..8e307e2a153571e4a16beb4b1ee1e84b71ac30ca 100644 (file)
@@ -7,6 +7,7 @@
 
 #include <QTest>
 #include <QSignalSpy>
+#include <QStandardPaths>
 
 #include <random>
 
@@ -44,6 +45,7 @@ public:
     KFileItemModelBenchmark();
 
 private Q_SLOTS:
+    void initTestCase();
     void insertAndRemoveManyItems_data();
     void insertAndRemoveManyItems();
 
@@ -55,6 +57,11 @@ KFileItemModelBenchmark::KFileItemModelBenchmark()
 {
 }
 
+void KFileItemModelBenchmark::initTestCase()
+{
+    QStandardPaths::setTestModeEnabled(true);
+}
+
 void KFileItemModelBenchmark::insertAndRemoveManyItems_data()
 {
     QTest::addColumn<KFileItemList>("initialItems");
index bf3ce8aed706fb1131fcf1cad71995a722502fe3..558a00ab592475fb2b30a6a295967d2913221943 100644 (file)
@@ -8,6 +8,7 @@
 #include <QRandomGenerator>
 #include <QTest>
 #include <QSignalSpy>
+#include <QStandardPaths>
 #include <QTimer>
 #include <QMimeData>
 
@@ -47,6 +48,7 @@ class KFileItemModelTest : public QObject
 
 private Q_SLOTS:
     void init();
+    void initTestCase();
     void cleanup();
 
     void testDefaultRoles();
@@ -93,6 +95,11 @@ private:
     TestDir* m_testDir;
 };
 
+void KFileItemModelTest::initTestCase()
+{
+    QStandardPaths::setTestModeEnabled(true);
+}
+
 void KFileItemModelTest::init()
 {
     // The item-model tests result in a huge number of debugging
index eb938728d5c1415322dfcb0c8c374859a23ae3d4..4149a4d85c1b4d7fbc794b120c9731d6e7045a26 100644 (file)
@@ -16,6 +16,7 @@
 #include <QGraphicsSceneMouseEvent>
 #include <QSignalSpy>
 #include <QProxyStyle>
+#include <QStandardPaths>
 
 /**
  * \class KItemListControllerTestStyle is a proxy style for testing the
@@ -103,6 +104,7 @@ private:
  */
 void KItemListControllerTest::initTestCase()
 {
+    QStandardPaths::setTestModeEnabled(true);
     qRegisterMetaType<KItemSet>("KItemSet");
 
     m_testDir = new TestDir();
index 2005c9ccafcdd06433bba6ad9d349fa9c9718f23..686f98b514c139162220dc31cb31218193a9b56d 100644 (file)
@@ -8,12 +8,14 @@
 
 #include <QTest>
 #include <QSignalSpy>
+#include <QStandardPaths>
 
 class KItemListKeyboardSearchManagerTest : public QObject
 {
     Q_OBJECT
 
 private Q_SLOTS:
+    void initTestCase();
     void init();
 
     void testBasicKeyboardSearch();
@@ -25,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
index b1e3f54f817125ef54b3cfba606778e6d7106a4b..7f87fdcc85b3170e2d55acf5e84ce817e3bde925 100644 (file)
@@ -10,6 +10,7 @@
 
 #include <QTest>
 #include <QSignalSpy>
+#include <QStandardPaths>
 
 class DummyModel : public KItemModelBase
 {
@@ -52,6 +53,7 @@ class KItemListSelectionManagerTest : public QObject
     Q_OBJECT
 
 private Q_SLOTS:
+    void initTestCase();
     void init();
     void cleanup();
 
@@ -76,6 +78,11 @@ private:
     DummyModel* m_model;
 };
 
+void KItemListSelectionManagerTest::initTestCase()
+{
+    QStandardPaths::setTestModeEnabled(true);
+}
+
 void KItemListSelectionManagerTest::init()
 {
     m_model = new DummyModel();
index 2ebca2308185a04c09c0a0cb2f4a5686ea5ce337..c782acee755e7a707be68149a4fea397d0482d76 100644 (file)
@@ -6,6 +6,7 @@
 
 #include "kitemviews/kitemrange.h"
 
+#include <QStandardPaths>
 #include <QTest>
 
 Q_DECLARE_METATYPE(QVector<int>)
@@ -16,10 +17,16 @@ class KItemRangeTest : public QObject
     Q_OBJECT
 
 private Q_SLOTS:
+    void initTestCase();
     void testFromSortedContainer_data();
     void testFromSortedContainer();
 };
 
+void KItemRangeTest::initTestCase()
+{
+    QStandardPaths::setTestModeEnabled(true);
+}
+
 void KItemRangeTest::testFromSortedContainer_data()
 {
     QTest::addColumn<QVector<int> >("sortedNumbers");
index 9b40e150dc1d81cc07607ab7dc101832187e74d2..b5e0a82cd696c63400858054aeadde4e9350dd67 100644 (file)
@@ -6,6 +6,7 @@
 
 #include "kitemviews/kitemset.h"
 
+#include <QStandardPaths>
 #include <QTest>
 
 Q_DECLARE_METATYPE(KItemRangeList)
@@ -110,6 +111,8 @@ private:
 
 void KItemSetTest::initTestCase()
 {
+    QStandardPaths::setTestModeEnabled(true);
+
     m_testCases.insert("empty", KItemRangeList());
     m_testCases.insert("[0]", KItemRangeList() << KItemRange(0, 1));
     m_testCases.insert("[1]", KItemRangeList() << KItemRange(1, 1));
index c04e71524b057eb58c1f50aca49b6a156e552a33..943a85214e2dd1176818682115faafb8db728dc1 100644 (file)
@@ -10,6 +10,7 @@
 #include "kitemviews/kstandarditem.h"
 #include "kitemviews/kstandarditemmodel.h"
 
+#include <QStandardPaths>
 #include <QTest>
 
 class KStandardItemModelTest : public QObject
@@ -17,6 +18,7 @@ class KStandardItemModelTest : public QObject
     Q_OBJECT
 
 private Q_SLOTS:
+    void initTestCase();
     void init();
     void cleanup();
 
@@ -30,6 +32,11 @@ private:
     KStandardItemModel* m_model;
 };
 
+void KStandardItemModelTest::initTestCase()
+{
+    QStandardPaths::setTestModeEnabled(true);
+}
+
 void KStandardItemModelTest::init()
 {
     m_model = new KStandardItemModel();
index fb3023db5574eeb97624df92393b5bc087fd46da..14d59be0aa6956e8b2c5876450a400e1db487b64 100644 (file)
@@ -15,6 +15,7 @@ class ViewPropertiesTest : public QObject
     Q_OBJECT
 
 private Q_SLOTS:
+    void initTestCase();
     void init();
     void cleanup();
 
@@ -26,6 +27,11 @@ private:
     TestDir* m_testDir;
 };
 
+void ViewPropertiesTest::initTestCase()
+{
+    QStandardPaths::setTestModeEnabled(true);
+}
+
 void ViewPropertiesTest::init()
 {
     m_globalViewProps = GeneralSettings::self()->globalViewProps();