aboutsummaryrefslogtreecommitdiffstats
path: root/tests/benchmarks/creationtime/tst_creationtime.cpp
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2017-09-07 13:29:27 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2017-09-07 16:49:01 +0000
commit4310e5fa1b942cb6216d9f700031fb8f7a412606 (patch)
tree69f18fa730298bde8faa110947299a8250d60838 /tests/benchmarks/creationtime/tst_creationtime.cpp
parente6f50587bb172aa803428f0ea274f0ebd82835f8 (diff)
benchmarks: avoid "Empty filename passed to function" warnings
Add isEmpty() checks to avoid annoying warnings from QFileSystemEngine for Unix. Change-Id: I20b4f07605692271468dfc26b3c968406323de98 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/benchmarks/creationtime/tst_creationtime.cpp')
-rw-r--r--tests/benchmarks/creationtime/tst_creationtime.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/benchmarks/creationtime/tst_creationtime.cpp b/tests/benchmarks/creationtime/tst_creationtime.cpp
index fa72aa86..9539ee1b 100644
--- a/tests/benchmarks/creationtime/tst_creationtime.cpp
+++ b/tests/benchmarks/creationtime/tst_creationtime.cpp
@@ -92,9 +92,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;
+ }
}
}
}