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>
This commit is contained in:
Jan Arve Sæther 2019-07-02 17:11:20 +02:00
parent c4932f93d5
commit bcd4b14026

View File

@ -2206,7 +2206,7 @@ QString QTest::qFindTestData(const QString& base, const char *file, int line, co
} }
// 3. relative to test source. // 3. relative to test source.
if (found.isEmpty()) { if (found.isEmpty() && qstrncmp(file, ":/", 2) != 0) {
// srcdir is the directory containing the calling source file. // srcdir is the directory containing the calling source file.
QFileInfo srcdir = QFileInfo(QFile::decodeName(file)).path(); QFileInfo srcdir = QFileInfo(QFile::decodeName(file)).path();