aboutsummaryrefslogtreecommitdiffstats
path: root/tests/benchmarks
diff options
context:
space:
mode:
Diffstat (limited to 'tests/benchmarks')
-rw-r--r--tests/benchmarks/creationtime/tst_creationtime.cpp9
-rw-r--r--tests/benchmarks/objectcount/tst_objectcount.cpp9
2 files changed, 12 insertions, 6 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;
+ }
}
}
}
diff --git a/tests/benchmarks/objectcount/tst_objectcount.cpp b/tests/benchmarks/objectcount/tst_objectcount.cpp
index 551d2009..38ef156e 100644
--- a/tests/benchmarks/objectcount/tst_objectcount.cpp
+++ b/tests/benchmarks/objectcount/tst_objectcount.cpp
@@ -112,9 +112,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;
+ }
}
}
}