summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorIvan Komissarov <abbapoh@gmail.com>2022-01-25 21:29:00 +0300
committerRaphaƫl Cotty <raphael.cotty@gmail.com>2022-02-04 11:59:27 +0000
commite0502b32c49d877a790b6f36ddc3f63e5d2f1bc2 (patch)
treea65f0e7c6df313631f75138b06d6d8090f8ea38b /tests
parentcb3d7e862c69c59e3b0111e19ace157be07acb88 (diff)
downloadqbs-e0502b32c49d877a790b6f36ddc3f63e5d2f1bc2.tar.gz
Do not use std::string in HostOsInfo
We are not going away from Qt and converting QString to std::strgin and vice versa does not make any sense. Change-Id: I99c0067a4738566728c503fe39f0d0a945d4e977 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/blackbox/tst_blackbox.cpp7
-rw-r--r--tests/auto/shared.h3
2 files changed, 5 insertions, 5 deletions
diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp
index 2846dd40b..7aa6607fd 100644
--- a/tests/auto/blackbox/tst_blackbox.cpp
+++ b/tests/auto/blackbox/tst_blackbox.cpp
@@ -4599,7 +4599,7 @@ void TestBlackbox::jsExtensionsHost()
HostOsInfo::hostOSArchitecture());
QStringList list;
for (const auto &s : HostOsInfo::canonicalOSIdentifiers(HostOsInfo::hostOSIdentifier()))
- list.push_back(QString::fromStdString(s));
+ list.push_back(s);
QCOMPARE(lines.at(i++).trimmed().constData(), "os: " + list.join(','));
QCOMPARE(lines.at(i++).trimmed().constData(), "platform: " + HostOsInfo::hostOSIdentifier());
QCOMPARE(lines.at(i++).trimmed().constData(), "osVersion: " +
@@ -8454,9 +8454,10 @@ void TestBlackbox::hostOsProperties()
QSKIP("Cannot run binaries in cross-compiled build");
QCOMPARE(runQbs(QStringLiteral("run")), 0);
QVERIFY2(m_qbsStdout.contains(
- ("HOST_ARCHITECTURE = " + HostOsInfo::hostOSArchitecture()).data()),
+ ("HOST_ARCHITECTURE = " + HostOsInfo::hostOSArchitecture().toUtf8()).data()),
m_qbsStdout.constData());
- QVERIFY2(m_qbsStdout.contains(("HOST_PLATFORM = " + HostOsInfo::hostOSIdentifier()).data()),
+ QVERIFY2(m_qbsStdout.contains(
+ ("HOST_PLATFORM = " + HostOsInfo::hostOSIdentifier().toUtf8()).data()),
m_qbsStdout.constData());
}
diff --git a/tests/auto/shared.h b/tests/auto/shared.h
index 94c22b47e..53ff364fb 100644
--- a/tests/auto/shared.h
+++ b/tests/auto/shared.h
@@ -351,8 +351,7 @@ inline qbs::Internal::HostOsInfo::HostOs targetOs()
const qbs::Profile buildProfile(profileName(), s.get());
const QString targetPlatform = buildProfile.value("qbs.targetPlatform").toString();
if (!targetPlatform.isEmpty()) {
- const std::vector<std::string> targetOS = qbs::Internal::HostOsInfo::canonicalOSIdentifiers(
- targetPlatform.toStdString());
+ const auto targetOS = qbs::Internal::HostOsInfo::canonicalOSIdentifiers(targetPlatform);
if (qbs::Internal::contains(targetOS, "windows"))
return qbs::Internal::HostOsInfo::HostOsWindows;
if (qbs::Internal::contains(targetOS, "linux"))