Remove qSort usages from network tests
QtAlgorithms is getting deprecated, see http://www.mail-archive.com/development@qt-project.org/msg01603.html Change-Id: I31a701d8e17673edcb9bb7c32e6e6a87812a7fbc Reviewed-by: Peter Hartmann <phartmann@blackberry.com> Reviewed-by: Richard J. Moore <rich@kde.org>
This commit is contained in:
parent
ce46593e25
commit
817c4be91f
@ -50,6 +50,8 @@
|
||||
#include <QtNetwork/qnetworksession.h>
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#define TESTFILE QString("http://%1/qtest/cgi-bin/").arg(QtNetworkSettings::serverName())
|
||||
|
||||
class tst_QAbstractNetworkCache : public QObject
|
||||
@ -334,8 +336,8 @@ void tst_QAbstractNetworkCache::runTest()
|
||||
if (fetchFromCache) {
|
||||
QList<QByteArray> rawHeaderList = reply->rawHeaderList();
|
||||
QList<QByteArray> rawHeaderList2 = reply2->rawHeaderList();
|
||||
qSort(rawHeaderList);
|
||||
qSort(rawHeaderList2);
|
||||
std::sort(rawHeaderList.begin(), rawHeaderList.end());
|
||||
std::sort(rawHeaderList2.begin(), rawHeaderList2.end());
|
||||
}
|
||||
QCOMPARE(diskCache->gotData, fetchFromCache);
|
||||
}
|
||||
@ -388,8 +390,8 @@ void tst_QAbstractNetworkCache::checkSynchronous()
|
||||
if (fetchFromCache) {
|
||||
QList<QByteArray> rawHeaderList = reply->rawHeaderList();
|
||||
QList<QByteArray> rawHeaderList2 = reply2->rawHeaderList();
|
||||
qSort(rawHeaderList);
|
||||
qSort(rawHeaderList2);
|
||||
std::sort(rawHeaderList.begin(), rawHeaderList.end());
|
||||
std::sort(rawHeaderList2.begin(), rawHeaderList2.end());
|
||||
}
|
||||
QCOMPARE(diskCache->gotData, fetchFromCache);
|
||||
}
|
||||
|
@ -43,6 +43,9 @@
|
||||
#include <QtTest/QtTest>
|
||||
#include <QtNetwork/QtNetwork>
|
||||
#include <qnetworkdiskcache.h>
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#define EXAMPLE_URL "http://user:pass@www.example.com/#foo"
|
||||
//cached objects are organized into these many subdirs
|
||||
#define NUM_SUBDIRECTORIES 16
|
||||
@ -464,7 +467,7 @@ void tst_QNetworkDiskCache::expire()
|
||||
cacheList.append(metaData.url().toString());
|
||||
}
|
||||
}
|
||||
qSort(cacheList);
|
||||
std::sort(cacheList.begin(), cacheList.end());
|
||||
for (int i = 0; i < cacheList.count(); ++i) {
|
||||
QString fileName = cacheList[i];
|
||||
QCOMPARE(fileName, QString("http://www.foo.com/%1").arg(i + 6));
|
||||
|
Loading…
x
Reference in New Issue
Block a user