diff options
author | Jesus Fernandez <jesus.fernandez@qt.io> | 2016-11-10 00:52:57 +0100 |
---|---|---|
committer | Jesus Fernandez <Jesus.Fernandez@qt.io> | 2017-03-17 11:06:43 +0000 |
commit | 346cd79192ef71afa572812e17f1d422594651a0 (patch) | |
tree | e1ebd26e337817f8f2d5ce1196456ff3c3b1e7f1 /tests/auto/corelib/io/qfile/tst_qfile.cpp | |
parent | 99adabdb7ecdded792961392cec6b68e625bf6e2 (diff) |
Make QFile::open fail when using an invalid file name
Fixes the bug in QFile which allowed opening a file with reserved
characters in its name. If the name is a long file path, CreateFile
opens a file with a truncated name instead of failing, so we have
to catch reserved characters ourselves.
[ChangeLog][Windows] Fixed a bug that caused QFile to create
files with truncated names if the file name was invalid. Now,
QFile::open correctly fails to create such files.
Task-number: QTBUG-57023
Change-Id: I01d5a7132054cecdfa839d0b8de06460039248a3
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'tests/auto/corelib/io/qfile/tst_qfile.cpp')
-rw-r--r-- | tests/auto/corelib/io/qfile/tst_qfile.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp index a6da6d8e69..a23ebc8d72 100644 --- a/tests/auto/corelib/io/qfile/tst_qfile.cpp +++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp @@ -1141,6 +1141,7 @@ void tst_QFile::invalidFile_data() #else #if !defined(Q_OS_WINRT) QTest::newRow( "colon2" ) << invalidDriveLetter() + QString::fromLatin1(":ail:invalid"); + QTest::newRow( "date" ) << QString( "testLog-03:20.803Z.txt" ); #endif QTest::newRow( "colon3" ) << QString( ":failinvalid" ); QTest::newRow( "forwardslash" ) << QString( "fail/invalid" ); |