From 1dad90ea451b763f8cf90ceb1d355206252c7255 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Wed, 14 Dec 2022 13:28:56 +0100 Subject: [PATCH] RemoteLinux: Don't call mutable expressions inside QTC_ASSERT In order to conform to the theory: "Removing all QTC_ASSERTs and QTC_CHECKs should not change anything". Change-Id: I3f544f8cdcede99d7efa3ba0ef456180203c45be Reviewed-by: Reviewed-by: hjk Reviewed-by: Marcus Tillmanns --- src/plugins/remotelinux/linuxdevice.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/remotelinux/linuxdevice.cpp b/src/plugins/remotelinux/linuxdevice.cpp index 880fd00402b..03c54098778 100644 --- a/src/plugins/remotelinux/linuxdevice.cpp +++ b/src/plugins/remotelinux/linuxdevice.cpp @@ -75,7 +75,7 @@ public: QProcess::ProcessState state() const; QString socketFilePath() const { - QTC_ASSERT(m_masterSocketDir, return QString()); + QTC_ASSERT(m_masterSocketDir, return {}); return m_masterSocketDir->path() + "/cs"; } @@ -1116,8 +1116,8 @@ RunResult LinuxDevicePrivate::runInShell(const CommandLine &cmd, const QByteArra { QMutexLocker locker(&m_shellMutex); DEBUG(cmd.toUserOutput()); - QTC_ASSERT(setupShell(), return {}); - + const bool isSetup = setupShell(); + QTC_ASSERT(isSetup, return {}); return m_handler->runInShell(cmd, data); }