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)
|
||||
{
|
||||
if (config->testBase()->asTestTool())
|
||||
if (config->testBase()->type() == ITestBase::Tool)
|
||||
return {};
|
||||
const TestConfiguration *current = static_cast<const TestConfiguration *>(config);
|
||||
QString info;
|
||||
@@ -477,7 +477,7 @@ int TestRunner::precheckTestConfigurations()
|
||||
const bool omitWarnings = AutotestPlugin::settings()->omitRunConfigWarn;
|
||||
int testCaseCount = 0;
|
||||
for (ITestConfiguration *itc : qAsConst(m_selectedTests)) {
|
||||
if (itc->testBase()->asTestTool()) {
|
||||
if (itc->testBase()->type() == ITestBase::Tool) {
|
||||
if (itc->project()) {
|
||||
testCaseCount += itc->testCaseCount();
|
||||
} else {
|
||||
@@ -524,7 +524,7 @@ void TestRunner::runTests()
|
||||
QList<ITestConfiguration *> toBeRemoved;
|
||||
bool projectChanged = false;
|
||||
for (ITestConfiguration *itc : qAsConst(m_selectedTests)) {
|
||||
if (itc->testBase()->asTestTool()) {
|
||||
if (itc->testBase()->type() == ITestBase::Tool) {
|
||||
if (itc->project() != SessionManager::startupProject()) {
|
||||
projectChanged = true;
|
||||
toBeRemoved.append(itc);
|
||||
|
@@ -374,7 +374,7 @@ void TestTreeModel::synchronizeTestTools()
|
||||
QList<ITestTreeItem *> oldFrameworkRoots;
|
||||
for (Utils::TreeItem *oldFrameworkRoot : *invisibleRoot) {
|
||||
auto item = static_cast<ITestTreeItem *>(oldFrameworkRoot);
|
||||
if (item->testBase()->asTestTool())
|
||||
if (item->testBase()->type() == ITestBase::Tool)
|
||||
oldFrameworkRoots.append(item);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user