Remove spurious class prefixes from subclass code
The subclass's code can refer to the base's public enums without needing the (long) class prefix. Change-Id: I4824440d216695aee9345776faba2e510130425e Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
parent
8d120174e9
commit
98a42b1627
@ -224,7 +224,7 @@ void QJUnitTestLogger::leaveTestCase()
|
||||
void QJUnitTestLogger::addIncident(IncidentTypes type, const char *description,
|
||||
const char *file, int line)
|
||||
{
|
||||
if (type == QAbstractTestLogger::Fail || type == QAbstractTestLogger::XPass) {
|
||||
if (type == Fail || type == XPass) {
|
||||
auto failureType = [&]() {
|
||||
switch (type) {
|
||||
case QAbstractTestLogger::Fail: return "fail";
|
||||
@ -234,11 +234,11 @@ void QJUnitTestLogger::addIncident(IncidentTypes type, const char *description,
|
||||
}();
|
||||
|
||||
addFailure(QTest::LET_Failure, failureType, QString::fromUtf8(description));
|
||||
} else if (type == QAbstractTestLogger::XFail) {
|
||||
} else if (type == XFail) {
|
||||
// Since XFAIL does not add a failure to the testlog in JUnit XML we add a
|
||||
// message, so we still have some information about the expected failure.
|
||||
addMessage(QAbstractTestLogger::Info, QString::fromUtf8(description), file, line);
|
||||
} else if (type == QAbstractTestLogger::Skip) {
|
||||
addMessage(Info, QString::fromUtf8(description), file, line);
|
||||
} else if (type == Skip) {
|
||||
auto skippedElement = new QTestElement(QTest::LET_Skipped);
|
||||
skippedElement->addAttribute(QTest::AI_Message, description);
|
||||
currentTestCase->addChild(skippedElement);
|
||||
@ -287,7 +287,7 @@ void QJUnitTestLogger::addMessage(MessageTypes type, const QString &message, con
|
||||
Q_UNUSED(file);
|
||||
Q_UNUSED(line);
|
||||
|
||||
if (type == QAbstractTestLogger::QFatal) {
|
||||
if (type == QFatal) {
|
||||
addFailure(QTest::LET_Error, "qfatal", message);
|
||||
return;
|
||||
}
|
||||
|
@ -396,7 +396,7 @@ void QPlainTestLogger::addMessage(MessageTypes type, const QString &message,
|
||||
const char *file, int line)
|
||||
{
|
||||
// suppress non-fatal messages in silent mode
|
||||
if (type != QAbstractTestLogger::QFatal && QTestLog::verboseLevel() < 0)
|
||||
if (type != QFatal && QTestLog::verboseLevel() < 0)
|
||||
return;
|
||||
|
||||
printMessage(QTest::messageType2String(type), qPrintable(message), file, line);
|
||||
|
@ -161,7 +161,7 @@ void QTeamCityLogger::addIncident(IncidentTypes type, const char *description,
|
||||
detailedText = tcEscapedString(detailedText);
|
||||
|
||||
// Test failed
|
||||
if ((type == QAbstractTestLogger::Fail) || (type == QAbstractTestLogger::XPass)) {
|
||||
if (type == Fail || type == XPass) {
|
||||
QString messageText(QLatin1String("Failure!"));
|
||||
|
||||
if (file)
|
||||
@ -174,7 +174,7 @@ void QTeamCityLogger::addIncident(IncidentTypes type, const char *description,
|
||||
flowID);
|
||||
|
||||
outputString(qPrintable(buf));
|
||||
} else if (type == QAbstractTestLogger::Skip) {
|
||||
} else if (type == Skip) {
|
||||
if (file)
|
||||
detailedText.append(QLatin1String(" |[Loc: %1(%2)|]").arg(QString::fromUtf8(file)).arg(line));
|
||||
|
||||
@ -206,7 +206,7 @@ void QTeamCityLogger::addMessage(MessageTypes type, const QString &message,
|
||||
const char *file, int line)
|
||||
{
|
||||
// suppress non-fatal messages in silent mode
|
||||
if (type != QAbstractTestLogger::QFatal && QTestLog::verboseLevel() < 0)
|
||||
if (type != QFatal && QTestLog::verboseLevel() < 0)
|
||||
return;
|
||||
|
||||
QString escapedMessage = tcEscapedString(message);
|
||||
|
Loading…
Reference in New Issue
Block a user