AutoTest: Fix some clazy warnings

Avoids potential nullptr accesses and unneeded allocations.

Change-Id: I8c13ca1dab885fc3e9a05dc7329ff592a7f0fe1a
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Stenger
2021-01-19 07:50:29 +01:00
parent 0fa391c7d3
commit da07d8f5c3
3 changed files with 5 additions and 3 deletions

View File

@@ -80,7 +80,7 @@ void AutoTestUnitTests::initTestCase()
m_tmpDir = new CppTools::Tests::TemporaryCopiedDir(":/unit_test");
if (!qgetenv("BOOST_INCLUDE_DIR").isEmpty()) {
if (!qEnvironmentVariableIsEmpty("BOOST_INCLUDE_DIR")) {
m_checkBoost = true;
} else {
if (Utils::HostOsInfo::isLinuxHost()
@@ -200,7 +200,7 @@ void AutoTestUnitTests::testCodeParserSwitchStartup_data()
void AutoTestUnitTests::testCodeParserGTest()
{
if (qgetenv("GOOGLETEST_DIR").isEmpty())
if (qEnvironmentVariableIsEmpty("GOOGLETEST_DIR"))
QSKIP("This test needs googletest - set GOOGLETEST_DIR (point to googletest repository)");
QFETCH(QString, projectFilePath);