summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/gui/util/qdesktopservices/tst_qdesktopservices.cpp44
-rw-r--r--tests/benchmarks/network/access/qnetworkdiskcache/tst_qnetworkdiskcache.cpp18
2 files changed, 9 insertions, 53 deletions
diff --git a/tests/auto/gui/util/qdesktopservices/tst_qdesktopservices.cpp b/tests/auto/gui/util/qdesktopservices/tst_qdesktopservices.cpp
index 270674d31f..64af6c9613 100644
--- a/tests/auto/gui/util/qdesktopservices/tst_qdesktopservices.cpp
+++ b/tests/auto/gui/util/qdesktopservices/tst_qdesktopservices.cpp
@@ -61,11 +61,6 @@ private slots:
void cleanup();
void openUrl();
void handlers();
- void storageLocation_data();
- void storageLocation();
-
- void storageLocationDoesNotEndWithSlash_data();
- void storageLocationDoesNotEndWithSlash();
};
tst_qdesktopservices::tst_qdesktopservices()
@@ -126,44 +121,5 @@ void tst_qdesktopservices::handlers()
QCOMPARE(barHandler.lastHandledUrl.toString(), barUrl.toString());
}
-Q_DECLARE_METATYPE(QDesktopServices::StandardLocation)
-void tst_qdesktopservices::storageLocation_data()
-{
- QTest::addColumn<QDesktopServices::StandardLocation>("location");
- QTest::newRow("DesktopLocation") << QDesktopServices::DesktopLocation;
- QTest::newRow("DocumentsLocation") << QDesktopServices::DocumentsLocation;
- QTest::newRow("FontsLocation") << QDesktopServices::FontsLocation;
- QTest::newRow("ApplicationsLocation") << QDesktopServices::ApplicationsLocation;
- QTest::newRow("MusicLocation") << QDesktopServices::MusicLocation;
- QTest::newRow("MoviesLocation") << QDesktopServices::MoviesLocation;
- QTest::newRow("PicturesLocation") << QDesktopServices::PicturesLocation;
- QTest::newRow("TempLocation") << QDesktopServices::TempLocation;
- QTest::newRow("HomeLocation") << QDesktopServices::HomeLocation;
- QTest::newRow("DataLocation") << QDesktopServices::DataLocation;
-}
-
-void tst_qdesktopservices::storageLocation()
-{
- QFETCH(QDesktopServices::StandardLocation, location);
- QDesktopServices::storageLocation(location);
- QDesktopServices::displayName(location);
-}
-
-void tst_qdesktopservices::storageLocationDoesNotEndWithSlash_data()
-{
- storageLocation_data();
-}
-
-void tst_qdesktopservices::storageLocationDoesNotEndWithSlash()
-{
- // Currently all desktop locations return their storage location
- // with "Unix-style" paths (i.e. they use a slash, not backslash).
- QFETCH(QDesktopServices::StandardLocation, location);
- QString loc = QDesktopServices::storageLocation(location);
- if (loc.size() > 1) // workaround for unlikely case of locations that return '/'
- QCOMPARE(loc.endsWith(QLatin1Char('/')), false);
-}
-
-
QTEST_MAIN(tst_qdesktopservices)
#include "tst_qdesktopservices.moc"
diff --git a/tests/benchmarks/network/access/qnetworkdiskcache/tst_qnetworkdiskcache.cpp b/tests/benchmarks/network/access/qnetworkdiskcache/tst_qnetworkdiskcache.cpp
index 3e1168e6fc..a81c71550d 100644
--- a/tests/benchmarks/network/access/qnetworkdiskcache/tst_qnetworkdiskcache.cpp
+++ b/tests/benchmarks/network/access/qnetworkdiskcache/tst_qnetworkdiskcache.cpp
@@ -47,7 +47,7 @@
#include <QDebug>
#include <QtTest/QtTest>
#include <QIODevice>
-#include <QDesktopServices>
+#include <QStandardPaths>
@@ -109,8 +109,8 @@ void tst_qnetworkdiskcache::timeInsertion_data()
{
QTest::addColumn<QString>("cacheRootDirectory");
- QString cacheLoc = QDesktopServices::storageLocation(QDesktopServices::CacheLocation);
- QTest::newRow("QDesktopServices Cache Location") << cacheLoc;
+ QString cacheLoc = QStandardPaths::writableLocation(QStandardPaths::CacheLocation);
+ QTest::newRow("QStandardPaths Cache Location") << cacheLoc;
}
//This functions times an insert() operation.
@@ -170,8 +170,8 @@ void tst_qnetworkdiskcache::timeRead_data()
{
QTest::addColumn<QString>("cacheRootDirectory");
- QString cacheLoc = QDesktopServices::storageLocation(QDesktopServices::CacheLocation);
- QTest::newRow("QDesktopServices Cache Location") << cacheLoc;
+ QString cacheLoc = QStandardPaths::writableLocation(QStandardPaths::CacheLocation);
+ QTest::newRow("QStandardPaths Cache Location") << cacheLoc;
}
//Times metadata as well payload lookup
@@ -229,8 +229,8 @@ void tst_qnetworkdiskcache::timeRemoval_data()
{
QTest::addColumn<QString>("cacheRootDirectory");
- QString cacheLoc = QDesktopServices::storageLocation(QDesktopServices::CacheLocation);
- QTest::newRow("QDesktopServices Cache Location") << cacheLoc;
+ QString cacheLoc = QStandardPaths::writableLocation(QStandardPaths::CacheLocation);
+ QTest::newRow("QStandardPaths Cache Location") << cacheLoc;
}
void tst_qnetworkdiskcache::timeRemoval()
@@ -279,8 +279,8 @@ void tst_qnetworkdiskcache::timeExpiration_data()
{
QTest::addColumn<QString>("cacheRootDirectory");
- QString cacheLoc = QDesktopServices::storageLocation(QDesktopServices::CacheLocation);
- QTest::newRow("QDesktopServices Cache Location") << cacheLoc;
+ QString cacheLoc = QStandardPaths::writableLocation(QStandardPaths::CacheLocation);
+ QTest::newRow("QStandardPaths Cache Location") << cacheLoc;
}
void tst_qnetworkdiskcache::timeExpiration()