From c68f4367f6bc379aeb27e63bf5ba67f34ddb5192 Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Tue, 29 May 2012 09:33:15 +1000 Subject: [PATCH] Make tst_qnetworkreply parallel-safe. Ensure we always use a unique filename when writing to test files. The test already contained code for this, but it was not applied in a couple of places. Change-Id: I1e29ee162c390e014688ab46e3658e2a463d203e Reviewed-by: Toby Tomkins --- tests/auto/network/access/qnetworkreply/test/test.pro | 1 + tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/auto/network/access/qnetworkreply/test/test.pro b/tests/auto/network/access/qnetworkreply/test/test.pro index faa584ca6e..61f979d2bb 100644 --- a/tests/auto/network/access/qnetworkreply/test/test.pro +++ b/tests/auto/network/access/qnetworkreply/test/test.pro @@ -1,4 +1,5 @@ CONFIG += testcase +CONFIG += parallel_test QT -= gui SOURCES += ../tst_qnetworkreply.cpp TARGET = ../tst_qnetworkreply diff --git a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp index 2c02df0f13..bc2a95d102 100644 --- a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp @@ -1125,8 +1125,8 @@ tst_QNetworkReply::tst_QNetworkReply() #endif qRegisterMetaType(); - testFileName = QDir::currentPath() + "/testfile"; uniqueExtension = createUniqueExtension(); + testFileName = QDir::currentPath() + "/testfile" + uniqueExtension; cookieJar = new MyCookieJar; manager.setCookieJar(cookieJar); @@ -1351,7 +1351,7 @@ void tst_QNetworkReply::initTestCase() QVERIFY(QtNetworkSettings::verifyTestNetworkSettings()); #if !defined Q_OS_WIN - wronlyFileName = testDataDir + "/write-only"; + wronlyFileName = testDataDir + "/write-only" + uniqueExtension; QFile wr(wronlyFileName); QVERIFY(wr.open(QIODevice::WriteOnly | QIODevice::Truncate)); wr.setPermissions(QFile::WriteOwner | QFile::WriteUser);