Remove unused members and methods from QTestLogger.

QTestLogger was counting various test outputs, but was only using three
of the counters internally and the rest were not used at all.  This
commit removes the unused counters and all of the getter methods.

Change-Id: I447183dcaf3e6cc335bbf58656e25b1d32ba810a
Reviewed-on: http://codereview.qt.nokia.com/3437
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
This commit is contained in:
Jason McDonald 2011-08-24 14:25:20 +10:00 committed by Qt by Nokia
parent a541bd9662
commit 043914bd97
2 changed files with 10 additions and 86 deletions

View File

@ -54,15 +54,16 @@
QT_BEGIN_NAMESPACE
QTestLogger::QTestLogger(int fm)
:listOfTestcases(0), currentLogElement(0), errorLogElement(0),
logFormatter(0), format( (TestLoggerFormat)fm ),
testCounter(0), passCounter(0),
failureCounter(0), errorCounter(0),
warningCounter(0), skipCounter(0),
systemCounter(0), qdebugCounter(0),
qwarnCounter(0), qfatalCounter(0),
infoCounter(0), randomSeed_(0),
hasRandomSeed_(false)
: listOfTestcases(0)
, currentLogElement(0)
, errorLogElement(0)
, logFormatter(0)
, format( (TestLoggerFormat)fm )
, testCounter(0)
, failureCounter(0)
, errorCounter(0)
, randomSeed_(0)
, hasRandomSeed_(false)
{
}
@ -182,11 +183,9 @@ void QTestLogger::addIncident(IncidentTypes type, const char *description,
typeBuf = "xpass";
break;
case QAbstractTestLogger::Pass:
++passCounter;
typeBuf = "pass";
break;
case QAbstractTestLogger::XFail:
++passCounter;
typeBuf = "xfail";
break;
case QAbstractTestLogger::Fail:
@ -302,31 +301,24 @@ void QTestLogger::addMessage(MessageTypes type, const char *message, const char
switch (type) {
case QAbstractTestLogger::Warn:
++warningCounter;
typeBuf = "warn";
break;
case QAbstractTestLogger::QSystem:
++systemCounter;
typeBuf = "system";
break;
case QAbstractTestLogger::QDebug:
++qdebugCounter;
typeBuf = "qdebug";
break;
case QAbstractTestLogger::QWarning:
++qwarnCounter;
typeBuf = "qwarn";
break;
case QAbstractTestLogger::QFatal:
++qfatalCounter;
typeBuf = "qfatal";
break;
case QAbstractTestLogger::Skip:
++skipCounter;
typeBuf = "skip";
break;
case QAbstractTestLogger::Info:
++infoCounter;
typeBuf = "info";
break;
default:
@ -358,56 +350,6 @@ void QTestLogger::addMessage(MessageTypes type, const char *message, const char
}
}
int QTestLogger::passCount() const
{
return passCounter;
}
int QTestLogger::failureCount() const
{
return failureCounter;
}
int QTestLogger::errorCount() const
{
return errorCounter;
}
int QTestLogger::warningCount() const
{
return warningCounter;
}
int QTestLogger::skipCount() const
{
return skipCounter;
}
int QTestLogger::systemCount() const
{
return systemCounter;
}
int QTestLogger::qdebugCount() const
{
return qdebugCounter;
}
int QTestLogger::qwarnCount() const
{
return qwarnCounter;
}
int QTestLogger::qfatalCount() const
{
return qfatalCounter;
}
int QTestLogger::infoCount() const
{
return infoCounter;
}
void QTestLogger::registerRandomSeed(unsigned int seed)
{
randomSeed_ = seed;

View File

@ -87,16 +87,6 @@ class QTestLogger : public QAbstractTestLogger
void addMessage(MessageTypes type, const char *message,
const char *file = 0, int line = 0);
int passCount() const;
int failureCount() const;
int errorCount() const;
int warningCount() const;
int skipCount() const;
int systemCount() const;
int qdebugCount() const;
int qwarnCount() const;
int qfatalCount() const;
int infoCount() const;
void registerRandomSeed(unsigned int seed);
unsigned int randomSeed() const;
bool hasRandomSeed() const;
@ -109,16 +99,8 @@ class QTestLogger : public QAbstractTestLogger
TestLoggerFormat format;
int testCounter;
int passCounter;
int failureCounter;
int errorCounter;
int warningCounter;
int skipCounter;
int systemCounter;
int qdebugCounter;
int qwarnCounter;
int qfatalCounter;
int infoCounter;
unsigned int randomSeed_;
bool hasRandomSeed_;
};