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/largefile | |
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/largefile')
-rw-r--r-- | tests/auto/corelib/io/largefile/tst_largefile.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/auto/corelib/io/largefile/tst_largefile.cpp b/tests/auto/corelib/io/largefile/tst_largefile.cpp index 0a28ee7b9c..afbb307f03 100644 --- a/tests/auto/corelib/io/largefile/tst_largefile.cpp +++ b/tests/auto/corelib/io/largefile/tst_largefile.cpp @@ -70,7 +70,7 @@ public: , fd_(-1) , stream_(0) { - #if defined(QT_LARGEFILE_SUPPORT) && !defined(Q_OS_MAC) + #if defined(QT_LARGEFILE_SUPPORT) && !defined(Q_OS_MAC) && !defined(Q_OS_WINRT) maxSizeBits = 36; // 64 GiB #elif defined(Q_OS_MAC) // HFS+ does not support sparse files, so we limit file size for the test @@ -135,6 +135,9 @@ private: int fd_; FILE *stream_; + + QSharedPointer<QTemporaryDir> m_tempDir; + QString m_previousCurrent; }; /* @@ -229,6 +232,11 @@ QByteArray const &tst_LargeFile::getDataBlock(int index, qint64 position) void tst_LargeFile::initTestCase() { + m_previousCurrent = QDir::currentPath(); + m_tempDir = QSharedPointer<QTemporaryDir>(new QTemporaryDir); + QVERIFY2(!m_tempDir.isNull(), qPrintable("Could not create temporary directory.")); + QVERIFY2(QDir::setCurrent(m_tempDir->path()), qPrintable("Could not switch current directory")); + QFile file("qt_largefile.tmp"); QVERIFY( !file.exists() || file.remove() ); } @@ -240,6 +248,8 @@ void tst_LargeFile::cleanupTestCase() QFile file("qt_largefile.tmp"); QVERIFY( !file.exists() || file.remove() ); + + QDir::setCurrent(m_previousCurrent); } void tst_LargeFile::init() |