summaryrefslogtreecommitdiffstats
path: root/src/testlib
diff options
context:
space:
mode:
authorJan Arve Sæther <jan-arve.saether@qt.io>2019-07-02 17:11:20 +0200
committerJan Arve Sæther <jan-arve.saether@qt.io>2019-07-05 09:11:35 +0200
commitbcd4b14026094d0077ad1069054676cc6da96251 (patch)
tree452216c9563696a7a3e144c14aaf1d63e8bd418d /src/testlib
parentc4932f93d53a08401fc61460e1ab2fe3919d9e3d (diff)
Fix qFindTestData() to work with relative resource paths
If the resource path 'base' was relative it would enter condition 3) in qFindTestData() and it would actually find the nonsensical "://data" as a viable candidate. We don't want to enter that case, but rather enter the subsequent ('Try resources') case Change-Id: I1928ba02c941e23fee4fec9052a1981e46fa59b7 Task-number: QTBUG-73512 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/testlib')
-rw-r--r--src/testlib/qtestcase.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index 10477238cb..619376fd33 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -2206,7 +2206,7 @@ QString QTest::qFindTestData(const QString& base, const char *file, int line, co
}
// 3. relative to test source.
- if (found.isEmpty()) {
+ if (found.isEmpty() && qstrncmp(file, ":/", 2) != 0) {
// srcdir is the directory containing the calling source file.
QFileInfo srcdir = QFileInfo(QFile::decodeName(file)).path();