diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-10-23 09:50:52 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-11-24 15:38:18 +0000 |
commit | a69c0bb38e8edb985417c10793350e40e401fed3 (patch) | |
tree | 6d51298e40327334d932d95bb7fedc9d0156d203 /tests | |
parent | 1e8863e39dfc72422e76dae214d35268685eb52a (diff) |
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>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp index fbeeec2ec4..ce56dcacba 100644 --- a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp @@ -200,8 +200,7 @@ protected Q_SLOTS: void nestedEventLoops_slot(); private Q_SLOTS: - void init(); - void cleanup(); + void cleanup() { cleanupTestData(); } void initTestCase(); void cleanupTestCase(); @@ -485,6 +484,8 @@ private Q_SLOTS: // NOTE: This test must be last! void parentingRepliesToTheApp(); private: + void cleanupTestData(); + QString testDataDir; }; @@ -1492,6 +1493,8 @@ void tst_QNetworkReply::initTestCase() echoProcessDir = QFINDTESTDATA("echo"); QVERIFY2(!echoProcessDir.isEmpty(), qPrintable( QString::fromLatin1("Couldn't find echo dir starting from %1.").arg(QDir::currentPath()))); + + cleanupTestData(); } void tst_QNetworkReply::cleanupTestCase() @@ -1507,12 +1510,7 @@ void tst_QNetworkReply::cleanupTestCase() #endif } -void tst_QNetworkReply::init() -{ - cleanup(); -} - -void tst_QNetworkReply::cleanup() +void tst_QNetworkReply::cleanupTestData() { QFile file(testFileName); QVERIFY(!file.exists() || file.remove()); |