┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorElvis Angelaccio <[email protected]>2021-03-13 17:18:53 +0100
committerElvis Angelaccio <[email protected]>2021-03-13 17:18:53 +0100
commitffb80cb00d8fd886051f970b5155a55b1d066fcd (patch)
treee684d3bc61dcd0951d65520f0d79f140d31a0075 /src/tests
parentc1cd4fdc913857ca0c09858bc184a91dd3842235 (diff)
Enable test mode in all test
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/dolphinquerytest.cpp7
-rw-r--r--src/tests/dolphinsearchboxtest.cpp7
-rw-r--r--src/tests/draganddrophelpertest.cpp7
-rw-r--r--src/tests/kfileitemlistviewtest.cpp7
-rw-r--r--src/tests/kfileitemmodelbenchmark.cpp7
-rw-r--r--src/tests/kfileitemmodeltest.cpp7
-rw-r--r--src/tests/kitemlistcontrollertest.cpp2
-rw-r--r--src/tests/kitemlistkeyboardsearchmanagertest.cpp7
-rw-r--r--src/tests/kitemlistselectionmanagertest.cpp7
-rw-r--r--src/tests/kitemrangetest.cpp7
-rw-r--r--src/tests/kitemsettest.cpp3
-rw-r--r--src/tests/kstandarditemmodeltest.cpp7
-rw-r--r--src/tests/viewpropertiestest.cpp6
13 files changed, 81 insertions, 0 deletions
diff --git a/src/tests/dolphinquerytest.cpp b/src/tests/dolphinquerytest.cpp
index dfee3dbd5..d0a590233 100644
--- a/src/tests/dolphinquerytest.cpp
+++ b/src/tests/dolphinquerytest.cpp
@@ -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()
*/
diff --git a/src/tests/dolphinsearchboxtest.cpp b/src/tests/dolphinsearchboxtest.cpp
index 0a2113fac..56420e56e 100644
--- a/src/tests/dolphinsearchboxtest.cpp
+++ b/src/tests/dolphinsearchboxtest.cpp
@@ -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();
diff --git a/src/tests/draganddrophelpertest.cpp b/src/tests/draganddrophelpertest.cpp
index 9379347f0..a82e75c7b 100644
--- a/src/tests/draganddrophelpertest.cpp
+++ b/src/tests/draganddrophelpertest.cpp
@@ -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");
diff --git a/src/tests/kfileitemlistviewtest.cpp b/src/tests/kfileitemlistviewtest.cpp
index 2aa9941c7..4a5cd0630 100644
--- a/src/tests/kfileitemlistviewtest.cpp
+++ b/src/tests/kfileitemlistviewtest.cpp
@@ -12,12 +12,14 @@
#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");
diff --git a/src/tests/kfileitemmodelbenchmark.cpp b/src/tests/kfileitemmodelbenchmark.cpp
index 5c44a354f..8e307e2a1 100644
--- a/src/tests/kfileitemmodelbenchmark.cpp
+++ b/src/tests/kfileitemmodelbenchmark.cpp
@@ -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");
diff --git a/src/tests/kfileitemmodeltest.cpp b/src/tests/kfileitemmodeltest.cpp
index bf3ce8aed..558a00ab5 100644
--- a/src/tests/kfileitemmodeltest.cpp
+++ b/src/tests/kfileitemmodeltest.cpp
@@ -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
diff --git a/src/tests/kitemlistcontrollertest.cpp b/src/tests/kitemlistcontrollertest.cpp
index eb938728d..4149a4d85 100644
--- a/src/tests/kitemlistcontrollertest.cpp
+++ b/src/tests/kitemlistcontrollertest.cpp
@@ -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();
diff --git a/src/tests/kitemlistkeyboardsearchmanagertest.cpp b/src/tests/kitemlistkeyboardsearchmanagertest.cpp
index 2005c9cca..686f98b51 100644
--- a/src/tests/kitemlistkeyboardsearchmanagertest.cpp
+++ b/src/tests/kitemlistkeyboardsearchmanagertest.cpp
@@ -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
diff --git a/src/tests/kitemlistselectionmanagertest.cpp b/src/tests/kitemlistselectionmanagertest.cpp
index b1e3f54f8..7f87fdcc8 100644
--- a/src/tests/kitemlistselectionmanagertest.cpp
+++ b/src/tests/kitemlistselectionmanagertest.cpp
@@ -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();
diff --git a/src/tests/kitemrangetest.cpp b/src/tests/kitemrangetest.cpp
index 2ebca2308..c782acee7 100644
--- a/src/tests/kitemrangetest.cpp
+++ b/src/tests/kitemrangetest.cpp
@@ -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");
diff --git a/src/tests/kitemsettest.cpp b/src/tests/kitemsettest.cpp
index 9b40e150d..b5e0a82cd 100644
--- a/src/tests/kitemsettest.cpp
+++ b/src/tests/kitemsettest.cpp
@@ -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));
diff --git a/src/tests/kstandarditemmodeltest.cpp b/src/tests/kstandarditemmodeltest.cpp
index c04e71524..943a85214 100644
--- a/src/tests/kstandarditemmodeltest.cpp
+++ b/src/tests/kstandarditemmodeltest.cpp
@@ -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();
diff --git a/src/tests/viewpropertiestest.cpp b/src/tests/viewpropertiestest.cpp
index fb3023db5..14d59be0a 100644
--- a/src/tests/viewpropertiestest.cpp
+++ b/src/tests/viewpropertiestest.cpp
@@ -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();