summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp
diff options
context:
space:
mode:
authorMaurice Kalinowski <maurice.kalinowski@theqtcompany.com>2015-12-11 13:42:28 +0100
committerMaurice Kalinowski <maurice.kalinowski@theqtcompany.com>2016-01-21 05:53:17 +0000
commitf05c597ae506ea6163394dbb6b70ecc77fae3b3c (patch)
tree02a3b3644bd9c0657aed855d7d348d527cdbefce /tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp
parentf4502fbaf0d31d08bf08f1685f1d7b30735b72b4 (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/qdatastream/tst_qdatastream.cpp')
-rw-r--r--tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp b/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp
index d9d3f55d4a..86fd142036 100644
--- a/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp
+++ b/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp
@@ -50,6 +50,7 @@ public:
void stream_data(int noOfElements);
public slots:
+ void initTestCase();
void cleanupTestCase();
private slots:
@@ -243,6 +244,10 @@ private:
void readqint64(QDataStream *s);
void readQIcon(QDataStream *s);
void readQEasingCurve(QDataStream *s);
+
+private:
+ QSharedPointer<QTemporaryDir> m_tempDir;
+ QString m_previousCurrent;
};
static int NColorRoles[] = {
@@ -293,10 +298,20 @@ void tst_QDataStream::getSetCheck()
QCOMPARE(QDataStream::ReadCorruptData, obj1.status());
}
+void tst_QDataStream::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"));
+}
+
void tst_QDataStream::cleanupTestCase()
{
QFile::remove(QLatin1String("qdatastream.out"));
QFile::remove(QLatin1String("datastream.tmp"));
+
+ QDir::setCurrent(m_previousCurrent);
}
static int dataIndex(const QString &tag)