Commit fb7ceae6 authored by Christian Stenger's avatar Christian Stenger
Browse files

Use Qt style for enums



Change-Id: I10c1379dea467f10214772168f4c1ec3134a99ee
Reviewed-by: default avatarNiels Weber <niels.weber@theqtcompany.com>
parent 9d9adcc8
......@@ -389,7 +389,7 @@ static TestTreeItem *constructTestTreeItem(const QString &fileName,
const QMap<QString, TestCodeLocationAndType> &functions,
const QMap<QString, TestCodeLocationList> dataTags = QMap<QString, TestCodeLocationList>())
{
TestTreeItem *treeItem = new TestTreeItem(testCaseName, fileName, TestTreeItem::TEST_CLASS);
TestTreeItem *treeItem = new TestTreeItem(testCaseName, fileName, TestTreeItem::TestClass);
treeItem->setMainFile(mainFile); // used for Quick Tests only
treeItem->setLine(line);
treeItem->setColumn(column);
......
......@@ -104,9 +104,9 @@ void TestNavigationWidget::contextMenuEvent(QContextMenuEvent *event)
// do not provide this menu entry for unnamed Quick Tests as it makes no sense
int type = index.data(TypeRole).toInt();
const QString &unnamed = tr(Constants::UNNAMED_QUICKTESTS);
if ((type == TestTreeItem::TEST_FUNCTION && index.parent().data().toString() != unnamed)
|| (type == TestTreeItem::TEST_CLASS && index.data().toString() != unnamed)
|| (type == TestTreeItem::TEST_DATATAG)) {
if ((type == TestTreeItem::TestFunction && index.parent().data().toString() != unnamed)
|| (type == TestTreeItem::TestClass && index.data().toString() != unnamed)
|| (type == TestTreeItem::TestDataTag)) {
runThisTest = new QAction(tr("Run This Test"), &menu);
runThisTest->setEnabled(enabled);
connect(runThisTest, &QAction::triggered,
......@@ -250,8 +250,8 @@ void TestNavigationWidget::onRunThisTestTriggered()
return;
TestTreeItem *item = static_cast<TestTreeItem *>(sourceIndex.internalPointer());
if (item->type() == TestTreeItem::TEST_CLASS || item->type() == TestTreeItem::TEST_FUNCTION
|| item->type() == TestTreeItem::TEST_DATATAG) {
if (item->type() == TestTreeItem::TestClass || item->type() == TestTreeItem::TestFunction
|| item->type() == TestTreeItem::TestDataTag) {
if (TestConfiguration *configuration = m_model->getTestConfiguration(item)) {
TestRunner *runner = TestRunner::instance();
runner->setSelectedTests( {configuration} );
......
......@@ -35,7 +35,7 @@ TestResult::TestResult()
TestResult::TestResult(const QString &className)
: m_class(className)
, m_result(Result::INVALID)
, m_result(Result::Invalid)
, m_line(0)
{
}
......@@ -43,33 +43,33 @@ TestResult::TestResult(const QString &className)
Result::Type TestResult::resultFromString(const QString &resultString)
{
if (resultString == QLatin1String("pass"))
return Result::PASS;
return Result::Pass;
if (resultString == QLatin1String("fail"))
return Result::FAIL;
return Result::Fail;
if (resultString == QLatin1String("xfail"))
return Result::EXPECTED_FAIL;
return Result::ExpectedFail;
if (resultString == QLatin1String("xpass"))
return Result::UNEXPECTED_PASS;
return Result::UnexpectedPass;
if (resultString == QLatin1String("skip"))
return Result::SKIP;
return Result::Skip;
if (resultString == QLatin1String("qdebug"))
return Result::MESSAGE_DEBUG;
return Result::MessageDebug;
if (resultString == QLatin1String("warn") || resultString == QLatin1String("qwarn"))
return Result::MESSAGE_WARN;
return Result::MessageWarn;
if (resultString == QLatin1String("qfatal"))
return Result::MESSAGE_FATAL;
return Result::MessageFatal;
if (resultString == QLatin1String("bpass"))
return Result::BLACKLISTED_PASS;
return Result::BlacklistedPass;
if (resultString == QLatin1String("bfail"))
return Result::BLACKLISTED_FAIL;
return Result::BlacklistedFail;
qDebug("Unexpected test result: %s", qPrintable(resultString));
return Result::INVALID;
return Result::Invalid;
}
Result::Type TestResult::toResultType(int rt)
{
if (rt < Result::FIRST_TYPE || rt > Result::LAST_TYPE)
return Result::INVALID;
return Result::Invalid;
return (Result::Type)rt;
}
......@@ -80,27 +80,27 @@ QString TestResult::resultToString(const Result::Type type)
return QString();
switch (type) {
case Result::PASS:
case Result::Pass:
return QLatin1String("PASS");
case Result::FAIL:
case Result::Fail:
return QLatin1String("FAIL");
case Result::EXPECTED_FAIL:
case Result::ExpectedFail:
return QLatin1String("XFAIL");
case Result::UNEXPECTED_PASS:
case Result::UnexpectedPass:
return QLatin1String("XPASS");
case Result::SKIP:
case Result::Skip:
return QLatin1String("SKIP");
case Result::BENCHMARK:
case Result::Benchmark:
return QLatin1String("BENCH");
case Result::MESSAGE_DEBUG:
case Result::MessageDebug:
return QLatin1String("DEBUG");
case Result::MESSAGE_WARN:
case Result::MessageWarn:
return QLatin1String("WARN");
case Result::MESSAGE_FATAL:
case Result::MessageFatal:
return QLatin1String("FATAL");
case Result::BLACKLISTED_PASS:
case Result::BlacklistedPass:
return QLatin1String("BPASS");
case Result::BLACKLISTED_FAIL:
case Result::BlacklistedFail:
return QLatin1String("BFAIL");
default:
return QLatin1String("UNKNOWN");
......@@ -113,25 +113,25 @@ QColor TestResult::colorForType(const Result::Type type)
return QColor("transparent");
switch (type) {
case Result::PASS:
case Result::Pass:
return QColor("#009900");
case Result::FAIL:
case Result::Fail:
return QColor("#a00000");
case Result::EXPECTED_FAIL:
case Result::ExpectedFail:
return QColor("#00ff00");
case Result::UNEXPECTED_PASS:
case Result::UnexpectedPass:
return QColor("#ff0000");
case Result::SKIP:
case Result::Skip:
return QColor("#787878");
case Result::BLACKLISTED_PASS:
case Result::BlacklistedPass:
return QColor(0, 0, 0);
case Result::BLACKLISTED_FAIL:
case Result::BlacklistedFail:
return QColor(0, 0, 0);
case Result::MESSAGE_DEBUG:
case Result::MessageDebug:
return QColor("#329696");
case Result::MESSAGE_WARN:
case Result::MessageWarn:
return QColor("#d0bb00");
case Result::MESSAGE_FATAL:
case Result::MessageFatal:
return QColor("#640000");
default:
return QColor("#000000");
......
......@@ -29,28 +29,28 @@ namespace Internal {
namespace Result{
enum Type {
PASS, FIRST_TYPE = PASS,
FAIL,
EXPECTED_FAIL,
UNEXPECTED_PASS,
SKIP,
BLACKLISTED_PASS,
BLACKLISTED_FAIL,
BENCHMARK,
MESSAGE_DEBUG,
MESSAGE_WARN,
MESSAGE_FATAL,
MESSAGE_INTERNAL, INTERNAL_MESSAGES_BEGIN = MESSAGE_INTERNAL,
MESSAGE_TEST_CASE_START,
MESSAGE_TEST_CASE_SUCCESS,
MESSAGE_TEST_CASE_WARN,
MESSAGE_TEST_CASE_FAIL,
MESSAGE_TEST_CASE_END,
MESSAGE_CURRENT_TEST, INTERNAL_MESSAGES_END = MESSAGE_CURRENT_TEST,
INVALID,
LAST_TYPE = INVALID
Pass, FIRST_TYPE = Pass,
Fail,
ExpectedFail,
UnexpectedPass,
Skip,
BlacklistedPass,
BlacklistedFail,
Benchmark,
MessageDebug,
MessageWarn,
MessageFatal,
MessageInternal, INTERNAL_MESSAGES_BEGIN = MessageInternal,
MessageTestCaseStart,
MessageTestCaseSuccess,
MessageTestCaseWarn,
MessageTestCaseFail,
MessageTestCaseEnd,
MessageCurrentTest, INTERNAL_MESSAGES_END = MessageCurrentTest,
Invalid,
LAST_TYPE = Invalid
};
}
......
......@@ -42,12 +42,12 @@ QString TestResultDelegate::outputString(const TestResult &testResult, bool sele
const QString desc = testResult.description();
QString output;
switch (testResult.result()) {
case Result::PASS:
case Result::FAIL:
case Result::EXPECTED_FAIL:
case Result::UNEXPECTED_PASS:
case Result::BLACKLISTED_FAIL:
case Result::BLACKLISTED_PASS:
case Result::Pass:
case Result::Fail:
case Result::ExpectedFail:
case Result::UnexpectedPass:
case Result::BlacklistedFail:
case Result::BlacklistedPass:
output = testResult.className() + QLatin1String("::") + testResult.testCase();
if (!testResult.dataTag().isEmpty())
output.append(QString::fromLatin1(" (%1)").arg(testResult.dataTag()));
......@@ -55,7 +55,7 @@ QString TestResultDelegate::outputString(const TestResult &testResult, bool sele
output.append(QLatin1Char('\n')).append(desc);
}
break;
case Result::BENCHMARK:
case Result::Benchmark:
output = testResult.className() + QLatin1String("::") + testResult.testCase();
if (!testResult.dataTag().isEmpty())
output.append(QString::fromLatin1(" (%1)").arg(testResult.dataTag()));
......
......@@ -52,14 +52,14 @@ static QIcon testResultIcon(Result::Type result) {
QIcon(QLatin1String(":/images/fatal.png")),
}; // provide an icon for unknown??
if (result < 0 || result >= Result::MESSAGE_INTERNAL) {
if (result < 0 || result >= Result::MessageInternal) {
switch (result) {
case Result::MESSAGE_TEST_CASE_SUCCESS:
return icons[Result::PASS];
case Result::MESSAGE_TEST_CASE_FAIL:
return icons[Result::FAIL];
case Result::MESSAGE_TEST_CASE_WARN:
return icons[Result::MESSAGE_WARN];
case Result::MessageTestCaseSuccess:
return icons[Result::Pass];
case Result::MessageTestCaseFail:
return icons[Result::Fail];
case Result::MessageTestCaseWarn:
return icons[Result::MessageWarn];
default:
return QIcon();
}
......@@ -84,25 +84,25 @@ void TestResultItem::updateDescription(const QString &description)
void TestResultItem::updateResult()
{
if (m_testResult->result() != Result::MESSAGE_TEST_CASE_START)
if (m_testResult->result() != Result::MessageTestCaseStart)
return;
Result::Type newResult = Result::MESSAGE_TEST_CASE_SUCCESS;
Result::Type newResult = Result::MessageTestCaseSuccess;
foreach (Utils::TreeItem *child, children()) {
const TestResult *current = static_cast<TestResultItem *>(child)->testResult();
if (current) {
switch (current->result()) {
case Result::FAIL:
case Result::MESSAGE_FATAL:
case Result::UNEXPECTED_PASS:
m_testResult->setResult(Result::MESSAGE_TEST_CASE_FAIL);
case Result::Fail:
case Result::MessageFatal:
case Result::UnexpectedPass:
m_testResult->setResult(Result::MessageTestCaseFail);
return;
case Result::EXPECTED_FAIL:
case Result::MESSAGE_WARN:
case Result::SKIP:
case Result::BLACKLISTED_FAIL:
case Result::BLACKLISTED_PASS:
newResult = Result::MESSAGE_TEST_CASE_WARN;
case Result::ExpectedFail:
case Result::MessageWarn:
case Result::Skip:
case Result::BlacklistedFail:
case Result::BlacklistedPass:
newResult = Result::MessageTestCaseWarn;
break;
default: {}
}
......@@ -133,7 +133,7 @@ QVariant TestResultModel::data(const QModelIndex &idx, int role) const
void TestResultModel::addTestResult(TestResult *testResult, bool autoExpand)
{
const bool isCurrentTestMssg = testResult->result() == Result::MESSAGE_CURRENT_TEST;
const bool isCurrentTestMssg = testResult->result() == Result::MessageCurrentTest;
QVector<Utils::TreeItem *> topLevelItems = rootItem()->children();
int lastRow = topLevelItems.size() - 1;
......@@ -143,11 +143,11 @@ void TestResultModel::addTestResult(TestResult *testResult, bool autoExpand)
int count = m_testResultCount.value(testResult->result(), 0);
m_testResultCount.insert(testResult->result(), ++count);
} else {
// MESSAGE_CURRENT_TEST should always be the last top level item
// MessageCurrentTest should always be the last top level item
if (lastRow >= 0) {
TestResultItem *current = static_cast<TestResultItem *>(topLevelItems.at(lastRow));
const TestResult *result = current->testResult();
if (result && result->result() == Result::MESSAGE_CURRENT_TEST) {
if (result && result->result() == Result::MessageCurrentTest) {
current->updateDescription(testResult->description());
emit dataChanged(current->index(), current->index());
return;
......@@ -166,18 +166,18 @@ void TestResultModel::addTestResult(TestResult *testResult, bool autoExpand)
current->appendChild(newItem);
if (autoExpand)
current->expand();
if (testResult->result() == Result::MESSAGE_TEST_CASE_END) {
if (testResult->result() == Result::MessageTestCaseEnd) {
current->updateResult();
emit dataChanged(current->index(), current->index());
}
return;
}
}
// if we have a MESSAGE_CURRENT_TEST present, add the new top level item before it
// if we have a MessageCurrentTest present, add the new top level item before it
if (lastRow >= 0) {
TestResultItem *current = static_cast<TestResultItem *>(topLevelItems.at(lastRow));
const TestResult *result = current->testResult();
if (result && result->result() == Result::MESSAGE_CURRENT_TEST) {
if (result && result->result() == Result::MessageCurrentTest) {
rootItem()->insertChild(current->index().row(), newItem);
return;
}
......@@ -191,7 +191,7 @@ void TestResultModel::removeCurrentTestMessage()
QVector<Utils::TreeItem *> topLevelItems = rootItem()->children();
for (int row = topLevelItems.size() - 1; row >= 0; --row) {
TestResultItem *current = static_cast<TestResultItem *>(topLevelItems.at(row));
if (current->testResult()->result() == Result::MESSAGE_CURRENT_TEST) {
if (current->testResult()->result() == Result::MessageCurrentTest) {
delete takeItem(current);
break;
}
......@@ -272,14 +272,14 @@ TestResultFilterModel::TestResultFilterModel(TestResultModel *sourceModel, QObje
void TestResultFilterModel::enableAllResultTypes()
{
m_enabled << Result::PASS << Result::FAIL << Result::EXPECTED_FAIL
<< Result::UNEXPECTED_PASS << Result::SKIP << Result::MESSAGE_DEBUG
<< Result::MESSAGE_WARN << Result::MESSAGE_INTERNAL
<< Result::MESSAGE_FATAL << Result::INVALID << Result::BLACKLISTED_PASS
<< Result::BLACKLISTED_FAIL << Result::BENCHMARK
<< Result::MESSAGE_CURRENT_TEST << Result::MESSAGE_TEST_CASE_START
<< Result::MESSAGE_TEST_CASE_SUCCESS << Result::MESSAGE_TEST_CASE_WARN
<< Result::MESSAGE_TEST_CASE_FAIL << Result::MESSAGE_TEST_CASE_END;
m_enabled << Result::Pass << Result::Fail << Result::ExpectedFail
<< Result::UnexpectedPass << Result::Skip << Result::MessageDebug
<< Result::MessageWarn << Result::MessageInternal
<< Result::MessageFatal << Result::Invalid << Result::BlacklistedPass
<< Result::BlacklistedFail << Result::Benchmark
<< Result::MessageCurrentTest << Result::MessageTestCaseStart
<< Result::MessageTestCaseSuccess << Result::MessageTestCaseWarn
<< Result::MessageTestCaseFail << Result::MessageTestCaseEnd;
invalidateFilter();
}
......@@ -287,12 +287,12 @@ void TestResultFilterModel::toggleTestResultType(Result::Type type)
{
if (m_enabled.contains(type)) {
m_enabled.remove(type);
if (type == Result::MESSAGE_INTERNAL)
m_enabled.remove(Result::MESSAGE_TEST_CASE_END);
if (type == Result::MessageInternal)
m_enabled.remove(Result::MessageTestCaseEnd);
} else {
m_enabled.insert(type);
if (type == Result::MESSAGE_INTERNAL)
m_enabled.insert(Result::MESSAGE_TEST_CASE_END);
if (type == Result::MessageInternal)
m_enabled.insert(Result::MessageTestCaseEnd);
}
invalidateFilter();
}
......
......@@ -394,23 +394,23 @@ void TestResultsPane::initializeFilterMenu()
const bool omitIntern = AutotestPlugin::instance()->settings()->omitInternalMssg;
// FilterModel has all messages enabled by default
if (omitIntern)
m_filterModel->toggleTestResultType(Result::MESSAGE_INTERNAL);
m_filterModel->toggleTestResultType(Result::MessageInternal);
QMap<Result::Type, QString> textAndType;
textAndType.insert(Result::PASS, tr("Pass"));
textAndType.insert(Result::FAIL, tr("Fail"));
textAndType.insert(Result::EXPECTED_FAIL, tr("Expected Fail"));
textAndType.insert(Result::UNEXPECTED_PASS, tr("Unexpected Pass"));
textAndType.insert(Result::SKIP, tr("Skip"));
textAndType.insert(Result::BENCHMARK, tr("Benchmarks"));
textAndType.insert(Result::MESSAGE_DEBUG, tr("Debug Messages"));
textAndType.insert(Result::MESSAGE_WARN, tr("Warning Messages"));
textAndType.insert(Result::MESSAGE_INTERNAL, tr("Internal Messages"));
textAndType.insert(Result::Pass, tr("Pass"));
textAndType.insert(Result::Fail, tr("Fail"));
textAndType.insert(Result::ExpectedFail, tr("Expected Fail"));
textAndType.insert(Result::UnexpectedPass, tr("Unexpected Pass"));
textAndType.insert(Result::Skip, tr("Skip"));
textAndType.insert(Result::Benchmark, tr("Benchmarks"));
textAndType.insert(Result::MessageDebug, tr("Debug Messages"));
textAndType.insert(Result::MessageWarn, tr("Warning Messages"));
textAndType.insert(Result::MessageInternal, tr("Internal Messages"));
foreach (Result::Type result, textAndType.keys()) {
QAction *action = new QAction(m_filterMenu);
action->setText(textAndType.value(result));
action->setCheckable(true);
action->setChecked(result != Result::MESSAGE_INTERNAL || !omitIntern);
action->setChecked(result != Result::MessageInternal || !omitIntern);
action->setData(result);
m_filterMenu->addAction(action);
}
......@@ -425,22 +425,22 @@ void TestResultsPane::initializeFilterMenu()
void TestResultsPane::updateSummaryLabel()
{
QString labelText = QString::fromLatin1("<p><b>Test summary:</b>&nbsp;&nbsp; %1 %2, %3 %4")
.arg(QString::number(m_model->resultTypeCount(Result::PASS)), tr("passes"),
QString::number(m_model->resultTypeCount(Result::FAIL)), tr("fails"));
int count = m_model->resultTypeCount(Result::UNEXPECTED_PASS);
.arg(QString::number(m_model->resultTypeCount(Result::Pass)), tr("passes"),
QString::number(m_model->resultTypeCount(Result::Fail)), tr("fails"));
int count = m_model->resultTypeCount(Result::UnexpectedPass);
if (count)
labelText.append(QString::fromLatin1(", %1 %2")
.arg(QString::number(count), tr("unexpected passes")));
count = m_model->resultTypeCount(Result::EXPECTED_FAIL);
count = m_model->resultTypeCount(Result::ExpectedFail);
if (count)
labelText.append(QString::fromLatin1(", %1 %2")
.arg(QString::number(count), tr("expected fails")));
count = m_model->resultTypeCount(Result::MESSAGE_FATAL);
count = m_model->resultTypeCount(Result::MessageFatal);
if (count)
labelText.append(QString::fromLatin1(", %1 %2")
.arg(QString::number(count), tr("fatals")));
count = m_model->resultTypeCount(Result::BLACKLISTED_FAIL)
+ m_model->resultTypeCount(Result::BLACKLISTED_PASS);
count = m_model->resultTypeCount(Result::BlacklistedFail)
+ m_model->resultTypeCount(Result::BlacklistedPass);
if (count)
labelText.append(QString::fromLatin1(", %1 %2")
.arg(QString::number(count), tr("blacklisted")));
......
......@@ -114,7 +114,7 @@ void performTestRun(QFutureInterface<void> &futureInterface,
if (config->project()) {
testCaseCount += config->testCaseCount();
} else {
emitTestResultCreated(new FaultyTestResult(Result::MESSAGE_WARN,
emitTestResultCreated(new FaultyTestResult(Result::MessageWarn,
QObject::tr("Project is null for \"%1\". Removing from test run.\n"
"Check the test environment.").arg(config->displayName())));
}
......@@ -148,7 +148,7 @@ void performTestRun(QFutureInterface<void> &futureInterface,
QProcessEnvironment environment = testConfiguration->environment().toProcessEnvironment();
QString commandFilePath = executableFilePath(testConfiguration->targetFile(), environment);
if (commandFilePath.isEmpty()) {
emitTestResultCreated(new FaultyTestResult(Result::MESSAGE_FATAL,
emitTestResultCreated(new FaultyTestResult(Result::MessageFatal,
QObject::tr("Could not find command \"%1\". (%2)")
.arg(testConfiguration->targetFile())
.arg(testConfiguration->displayName())));
......@@ -177,7 +177,7 @@ void performTestRun(QFutureInterface<void> &futureInterface,
if (futureInterface.isCanceled()) {
testProcess.kill();
testProcess.waitForFinished();
emitTestResultCreated(new FaultyTestResult(Result::MESSAGE_FATAL,
emitTestResultCreated(new FaultyTestResult(Result::MessageFatal,
QObject::tr("Test run canceled by user.")));
}
qApp->processEvents();
......@@ -188,7 +188,7 @@ void performTestRun(QFutureInterface<void> &futureInterface,
if (testProcess.state() != QProcess::NotRunning) {
testProcess.kill();
testProcess.waitForFinished();
emitTestResultCreated(new FaultyTestResult(Result::MESSAGE_FATAL, QObject::tr(
emitTestResultCreated(new FaultyTestResult(Result::MessageFatal, QObject::tr(
"Test case canceled due to timeout. \nMaybe raise the timeout?")));
}
}
......@@ -208,14 +208,14 @@ void TestRunner::prepareToRunTests()
foreach (TestConfiguration *config, m_selectedTests) {
if (!omitRunConfigWarnings && config->guessedConfiguration()) {
TestResultsPane::instance()->addTestResult(new FaultyTestResult(Result::MESSAGE_WARN,
TestResultsPane::instance()->addTestResult(new FaultyTestResult(Result::MessageWarn,
tr("Project's run configuration was guessed for \"%1\".\n"
"This might cause trouble during execution.").arg(config->displayName())));
}
}
if (m_selectedTests.empty()) {
TestResultsPane::instance()->addTestResult(new FaultyTestResult(Result::MESSAGE_WARN,
TestResultsPane::instance()->addTestResult(new FaultyTestResult(Result::MessageWarn,
tr("No tests selected. Canceling test run.")));
onFinished();
return;
......@@ -223,7 +223,7 @@ void TestRunner::prepareToRunTests()
ProjectExplorer::Project *project = m_selectedTests.at(0)->project();
if (!project) {
TestResultsPane::instance()->addTestResult(new FaultyTestResult(Result::MESSAGE_WARN,
TestResultsPane::instance()->addTestResult(new FaultyTestResult(Result::MessageWarn,
tr("Project is null. Canceling test run.\n"
"Only desktop kits are supported. Make sure the "
"currently active kit is a desktop kit.")));
......@@ -239,7 +239,7 @@ void TestRunner::prepareToRunTests()
if (project->hasActiveBuildSettings()) {
buildProject(project);
} else {
TestResultsPane::instance()->addTestResult(new FaultyTestResult(Result::MESSAGE_FATAL,
TestResultsPane::instance()->addTestResult(new FaultyTestResult(Result::MessageFatal,
tr("Project is not configured. Canceling test run.")));
onFinished();
return;
......@@ -284,7 +284,7 @@ void TestRunner::buildFinished(bool success)
if (success) {
runTests();
} else {
TestResultsPane::instance()->addTestResult(new FaultyTestResult(Result::MESSAGE_FATAL,
TestResultsPane::instance()->addTestResult(new FaultyTestResult(Result::MessageFatal,
tr("Build failed. Canceling test run.")));
onFinished();
}
......
......@@ -37,8 +37,8 @@ TestTreeItem::TestTreeItem(const QString &name, const QString &filePath, Type ty
m_line(0)
{
switch (m_type) {
case TEST_CLASS:
case TEST_FUNCTION:
case TestClass:
case TestFunction:
m_checked = Qt::Checked;
break;
default:
......@@ -82,14 +82,14 @@ QVariant TestTreeItem::data(int /*column*/, int role) const
{
switch (role) {
case Qt::DisplayRole:
if (m_type == ROOT && childCount() == 0)
if (m_type == Root && childCount() == 0)
return QString(m_name + QObject::tr(" (none)"));
else if (m_name.isEmpty())
return QObject::tr(Constants::UNNAMED_QUICKTESTS);
else
return m_name;
case Qt::ToolTipRole:
if (m_type == TEST_CLASS && m_name.isEmpty()) {
if (m_type == TestClass && m_name.isEmpty()) {
return QObject::tr("<p>Give all test cases a name to ensure correct behavior "
"when running test cases and to be able to select them.</p>");
}
......@@ -98,14 +98,14 @@ QVariant TestTreeItem::data(int /*column*/, int role) const
return testTreeIcon(m_type);
case Qt::CheckStateRole:
switch (m_type) {
case ROOT:
case TEST_DATAFUNCTION:
case TEST_SPECIALFUNCTION:
case TEST_DATATAG:
case Root:
case TestDataFunction:
case TestSpecialFunction:
case TestDataTag:
return QVariant();
case TEST_CLASS:
case TestClass:
return m_name.isEmpty() ? QVariant() : checked();