diff options
author | João Abecasis <joao.abecasis@nokia.com> | 2011-08-16 15:53:41 (GMT) |
---|---|---|
committer | João Abecasis <joao.abecasis@nokia.com> | 2011-08-17 15:52:23 (GMT) |
commit | 401722ef9e6fe79bd41f9d5f79668f5c4997c8e6 (patch) | |
tree | b5c62add772e013405bacc6bcff727091bced87f /tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp | |
parent | 0de701d01cb221464eed773fd3751aff73fe4d60 (diff) | |
download | Qt-401722ef9e6fe79bd41f9d5f79668f5c4997c8e6.zip Qt-401722ef9e6fe79bd41f9d5f79668f5c4997c8e6.tar.gz Qt-401722ef9e6fe79bd41f9d5f79668f5c4997c8e6.tar.bz2 |
Fix QTemporaryFile regressions and new found issues
With this change, the file template is always processed in original
QString format. Trying to generate native paths before adding a missing
placeholder mask could change the meaning of templates, such as "." and
"..", which are now tested to mean "..XXXXXX" and "...XXXXXX",
respectively.
After ensuring the template includes a placeholder mask, the path is
converted to a native *absolute* file path and the mask is sought for
again. On Windows, native paths were already absolute. On Symbian, we'd
need at least a clean path, as "." and ",," are not natively understood.
There is a requirement that the placeholder mask /XXXXXX+/ makes it
through this conversion unaltered, which relaxes prior requirements on
*nix platforms. On Windows and Symbian the conversion is under Qt's
control and not user-configurable.
Reviewed-by: Shane Kearns
Diffstat (limited to 'tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp')
-rw-r--r-- | tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp b/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp index 2db5c60..18b9337 100644 --- a/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp +++ b/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp @@ -632,6 +632,8 @@ void tst_QTemporaryFile::QTBUG_4796_data() QString unicode = QString::fromUtf8("\xc3\xa5\xc3\xa6\xc3\xb8"); QTest::newRow("<empty>") << QString() << QString() << true; + QTest::newRow(".") << QString(".") << QString() << true; + QTest::newRow("..") << QString("..") << QString() << true; QTest::newRow("blaXXXXXX") << QString("bla") << QString() << true; QTest::newRow("XXXXXXbla") << QString() << QString("bla") << true; QTest::newRow("does-not-exist/qt_temp.XXXXXX") << QString("does-not-exist/qt_temp") << QString() << false; |