summaryrefslogtreecommitdiffstats
path: root/src/testlib/qtestcase.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/testlib/qtestcase.cpp')
-rw-r--r--src/testlib/qtestcase.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index adf4b9e1ef..acd676833e 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -2135,8 +2135,9 @@ QString QTest::qFindTestData(const QString& base, const char *file, int line, co
srcdir.setFile(QFile::decodeName(builddir) + QLatin1String("/") + srcdir.filePath());
}
- QString candidate = QString::fromLatin1("%1/%2").arg(srcdir.canonicalFilePath(), base);
- if (QFileInfo::exists(candidate)) {
+ const QString canonicalPath = srcdir.canonicalFilePath();
+ QString candidate = QString::fromLatin1("%1/%2").arg(canonicalPath, base);
+ if (!canonicalPath.isEmpty() && QFileInfo::exists(candidate)) {
found = candidate;
}
else if (QTestLog::verboseLevel() >= 2) {