mirror of https://github.com/qt/qtbase.git
tst_QNetworkReply: Fix repetitive invocation of cleanup().
Move the code from cleanup() into a separate cleanupTestData() and call this from initTestData() and cleanup(). Remove slot init(). Change-Id: I4e7b5b89197ed0aa50f46f730e9c1d9c59749614 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
This commit is contained in:
parent
1e8863e39d
commit
a69c0bb38e
|
@ -200,8 +200,7 @@ protected Q_SLOTS:
|
||||||
void nestedEventLoops_slot();
|
void nestedEventLoops_slot();
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void init();
|
void cleanup() { cleanupTestData(); }
|
||||||
void cleanup();
|
|
||||||
void initTestCase();
|
void initTestCase();
|
||||||
void cleanupTestCase();
|
void cleanupTestCase();
|
||||||
|
|
||||||
|
@ -485,6 +484,8 @@ private Q_SLOTS:
|
||||||
// NOTE: This test must be last!
|
// NOTE: This test must be last!
|
||||||
void parentingRepliesToTheApp();
|
void parentingRepliesToTheApp();
|
||||||
private:
|
private:
|
||||||
|
void cleanupTestData();
|
||||||
|
|
||||||
QString testDataDir;
|
QString testDataDir;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1492,6 +1493,8 @@ void tst_QNetworkReply::initTestCase()
|
||||||
echoProcessDir = QFINDTESTDATA("echo");
|
echoProcessDir = QFINDTESTDATA("echo");
|
||||||
QVERIFY2(!echoProcessDir.isEmpty(), qPrintable(
|
QVERIFY2(!echoProcessDir.isEmpty(), qPrintable(
|
||||||
QString::fromLatin1("Couldn't find echo dir starting from %1.").arg(QDir::currentPath())));
|
QString::fromLatin1("Couldn't find echo dir starting from %1.").arg(QDir::currentPath())));
|
||||||
|
|
||||||
|
cleanupTestData();
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_QNetworkReply::cleanupTestCase()
|
void tst_QNetworkReply::cleanupTestCase()
|
||||||
|
@ -1507,12 +1510,7 @@ void tst_QNetworkReply::cleanupTestCase()
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_QNetworkReply::init()
|
void tst_QNetworkReply::cleanupTestData()
|
||||||
{
|
|
||||||
cleanup();
|
|
||||||
}
|
|
||||||
|
|
||||||
void tst_QNetworkReply::cleanup()
|
|
||||||
{
|
{
|
||||||
QFile file(testFileName);
|
QFile file(testFileName);
|
||||||
QVERIFY(!file.exists() || file.remove());
|
QVERIFY(!file.exists() || file.remove());
|
||||||
|
|
Loading…
Reference in New Issue