diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2016-01-26 14:35:50 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2016-01-26 16:27:28 +0100 |
commit | a15c3d086dafea83e4760f0b447be43d26b80697 (patch) | |
tree | fd224a3f83942ff4c432e1e3a3f8583d14d6a11c /tests/auto/corelib/io/largefile/tst_largefile.cpp | |
parent | 87abfd351af6309691d921ca0aef077d74df4732 (diff) | |
parent | 397061a6a92db9f962360d5db96f69b315f93074 (diff) |
Merge remote-tracking branch 'origin/5.6' into dev
Conflicts:
src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java
src/dbus/qdbusconnection_p.h
src/dbus/qdbusintegrator.cpp
src/dbus/qdbusintegrator_p.h
tests/auto/corelib/io/qdir/qdir.pro
tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp
Change-Id: I3d3fd07aed015c74b1f545f1327aa73d5f365fcc
Diffstat (limited to 'tests/auto/corelib/io/largefile/tst_largefile.cpp')
-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 52f6e13376..e448093062 100644 --- a/tests/auto/corelib/io/largefile/tst_largefile.cpp +++ b/tests/auto/corelib/io/largefile/tst_largefile.cpp @@ -65,7 +65,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 @@ -130,6 +130,9 @@ private: int fd_; FILE *stream_; + + QSharedPointer<QTemporaryDir> m_tempDir; + QString m_previousCurrent; }; /* @@ -224,6 +227,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() ); } @@ -235,6 +243,8 @@ void tst_LargeFile::cleanupTestCase() QFile file("qt_largefile.tmp"); QVERIFY( !file.exists() || file.remove() ); + + QDir::setCurrent(m_previousCurrent); } void tst_LargeFile::init() |