]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/tests/dolphinquerytest.cpp
Merge branch 'release/21.12'
[dolphin.git] / src / tests / dolphinquerytest.cpp
index 46440405812969786d078439201e77070d4a1264..2b025eed74960029ea9b9065983b2aee1ec5ec67 100644 (file)
 #include <QJsonDocument>
 #include <QJsonObject>
 #include <QStringList>
+#include <QStandardPaths>
 #include <QUrl>
 #include <QUrlQuery>
 
-class DolphinSearchBoxTest : public QObject
+class DolphinQueryTest : public QObject
 {
     Q_OBJECT
 
-private slots:
+private Q_SLOTS:
+    void initTestCase();
     void testBalooSearchParsing_data();
     void testBalooSearchParsing();
 };
@@ -45,10 +47,15 @@ QUrl balooQueryUrl(const QString& searchString)
     return searchUrl;
 }
 
+void DolphinQueryTest::initTestCase()
+{
+    QStandardPaths::setTestModeEnabled(true);
+}
+
 /**
  * Defines the parameters for the test cases in testBalooSearchParsing()
  */
-void DolphinSearchBoxTest::testBalooSearchParsing_data()
+void DolphinQueryTest::testBalooSearchParsing_data()
 {
 
     QTest::addColumn<QUrl>("searchUrl");
@@ -153,7 +160,7 @@ void DolphinSearchBoxTest::testBalooSearchParsing_data()
  * properly handled by the searchbox, and only "user" or filename terms are added to the
  * text bar of the searchbox.
  */
-void DolphinSearchBoxTest::testBalooSearchParsing()
+void DolphinQueryTest::testBalooSearchParsing()
 {
     QFETCH(QUrl, searchUrl);
     QFETCH(QString, expectedText);
@@ -183,6 +190,6 @@ void DolphinSearchBoxTest::testBalooSearchParsing()
     QCOMPARE(query.hasFileName(), hasFileName);
 }
 
-QTEST_MAIN(DolphinSearchBoxTest)
+QTEST_MAIN(DolphinQueryTest)
 
 #include "dolphinquerytest.moc"