From f05c597ae506ea6163394dbb6b70ecc77fae3b3c Mon Sep 17 00:00:00 2001 From: Maurice Kalinowski Date: Fri, 11 Dec 2015 13:42:28 +0100 Subject: 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 --- tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests/auto/corelib/io/qiodevice') diff --git a/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp b/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp index f637ffcfc5..0fdddd1180 100644 --- a/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp +++ b/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp @@ -43,6 +43,7 @@ class tst_QIODevice : public QObject private slots: void initTestCase(); + void cleanupTestCase(); void getSetCheck(); void constructing_QTcpSocket(); void constructing_QFile(); @@ -60,6 +61,10 @@ private slots: void peekBug(); void readAllKeepPosition(); void writeInTextMode(); + +private: + QSharedPointer m_tempDir; + QString m_previousCurrent; }; void tst_QIODevice::initTestCase() @@ -68,6 +73,15 @@ void tst_QIODevice::initTestCase() QVERIFY(QFileInfo(QStringLiteral("./tst_qiodevice.cpp")).exists() || QFile::copy(QStringLiteral(":/tst_qiodevice.cpp"), QStringLiteral("./tst_qiodevice.cpp"))); #endif + m_previousCurrent = QDir::currentPath(); + m_tempDir = QSharedPointer(new QTemporaryDir); + QVERIFY2(!m_tempDir.isNull(), qPrintable("Could not create temporary directory.")); + QVERIFY2(QDir::setCurrent(m_tempDir->path()), qPrintable("Could not switch current directory")); +} + +void tst_QIODevice::cleanupTestCase() +{ + QDir::setCurrent(m_previousCurrent); } // Testing get/set functions -- cgit v1.2.3