mirror of
https://invent.kde.org/system/dolphin
synced 2024-08-22 09:50:12 +00:00
Enable test mode in all test
This commit is contained in:
parent
c1cd4fdc91
commit
ffb80cb00d
|
@ -11,6 +11,7 @@
|
||||||
#include <QJsonDocument>
|
#include <QJsonDocument>
|
||||||
#include <QJsonObject>
|
#include <QJsonObject>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
#include <QStandardPaths>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#include <QUrlQuery>
|
#include <QUrlQuery>
|
||||||
|
|
||||||
|
@ -19,6 +20,7 @@ class DolphinSearchBoxTest : public QObject
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
|
void initTestCase();
|
||||||
void testBalooSearchParsing_data();
|
void testBalooSearchParsing_data();
|
||||||
void testBalooSearchParsing();
|
void testBalooSearchParsing();
|
||||||
};
|
};
|
||||||
|
@ -45,6 +47,11 @@ QUrl balooQueryUrl(const QString& searchString)
|
||||||
return searchUrl;
|
return searchUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DolphinSearchBoxTest::initTestCase()
|
||||||
|
{
|
||||||
|
QStandardPaths::setTestModeEnabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines the parameters for the test cases in testBalooSearchParsing()
|
* Defines the parameters for the test cases in testBalooSearchParsing()
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
#include "search/dolphinsearchbox.h"
|
#include "search/dolphinsearchbox.h"
|
||||||
|
|
||||||
|
#include <QStandardPaths>
|
||||||
#include <QTest>
|
#include <QTest>
|
||||||
|
|
||||||
class DolphinSearchBoxTest : public QObject
|
class DolphinSearchBoxTest : public QObject
|
||||||
|
@ -13,6 +14,7 @@ class DolphinSearchBoxTest : public QObject
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
|
void initTestCase();
|
||||||
void init();
|
void init();
|
||||||
void cleanup();
|
void cleanup();
|
||||||
|
|
||||||
|
@ -22,6 +24,11 @@ private:
|
||||||
DolphinSearchBox* m_searchBox;
|
DolphinSearchBox* m_searchBox;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void DolphinSearchBoxTest::initTestCase()
|
||||||
|
{
|
||||||
|
QStandardPaths::setTestModeEnabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
void DolphinSearchBoxTest::init()
|
void DolphinSearchBoxTest::init()
|
||||||
{
|
{
|
||||||
m_searchBox = new DolphinSearchBox();
|
m_searchBox = new DolphinSearchBox();
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <QStandardPaths>
|
||||||
#include <QTest>
|
#include <QTest>
|
||||||
#include <views/draganddrophelper.h>
|
#include <views/draganddrophelper.h>
|
||||||
|
|
||||||
|
@ -12,10 +13,16 @@ class DragAndDropHelperTest : public QObject
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
|
void initTestCase();
|
||||||
void testUrlListMatchesUrl_data();
|
void testUrlListMatchesUrl_data();
|
||||||
void testUrlListMatchesUrl();
|
void testUrlListMatchesUrl();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void DragAndDropHelperTest::initTestCase()
|
||||||
|
{
|
||||||
|
QStandardPaths::setTestModeEnabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
void DragAndDropHelperTest::testUrlListMatchesUrl_data()
|
void DragAndDropHelperTest::testUrlListMatchesUrl_data()
|
||||||
{
|
{
|
||||||
QTest::addColumn<QList<QUrl>>("urlList");
|
QTest::addColumn<QList<QUrl>>("urlList");
|
||||||
|
|
|
@ -12,12 +12,14 @@
|
||||||
#include <QGraphicsView>
|
#include <QGraphicsView>
|
||||||
#include <QTest>
|
#include <QTest>
|
||||||
#include <QSignalSpy>
|
#include <QSignalSpy>
|
||||||
|
#include <QStandardPaths>
|
||||||
|
|
||||||
class KFileItemListViewTest : public QObject
|
class KFileItemListViewTest : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
|
void initTestCase();
|
||||||
void init();
|
void init();
|
||||||
void cleanup();
|
void cleanup();
|
||||||
void testGroupedItemChanges();
|
void testGroupedItemChanges();
|
||||||
|
@ -29,6 +31,11 @@ private:
|
||||||
QGraphicsView* m_graphicsView;
|
QGraphicsView* m_graphicsView;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void KFileItemListViewTest::initTestCase()
|
||||||
|
{
|
||||||
|
QStandardPaths::setTestModeEnabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
void KFileItemListViewTest::init()
|
void KFileItemListViewTest::init()
|
||||||
{
|
{
|
||||||
qRegisterMetaType<KItemRangeList>("KItemRangeList");
|
qRegisterMetaType<KItemRangeList>("KItemRangeList");
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
#include <QTest>
|
#include <QTest>
|
||||||
#include <QSignalSpy>
|
#include <QSignalSpy>
|
||||||
|
#include <QStandardPaths>
|
||||||
|
|
||||||
#include <random>
|
#include <random>
|
||||||
|
|
||||||
|
@ -44,6 +45,7 @@ public:
|
||||||
KFileItemModelBenchmark();
|
KFileItemModelBenchmark();
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
|
void initTestCase();
|
||||||
void insertAndRemoveManyItems_data();
|
void insertAndRemoveManyItems_data();
|
||||||
void insertAndRemoveManyItems();
|
void insertAndRemoveManyItems();
|
||||||
|
|
||||||
|
@ -55,6 +57,11 @@ KFileItemModelBenchmark::KFileItemModelBenchmark()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void KFileItemModelBenchmark::initTestCase()
|
||||||
|
{
|
||||||
|
QStandardPaths::setTestModeEnabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
void KFileItemModelBenchmark::insertAndRemoveManyItems_data()
|
void KFileItemModelBenchmark::insertAndRemoveManyItems_data()
|
||||||
{
|
{
|
||||||
QTest::addColumn<KFileItemList>("initialItems");
|
QTest::addColumn<KFileItemList>("initialItems");
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include <QRandomGenerator>
|
#include <QRandomGenerator>
|
||||||
#include <QTest>
|
#include <QTest>
|
||||||
#include <QSignalSpy>
|
#include <QSignalSpy>
|
||||||
|
#include <QStandardPaths>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QMimeData>
|
#include <QMimeData>
|
||||||
|
|
||||||
|
@ -47,6 +48,7 @@ class KFileItemModelTest : public QObject
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void init();
|
void init();
|
||||||
|
void initTestCase();
|
||||||
void cleanup();
|
void cleanup();
|
||||||
|
|
||||||
void testDefaultRoles();
|
void testDefaultRoles();
|
||||||
|
@ -93,6 +95,11 @@ private:
|
||||||
TestDir* m_testDir;
|
TestDir* m_testDir;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void KFileItemModelTest::initTestCase()
|
||||||
|
{
|
||||||
|
QStandardPaths::setTestModeEnabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
void KFileItemModelTest::init()
|
void KFileItemModelTest::init()
|
||||||
{
|
{
|
||||||
// The item-model tests result in a huge number of debugging
|
// The item-model tests result in a huge number of debugging
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
#include <QGraphicsSceneMouseEvent>
|
#include <QGraphicsSceneMouseEvent>
|
||||||
#include <QSignalSpy>
|
#include <QSignalSpy>
|
||||||
#include <QProxyStyle>
|
#include <QProxyStyle>
|
||||||
|
#include <QStandardPaths>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \class KItemListControllerTestStyle is a proxy style for testing the
|
* \class KItemListControllerTestStyle is a proxy style for testing the
|
||||||
|
@ -103,6 +104,7 @@ private:
|
||||||
*/
|
*/
|
||||||
void KItemListControllerTest::initTestCase()
|
void KItemListControllerTest::initTestCase()
|
||||||
{
|
{
|
||||||
|
QStandardPaths::setTestModeEnabled(true);
|
||||||
qRegisterMetaType<KItemSet>("KItemSet");
|
qRegisterMetaType<KItemSet>("KItemSet");
|
||||||
|
|
||||||
m_testDir = new TestDir();
|
m_testDir = new TestDir();
|
||||||
|
|
|
@ -8,12 +8,14 @@
|
||||||
|
|
||||||
#include <QTest>
|
#include <QTest>
|
||||||
#include <QSignalSpy>
|
#include <QSignalSpy>
|
||||||
|
#include <QStandardPaths>
|
||||||
|
|
||||||
class KItemListKeyboardSearchManagerTest : public QObject
|
class KItemListKeyboardSearchManagerTest : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
|
void initTestCase();
|
||||||
void init();
|
void init();
|
||||||
|
|
||||||
void testBasicKeyboardSearch();
|
void testBasicKeyboardSearch();
|
||||||
|
@ -25,6 +27,11 @@ private:
|
||||||
KItemListKeyboardSearchManager m_keyboardSearchManager;
|
KItemListKeyboardSearchManager m_keyboardSearchManager;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void KItemListKeyboardSearchManagerTest::initTestCase()
|
||||||
|
{
|
||||||
|
QStandardPaths::setTestModeEnabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
void KItemListKeyboardSearchManagerTest::init()
|
void KItemListKeyboardSearchManagerTest::init()
|
||||||
{
|
{
|
||||||
// Make sure that the previous search string is cleared
|
// Make sure that the previous search string is cleared
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
|
|
||||||
#include <QTest>
|
#include <QTest>
|
||||||
#include <QSignalSpy>
|
#include <QSignalSpy>
|
||||||
|
#include <QStandardPaths>
|
||||||
|
|
||||||
class DummyModel : public KItemModelBase
|
class DummyModel : public KItemModelBase
|
||||||
{
|
{
|
||||||
|
@ -52,6 +53,7 @@ class KItemListSelectionManagerTest : public QObject
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
|
void initTestCase();
|
||||||
void init();
|
void init();
|
||||||
void cleanup();
|
void cleanup();
|
||||||
|
|
||||||
|
@ -76,6 +78,11 @@ private:
|
||||||
DummyModel* m_model;
|
DummyModel* m_model;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void KItemListSelectionManagerTest::initTestCase()
|
||||||
|
{
|
||||||
|
QStandardPaths::setTestModeEnabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
void KItemListSelectionManagerTest::init()
|
void KItemListSelectionManagerTest::init()
|
||||||
{
|
{
|
||||||
m_model = new DummyModel();
|
m_model = new DummyModel();
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
#include "kitemviews/kitemrange.h"
|
#include "kitemviews/kitemrange.h"
|
||||||
|
|
||||||
|
#include <QStandardPaths>
|
||||||
#include <QTest>
|
#include <QTest>
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(QVector<int>)
|
Q_DECLARE_METATYPE(QVector<int>)
|
||||||
|
@ -16,10 +17,16 @@ class KItemRangeTest : public QObject
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
|
void initTestCase();
|
||||||
void testFromSortedContainer_data();
|
void testFromSortedContainer_data();
|
||||||
void testFromSortedContainer();
|
void testFromSortedContainer();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void KItemRangeTest::initTestCase()
|
||||||
|
{
|
||||||
|
QStandardPaths::setTestModeEnabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
void KItemRangeTest::testFromSortedContainer_data()
|
void KItemRangeTest::testFromSortedContainer_data()
|
||||||
{
|
{
|
||||||
QTest::addColumn<QVector<int> >("sortedNumbers");
|
QTest::addColumn<QVector<int> >("sortedNumbers");
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
#include "kitemviews/kitemset.h"
|
#include "kitemviews/kitemset.h"
|
||||||
|
|
||||||
|
#include <QStandardPaths>
|
||||||
#include <QTest>
|
#include <QTest>
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(KItemRangeList)
|
Q_DECLARE_METATYPE(KItemRangeList)
|
||||||
|
@ -110,6 +111,8 @@ private:
|
||||||
|
|
||||||
void KItemSetTest::initTestCase()
|
void KItemSetTest::initTestCase()
|
||||||
{
|
{
|
||||||
|
QStandardPaths::setTestModeEnabled(true);
|
||||||
|
|
||||||
m_testCases.insert("empty", KItemRangeList());
|
m_testCases.insert("empty", KItemRangeList());
|
||||||
m_testCases.insert("[0]", KItemRangeList() << KItemRange(0, 1));
|
m_testCases.insert("[0]", KItemRangeList() << KItemRange(0, 1));
|
||||||
m_testCases.insert("[1]", KItemRangeList() << KItemRange(1, 1));
|
m_testCases.insert("[1]", KItemRangeList() << KItemRange(1, 1));
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include "kitemviews/kstandarditem.h"
|
#include "kitemviews/kstandarditem.h"
|
||||||
#include "kitemviews/kstandarditemmodel.h"
|
#include "kitemviews/kstandarditemmodel.h"
|
||||||
|
|
||||||
|
#include <QStandardPaths>
|
||||||
#include <QTest>
|
#include <QTest>
|
||||||
|
|
||||||
class KStandardItemModelTest : public QObject
|
class KStandardItemModelTest : public QObject
|
||||||
|
@ -17,6 +18,7 @@ class KStandardItemModelTest : public QObject
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
|
void initTestCase();
|
||||||
void init();
|
void init();
|
||||||
void cleanup();
|
void cleanup();
|
||||||
|
|
||||||
|
@ -30,6 +32,11 @@ private:
|
||||||
KStandardItemModel* m_model;
|
KStandardItemModel* m_model;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void KStandardItemModelTest::initTestCase()
|
||||||
|
{
|
||||||
|
QStandardPaths::setTestModeEnabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
void KStandardItemModelTest::init()
|
void KStandardItemModelTest::init()
|
||||||
{
|
{
|
||||||
m_model = new KStandardItemModel();
|
m_model = new KStandardItemModel();
|
||||||
|
|
|
@ -15,6 +15,7 @@ class ViewPropertiesTest : public QObject
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
|
void initTestCase();
|
||||||
void init();
|
void init();
|
||||||
void cleanup();
|
void cleanup();
|
||||||
|
|
||||||
|
@ -26,6 +27,11 @@ private:
|
||||||
TestDir* m_testDir;
|
TestDir* m_testDir;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void ViewPropertiesTest::initTestCase()
|
||||||
|
{
|
||||||
|
QStandardPaths::setTestModeEnabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
void ViewPropertiesTest::init()
|
void ViewPropertiesTest::init()
|
||||||
{
|
{
|
||||||
m_globalViewProps = GeneralSettings::self()->globalViewProps();
|
m_globalViewProps = GeneralSettings::self()->globalViewProps();
|
||||||
|
|
Loading…
Reference in a new issue