forked from qt-creator/qt-creator
AutoTest: Prefer ITestBase::type() to ITestBase::asTest*()
The casting provided by the asTest*() methods isn't made use of here, so using the "data-oriented" type() method seems more expressive. Change-Id: Ia3e1a28d126f096afed54eeb0d884c52332f4350 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -148,7 +148,7 @@ static QString processInformation(const QProcess *proc)
|
|||||||
|
|
||||||
static QString rcInfo(const ITestConfiguration * const config)
|
static QString rcInfo(const ITestConfiguration * const config)
|
||||||
{
|
{
|
||||||
if (config->testBase()->asTestTool())
|
if (config->testBase()->type() == ITestBase::Tool)
|
||||||
return {};
|
return {};
|
||||||
const TestConfiguration *current = static_cast<const TestConfiguration *>(config);
|
const TestConfiguration *current = static_cast<const TestConfiguration *>(config);
|
||||||
QString info;
|
QString info;
|
||||||
@@ -477,7 +477,7 @@ int TestRunner::precheckTestConfigurations()
|
|||||||
const bool omitWarnings = AutotestPlugin::settings()->omitRunConfigWarn;
|
const bool omitWarnings = AutotestPlugin::settings()->omitRunConfigWarn;
|
||||||
int testCaseCount = 0;
|
int testCaseCount = 0;
|
||||||
for (ITestConfiguration *itc : qAsConst(m_selectedTests)) {
|
for (ITestConfiguration *itc : qAsConst(m_selectedTests)) {
|
||||||
if (itc->testBase()->asTestTool()) {
|
if (itc->testBase()->type() == ITestBase::Tool) {
|
||||||
if (itc->project()) {
|
if (itc->project()) {
|
||||||
testCaseCount += itc->testCaseCount();
|
testCaseCount += itc->testCaseCount();
|
||||||
} else {
|
} else {
|
||||||
@@ -524,7 +524,7 @@ void TestRunner::runTests()
|
|||||||
QList<ITestConfiguration *> toBeRemoved;
|
QList<ITestConfiguration *> toBeRemoved;
|
||||||
bool projectChanged = false;
|
bool projectChanged = false;
|
||||||
for (ITestConfiguration *itc : qAsConst(m_selectedTests)) {
|
for (ITestConfiguration *itc : qAsConst(m_selectedTests)) {
|
||||||
if (itc->testBase()->asTestTool()) {
|
if (itc->testBase()->type() == ITestBase::Tool) {
|
||||||
if (itc->project() != SessionManager::startupProject()) {
|
if (itc->project() != SessionManager::startupProject()) {
|
||||||
projectChanged = true;
|
projectChanged = true;
|
||||||
toBeRemoved.append(itc);
|
toBeRemoved.append(itc);
|
||||||
|
@@ -374,7 +374,7 @@ void TestTreeModel::synchronizeTestTools()
|
|||||||
QList<ITestTreeItem *> oldFrameworkRoots;
|
QList<ITestTreeItem *> oldFrameworkRoots;
|
||||||
for (Utils::TreeItem *oldFrameworkRoot : *invisibleRoot) {
|
for (Utils::TreeItem *oldFrameworkRoot : *invisibleRoot) {
|
||||||
auto item = static_cast<ITestTreeItem *>(oldFrameworkRoot);
|
auto item = static_cast<ITestTreeItem *>(oldFrameworkRoot);
|
||||||
if (item->testBase()->asTestTool())
|
if (item->testBase()->type() == ITestBase::Tool)
|
||||||
oldFrameworkRoots.append(item);
|
oldFrameworkRoots.append(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user