diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2016-03-10 16:35:53 +0100 |
---|---|---|
committer | Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com> | 2016-03-11 11:26:14 +0000 |
commit | a8c72b7671637d18b1915d7e46fc601e8ffde2d7 (patch) | |
tree | 7dd82b9603d11ee7514c6b6c0504f73a2ee35255 /tests | |
parent | a2d58025b63d43a843bf14138221086f25c280f8 (diff) |
tst_QTextStream::textModeOnEmptyRead(): Create file in temporary directory.
A test should not write to its directory. Amends change
d0b54cede8d8ea0b8431c64abb51d0cd1a71327b.
Task-number: QTBUG-47176
Change-Id: If15258b4aed199792fab422b7ac1d74e22a9e322
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp b/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp index a0348f3c54..24dd05223f 100644 --- a/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp +++ b/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp @@ -3049,12 +3049,10 @@ void tst_QTextStream::int_write_with_locale() void tst_QTextStream::textModeOnEmptyRead() { - const QString filename("textmodetest.txt"); - QFile::remove(filename); // Remove file if exists - + const QString filename(tempDir.path() + QLatin1String("/textmodetest.txt")); QFile file(filename); - QVERIFY(file.open(QIODevice::ReadWrite | QIODevice::Text)); + QVERIFY2(file.open(QIODevice::ReadWrite | QIODevice::Text), qPrintable(file.errorString())); QTextStream stream(&file); QVERIFY(file.isTextModeEnabled()); QString emptyLine = stream.readLine(); // Text mode flag cleared here |