forked from qt-creator/qt-creator
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:
@@ -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);
|
||||
|
@@ -74,7 +74,8 @@ static QStringList filterInterfering(const QStringList &provided, QStringList *o
|
||||
for (const auto &arg : provided) {
|
||||
bool interferes = false;
|
||||
if (filterNext) {
|
||||
omitted->append(arg);
|
||||
if (omitted)
|
||||
omitted->append(arg);
|
||||
filterNext = false;
|
||||
continue;
|
||||
}
|
||||
|
@@ -254,6 +254,7 @@ void TestTreeModel::onBuildSystemTestsUpdated()
|
||||
if (!bs || !bs->project())
|
||||
return;
|
||||
|
||||
QTC_ASSERT(m_checkStateCache, return);
|
||||
m_checkStateCache->evolve(ITestBase::Tool);
|
||||
|
||||
ITestTool *testTool = TestFrameworkManager::testToolForBuildSystemId(bs->project()->id());
|
||||
|
Reference in New Issue
Block a user