CorePlugin: 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: I95593962486e1de1b980f17b8f924d6f98fa8e80
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Jarek Kobus
2022-12-14 13:20:38 +01:00
parent 72e19f0919
commit 1ee4b0e583

View File

@@ -132,7 +132,8 @@ QString UtilsJsExtension::mktemp(const QString &pattern) const
QTemporaryFile file(tmp); QTemporaryFile file(tmp);
file.setAutoRemove(false); file.setAutoRemove(false);
QTC_ASSERT(file.open(), return QString()); const bool isOpen = file.open();
QTC_ASSERT(isOpen, return {});
file.close(); file.close();
return file.fileName(); return file.fileName();
} }