forked from qt-creator/qt-creator
AutoTest: Modernize code
* remove unnecessary QLatin1String where possible * foreach * nullptr * bad naming of static members Change-Id: If0f7c6839be4d2efbfef6f7f0775d2034775bd90 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -73,7 +73,7 @@ void AutoTestUnitTests::initTestCase()
|
||||
if (!toolchain)
|
||||
QSKIP("This test requires that there is a kit with a toolchain.");
|
||||
|
||||
m_tmpDir = new CppTools::Tests::TemporaryCopiedDir(QLatin1String(":/unit_test"));
|
||||
m_tmpDir = new CppTools::Tests::TemporaryCopiedDir(":/unit_test");
|
||||
}
|
||||
|
||||
void AutoTestUnitTests::cleanupTestCase()
|
||||
@@ -117,16 +117,16 @@ void AutoTestUnitTests::testCodeParser_data()
|
||||
|
||||
|
||||
QTest::newRow("plainAutoTest")
|
||||
<< QString(m_tmpDir->path() + QLatin1String("/plain/plain.pro"))
|
||||
<< QString(m_tmpDir->path() + "/plain/plain.pro")
|
||||
<< 1 << 0 << 0 << 0;
|
||||
QTest::newRow("mixedAutoTestAndQuickTests")
|
||||
<< QString(m_tmpDir->path() + QLatin1String("/mixed_atp/mixed_atp.pro"))
|
||||
<< QString(m_tmpDir->path() + "/mixed_atp/mixed_atp.pro")
|
||||
<< 4 << 5 << 3 << 10;
|
||||
QTest::newRow("plainAutoTestQbs")
|
||||
<< QString(m_tmpDir->path() + QLatin1String("/plain/plain.qbs"))
|
||||
<< QString(m_tmpDir->path() + "/plain/plain.qbs")
|
||||
<< 1 << 0 << 0 << 0;
|
||||
QTest::newRow("mixedAutoTestAndQuickTestsQbs")
|
||||
<< QString(m_tmpDir->path() + QLatin1String("/mixed_atp/mixed_atp.qbs"))
|
||||
<< QString(m_tmpDir->path() + "/mixed_atp/mixed_atp.qbs")
|
||||
<< 4 << 5 << 3 << 10;
|
||||
}
|
||||
|
||||
@@ -210,7 +210,7 @@ void AutoTestUnitTests::testCodeParserGTest()
|
||||
|
||||
QMultiMap<QString, int> foundNamesAndSets = m_model->gtestNamesAndSets();
|
||||
QCOMPARE(expectedNamesAndSets.size(), foundNamesAndSets.size());
|
||||
foreach (const QString &name, expectedNamesAndSets.keys())
|
||||
for (const QString &name : expectedNamesAndSets.keys())
|
||||
QCOMPARE(expectedNamesAndSets.values(name), foundNamesAndSets.values(name));
|
||||
|
||||
// check also that no Qt related tests have been found
|
||||
@@ -224,9 +224,9 @@ void AutoTestUnitTests::testCodeParserGTest_data()
|
||||
{
|
||||
QTest::addColumn<QString>("projectFilePath");
|
||||
QTest::newRow("simpleGoogletest")
|
||||
<< QString(m_tmpDir->path() + QLatin1String("/simple_gt/simple_gt.pro"));
|
||||
<< QString(m_tmpDir->path() + "/simple_gt/simple_gt.pro");
|
||||
QTest::newRow("simpleGoogletestQbs")
|
||||
<< QString(m_tmpDir->path() + QLatin1String("/simple_gt/simple_gt.qbs"));
|
||||
<< QString(m_tmpDir->path() + "/simple_gt/simple_gt.qbs");
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
Reference in New Issue
Block a user