summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorDavid Faure <faure@kde.org>2012-03-02 20:33:55 +0100
committerQt by Nokia <qt-info@nokia.com>2012-03-06 12:10:42 +0100
commitc78957766a5adba45289a0f7afe22949a183b34b (patch)
tree4c8b6fdfe419da36308b7182511af43758dccc53 /tests/auto
parente6f84312a5352c742f240385e2814ef9b865db22 (diff)
QMimeDatabase: Fix crash on empty filename
This is due to the search in the suffix tree starting at position fileName.length() - 1. Change-Id: I98501c1724c7dde2626351ace8ba19faa0d2e1e1 Reviewed-by: Ivan Komissarov <ABBAPOH@nextmail.ru> Reviewed-by: Wolf-Michael Bolle <wolf-michael.bolle@nokia.com>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp
index 63adcadb86..9076f37c7c 100644
--- a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp
+++ b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp
@@ -207,6 +207,7 @@ void tst_QMimeDatabase::mimeTypeForFileName_data()
QTest::newRow("directory") << "/" << "inode/directory";
QTest::newRow("doesn't exist, no extension") << "IDontExist" << "application/octet-stream";
QTest::newRow("doesn't exist but has known extension") << "IDontExist.txt" << "text/plain";
+ QTest::newRow("empty") << "" << "application/octet-stream";
}
static inline QByteArray msgMimeTypeForFileNameFailed(const QList<QMimeType> &actual,