summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2019-04-08 09:58:08 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2019-04-08 18:44:25 +0000
commitf7949df24319cda7363aed354ca6d60dc6512788 (patch)
tree46cede5859a50f92c3a26b33b459d71a641f6a1f /tests
parent3a34ef636af43e249fba417419db14c42b98094a (diff)
tst_QUrl: Fix left-over temporary directory on Windows
The test changes the current directory to the test directory in fromUserInputWithCwd(), but did not restore it, causing: Totals 898 passed, 0 failed, 1 skipped, 0 blacklisted, 368ms ********* Finished testing of tst_QUrl ********* QTemporaryDir Unable to remove "C:\\TEMP\\tst_qurl-ryVxqu" most likely due to the presence of read-only files. Restore the old directory at the end to fix this. Change-Id: I62669868f3c6d97dd38ebac76515428c14b7e1e7 Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/io/qurl/tst_qurl.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/auto/corelib/io/qurl/tst_qurl.cpp b/tests/auto/corelib/io/qurl/tst_qurl.cpp
index 4f173d2dfd..d697dae9dd 100644
--- a/tests/auto/corelib/io/qurl/tst_qurl.cpp
+++ b/tests/auto/corelib/io/qurl/tst_qurl.cpp
@@ -47,6 +47,7 @@ class tst_QUrl : public QObject
private slots:
void initTestCase();
+ void cleanupTestCase();
void effectiveTLDs_data();
void effectiveTLDs();
void getSetCheck();
@@ -188,6 +189,7 @@ private slots:
private:
void testThreadingHelper();
+ const QString m_currentPath = QDir::currentPath();
QTemporaryDir m_tempDir;
};
@@ -196,6 +198,12 @@ void tst_QUrl::initTestCase()
QVERIFY2(m_tempDir.isValid(), qPrintable(m_tempDir.errorString()));
}
+void tst_QUrl::cleanupTestCase()
+{
+ // Restore working directory changed in fromUserInputWithCwd()
+ QDir::setCurrent(m_currentPath);
+}
+
// Testing get/set functions
void tst_QUrl::getSetCheck()
{