diff options
author | Maurice Kalinowski <maurice.kalinowski@theqtcompany.com> | 2015-12-11 13:42:28 +0100 |
---|---|---|
committer | Maurice Kalinowski <maurice.kalinowski@theqtcompany.com> | 2016-01-21 05:53:17 +0000 |
commit | f05c597ae506ea6163394dbb6b70ecc77fae3b3c (patch) | |
tree | 02a3b3644bd9c0657aed855d7d348d527cdbefce /tests/auto/corelib/io/qabstractfileengine/tst_qabstractfileengine.cpp | |
parent | f4502fbaf0d31d08bf08f1685f1d7b30735b72b4 (diff) |
winrt: msvc2015: refactor file handling
msvc2015 reintroduced a couple of functions from the win32 API
towards WinRT.
Enable usage of those and simplify the file system engine.
Furthermore update the autotests.
Change-Id: I9eafffba0ddfd05917c184c4a6b9e166f86d71d9
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Diffstat (limited to 'tests/auto/corelib/io/qabstractfileengine/tst_qabstractfileengine.cpp')
-rw-r--r-- | tests/auto/corelib/io/qabstractfileengine/tst_qabstractfileengine.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/corelib/io/qabstractfileengine/tst_qabstractfileengine.cpp b/tests/auto/corelib/io/qabstractfileengine/tst_qabstractfileengine.cpp index 977c396e21..8c4c8b48d7 100644 --- a/tests/auto/corelib/io/qabstractfileengine/tst_qabstractfileengine.cpp +++ b/tests/auto/corelib/io/qabstractfileengine/tst_qabstractfileengine.cpp @@ -52,6 +52,7 @@ class tst_QAbstractFileEngine { Q_OBJECT public slots: + void initTestCase(); void cleanupTestCase(); private slots: @@ -64,6 +65,8 @@ private slots: void mounting(); private: QStringList filesForRemoval; + QSharedPointer<QTemporaryDir> m_currentDir; + QString m_previousCurrent; }; class ReferenceFileEngine @@ -563,6 +566,14 @@ class FileEngineHandler } }; +void tst_QAbstractFileEngine::initTestCase() +{ + m_previousCurrent = QDir::currentPath(); + m_currentDir = QSharedPointer<QTemporaryDir>(new QTemporaryDir()); + QVERIFY2(!m_currentDir.isNull(), qPrintable("Could not create current directory.")); + QDir::setCurrent(m_currentDir->path()); +} + void tst_QAbstractFileEngine::cleanupTestCase() { bool failed = false; @@ -576,6 +587,8 @@ void tst_QAbstractFileEngine::cleanupTestCase() } QVERIFY(!failed); + + QDir::setCurrent(m_previousCurrent); } void tst_QAbstractFileEngine::customHandler() |