Make tst_qabstractnetworkcache parallel-safe
Use a unique QTemporaryDir instead of a fixed path for the test cache. Change-Id: Ib664033a509a6cefd7c323708f80ef595b202178 Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>bb10
parent
55d0c6c6cf
commit
9469e9fdeb
|
|
@ -1,4 +1,5 @@
|
|||
CONFIG += testcase
|
||||
CONFIG += parallel_test
|
||||
TARGET = tst_qabstractnetworkcache
|
||||
QT += network testlib
|
||||
QT -= gui
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@
|
|||
**
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
#include <QTemporaryDir>
|
||||
#include <QtTest/QtTest>
|
||||
#include <QtNetwork/QtNetwork>
|
||||
#include "../../../network-settings.h"
|
||||
|
|
@ -101,10 +101,10 @@ class NetworkDiskCache : public QNetworkDiskCache
|
|||
public:
|
||||
NetworkDiskCache(QObject *parent = 0)
|
||||
: QNetworkDiskCache(parent)
|
||||
, tempDir(QDir::tempPath() + QLatin1String("/tst_qabstractnetworkcache.XXXXXX"))
|
||||
, gotData(false)
|
||||
{
|
||||
QString location = QDir::tempPath() + QLatin1String("/tst_qnetworkdiskcache/");
|
||||
setCacheDirectory(location);
|
||||
setCacheDirectory(tempDir.path());
|
||||
clear();
|
||||
}
|
||||
|
||||
|
|
@ -114,6 +114,7 @@ public:
|
|||
return QNetworkDiskCache::data(url);
|
||||
}
|
||||
|
||||
QTemporaryDir tempDir;
|
||||
bool gotData;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue