From 556bc488390f946a9908e72a4c601003635ba3b2 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Thu, 21 Jul 2022 15:19:04 +0200 Subject: [PATCH] fsengine: Fix toLower / compare test Fixed test on windows Change-Id: I1652af82499e6820eb9850a3d79d3d1c5bc18614 Reviewed-by: hjk --- src/libs/utils/fsengine/fileiteratordevicesappender.h | 2 +- tests/auto/utils/fileutils/tst_fileutils.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libs/utils/fsengine/fileiteratordevicesappender.h b/src/libs/utils/fsengine/fileiteratordevicesappender.h index 713ae247297..78444d624f1 100644 --- a/src/libs/utils/fsengine/fileiteratordevicesappender.h +++ b/src/libs/utils/fsengine/fileiteratordevicesappender.h @@ -116,7 +116,7 @@ private: { if (!m_hasSetPath) { const QString p = path(); - if (p.toLower() == QDir::rootPath()) + if (p.compare(QDir::rootPath(), Qt::CaseInsensitive) == 0) m_status = State::IteratingRoot; ((*m_baseIterator).*get(QAFEITag()))(p); diff --git a/tests/auto/utils/fileutils/tst_fileutils.cpp b/tests/auto/utils/fileutils/tst_fileutils.cpp index 1c6bb41984b..b291d94879f 100644 --- a/tests/auto/utils/fileutils/tst_fileutils.cpp +++ b/tests/auto/utils/fileutils/tst_fileutils.cpp @@ -319,7 +319,8 @@ void tst_fileutils::toString() filePath.setPath(path); QCOMPARE(filePath.toString(), result); - QCOMPARE(filePath.toUserOutput(), userResult); + QString cleanedOutput = filePath.needsDevice() ? filePath.toUserOutput() : QDir::cleanPath(filePath.toUserOutput()); + QCOMPARE(cleanedOutput, userResult); } void tst_fileutils::fromString_data()