diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2017-10-18 13:22:49 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2017-10-18 11:47:55 +0000 |
commit | 6dbe20bdc3ae582a885d931519c4356c2ec58285 (patch) | |
tree | a63f5173d9ffc7c8f340ee3129785b920bb6a405 | |
parent | 4bb67254d63326ecc3c4adc91a1abf8f3f487cf6 (diff) |
tst_sanity: fix "empty filename passed to function" warnings
Change-Id: Ia1e633af6c64c9e2d538a2d4076e0bdd9667e01e
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
-rw-r--r-- | tests/auto/sanity/tst_sanity.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/auto/sanity/tst_sanity.cpp b/tests/auto/sanity/tst_sanity.cpp index 25e118e3..2c67e86a 100644 --- a/tests/auto/sanity/tst_sanity.cpp +++ b/tests/auto/sanity/tst_sanity.cpp @@ -280,9 +280,12 @@ static void addTestRows(QQmlEngine *engine, const QString &sourcePath, const QSt if (QFile::exists(filePath)) { QTest::newRow(qPrintable(name)) << QUrl::fromLocalFile(filePath); break; - } else if (QFile::exists(QQmlFile::urlToLocalFileOrQrc(filePath))) { - QTest::newRow(qPrintable(name)) << QUrl(filePath); - break; + } else { + filePath = QQmlFile::urlToLocalFileOrQrc(filePath); + if (!filePath.isEmpty() && QFile::exists(filePath)) { + QTest::newRow(qPrintable(name)) << QUrl(filePath); + break; + } } } } |