summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaurice Kalinowski <maurice.kalinowski@theqtcompany.com>2016-03-11 11:12:40 +0100
committerMaurice Kalinowski <maurice.kalinowski@theqtcompany.com>2016-03-16 08:15:59 +0000
commite830fa8fc251f697ffee2c215c0121028eeef8ca (patch)
tree054ff0b7ded8b4bac02a56c1129e1f09dca2202e
parenteef3afaa978a25743af7efdda169052b67cc744a (diff)
tst_QXmlStream::writerHangs(): Create file in temporary directory
A test should not write to its directory. Change-Id: I34dfc36387cf5a637b325be29c8a19ff51d9b9c3 Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
-rw-r--r--tests/auto/corelib/xml/qxmlstream/tst_qxmlstream.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/auto/corelib/xml/qxmlstream/tst_qxmlstream.cpp b/tests/auto/corelib/xml/qxmlstream/tst_qxmlstream.cpp
index 341b169113..1da29ac3bd 100644
--- a/tests/auto/corelib/xml/qxmlstream/tst_qxmlstream.cpp
+++ b/tests/auto/corelib/xml/qxmlstream/tst_qxmlstream.cpp
@@ -905,7 +905,8 @@ void tst_QXmlStream::testFalsePrematureError() const
// Regression test for crash due to using empty QStack.
void tst_QXmlStream::writerHangs() const
{
- QFile file("test.xml");
+ QTemporaryDir dir(QDir::tempPath() + QLatin1String("/tst_qxmlstream.XXXXXX"));
+ QFile file(dir.path() + "/test.xml");
QVERIFY(file.open(QIODevice::WriteOnly));