QtTest: Add missing override

Change-Id: Ibb924f11b82577fb67aa7a1a30b81f4d8d7d36fc
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Alexander Volkov 2016-11-25 13:52:55 +03:00
parent f88f405401
commit ed6f129026
10 changed files with 71 additions and 71 deletions

View File

@ -63,15 +63,15 @@ class QBenchmarkEvent : public QBenchmarkMeasurerBase, public QAbstractNativeEve
public:
QBenchmarkEvent();
~QBenchmarkEvent();
void start();
qint64 checkpoint();
qint64 stop();
bool isMeasurementAccepted(qint64 measurement);
int adjustIterationCount(int suggestion);
int adjustMedianCount(int suggestion);
bool repeatCount() { return 1; }
QTest::QBenchmarkMetric metricType();
virtual bool nativeEventFilter(const QByteArray &eventType, void *message, long *result);
void start() override;
qint64 checkpoint() override;
qint64 stop() override;
bool isMeasurementAccepted(qint64 measurement) override;
int adjustIterationCount(int suggestion) override;
int adjustMedianCount(int suggestion) override;
bool repeatCount() override { return 1; }
QTest::QBenchmarkMetric metricType() override;
bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) override;
qint64 eventCounter;
};

View File

@ -60,14 +60,14 @@ QT_BEGIN_NAMESPACE
class QBenchmarkTimeMeasurer : public QBenchmarkMeasurerBase
{
public:
void start();
qint64 checkpoint();
qint64 stop();
bool isMeasurementAccepted(qint64 measurement);
int adjustIterationCount(int sugestion);
int adjustMedianCount(int suggestion);
bool needsWarmupIteration();
QTest::QBenchmarkMetric metricType();
void start() override;
qint64 checkpoint() override;
qint64 stop() override;
bool isMeasurementAccepted(qint64 measurement) override;
int adjustIterationCount(int sugestion) override;
int adjustMedianCount(int suggestion) override;
bool needsWarmupIteration() override;
QTest::QBenchmarkMetric metricType() override;
private:
QElapsedTimer time;
};
@ -77,14 +77,14 @@ private:
class QBenchmarkTickMeasurer : public QBenchmarkMeasurerBase
{
public:
void start();
qint64 checkpoint();
qint64 stop();
bool isMeasurementAccepted(qint64 measurement);
int adjustIterationCount(int);
int adjustMedianCount(int suggestion);
bool needsWarmupIteration();
QTest::QBenchmarkMetric metricType();
void start() override;
qint64 checkpoint() override;
qint64 stop() override;
bool isMeasurementAccepted(qint64 measurement) override;
int adjustIterationCount(int) override;
int adjustMedianCount(int suggestion) override;
bool needsWarmupIteration() override;
QTest::QBenchmarkMetric metricType() override;
private:
CycleCounterTicks startTicks;
};

View File

@ -76,14 +76,14 @@ public:
class QBenchmarkCallgrindMeasurer : public QBenchmarkMeasurerBase
{
public:
void start();
qint64 checkpoint();
qint64 stop();
bool isMeasurementAccepted(qint64 measurement);
int adjustIterationCount(int);
int adjustMedianCount(int);
bool needsWarmupIteration();
QTest::QBenchmarkMetric metricType();
void start() override;
qint64 checkpoint() override;
qint64 stop() override;
bool isMeasurementAccepted(qint64 measurement) override;
int adjustIterationCount(int) override;
int adjustMedianCount(int) override;
bool needsWarmupIteration() override;
QTest::QBenchmarkMetric metricType() override;
};
QT_END_NAMESPACE

View File

@ -61,18 +61,18 @@ public:
QPlainTestLogger(const char *filename);
~QPlainTestLogger();
void startLogging();
void stopLogging();
void startLogging() override;
void stopLogging() override;
void enterTestFunction(const char *function);
void leaveTestFunction();
void enterTestFunction(const char *function) override;
void leaveTestFunction() override;
void addIncident(IncidentTypes type, const char *description,
const char *file = 0, int line = 0);
void addBenchmarkResult(const QBenchmarkResult &result);
const char *file = 0, int line = 0) override;
void addBenchmarkResult(const QBenchmarkResult &result) override;
void addMessage(MessageTypes type, const QString &message,
const char *file = 0, int line = 0);
const char *file = 0, int line = 0) override;
private:
void printMessage(const char *type, const char *msg, const char *file = 0, int line = 0);

View File

@ -63,18 +63,18 @@ public:
QTeamCityLogger(const char *filename);
~QTeamCityLogger();
void startLogging();
void stopLogging();
void startLogging() override;
void stopLogging() override;
void enterTestFunction(const char *function);
void leaveTestFunction();
void enterTestFunction(const char *function) override;
void leaveTestFunction() override;
void addIncident(IncidentTypes type, const char *description,
const char *file = 0, int line = 0);
void addBenchmarkResult(const QBenchmarkResult &result);
const char *file = 0, int line = 0) override;
void addBenchmarkResult(const QBenchmarkResult &result) override;
void addMessage(MessageTypes type, const QString &message,
const char *file = 0, int line = 0);
const char *file = 0, int line = 0) override;
private:
QString currTestFuncName;

View File

@ -925,7 +925,7 @@ public:
waitCondition.wakeAll();
}
void run() {
void run() override {
QMutexLocker locker(&mutex);
waitCondition.wakeAll();
while (1) {

View File

@ -79,10 +79,10 @@ public:
inline QTestKeyEvent(QTest::KeyAction action, char ascii, Qt::KeyboardModifiers modifiers, int delay)
: _action(action), _delay(delay), _modifiers(modifiers),
_ascii(ascii), _key(Qt::Key_unknown) {}
inline QTestEvent *clone() const { return new QTestKeyEvent(*this); }
inline QTestEvent *clone() const override { return new QTestKeyEvent(*this); }
#ifdef QT_WIDGETS_LIB
inline void simulate(QWidget *w)
inline void simulate(QWidget *w) override
{
if (_ascii == 0)
QTest::keyEvent(_action, w, _key, _modifiers, _delay);
@ -104,10 +104,10 @@ class QTestKeyClicksEvent: public QTestEvent
public:
inline QTestKeyClicksEvent(const QString &keys, Qt::KeyboardModifiers modifiers, int delay)
: _keys(keys), _modifiers(modifiers), _delay(delay) {}
inline QTestEvent *clone() const { return new QTestKeyClicksEvent(*this); }
inline QTestEvent *clone() const override { return new QTestKeyClicksEvent(*this); }
#ifdef QT_WIDGETS_LIB
inline void simulate(QWidget *w)
inline void simulate(QWidget *w) override
{
QTest::keyClicks(w, _keys, _modifiers, _delay);
}
@ -125,10 +125,10 @@ public:
inline QTestMouseEvent(QTest::MouseAction action, Qt::MouseButton button,
Qt::KeyboardModifiers modifiers, QPoint position, int delay)
: _action(action), _button(button), _modifiers(modifiers), _pos(position), _delay(delay) {}
inline QTestEvent *clone() const { return new QTestMouseEvent(*this); }
inline QTestEvent *clone() const override { return new QTestMouseEvent(*this); }
#ifdef QT_WIDGETS_LIB
inline void simulate(QWidget *w)
inline void simulate(QWidget *w) override
{
QTest::mouseEvent(_action, w, _button, _modifiers, _pos, _delay);
}
@ -148,10 +148,10 @@ class QTestDelayEvent: public QTestEvent
{
public:
inline QTestDelayEvent(int msecs): _delay(msecs) {}
inline QTestEvent *clone() const { return new QTestDelayEvent(*this); }
inline QTestEvent *clone() const override { return new QTestDelayEvent(*this); }
#ifdef QT_WIDGETS_LIB
inline void simulate(QWidget * /*w*/) { QTest::qWait(_delay); }
inline void simulate(QWidget * /*w*/) override { QTest::qWait(_delay); }
#endif
private:

View File

@ -80,7 +80,7 @@ public Q_SLOTS:
inline void exitLoop();
protected:
inline void timerEvent(QTimerEvent *e);
inline void timerEvent(QTimerEvent *e) override;
private:
bool inLoop;

View File

@ -64,18 +64,18 @@ public:
QXmlTestLogger(XmlMode mode, const char *filename);
~QXmlTestLogger();
void startLogging();
void stopLogging();
void startLogging() override;
void stopLogging() override;
void enterTestFunction(const char *function);
void leaveTestFunction();
void enterTestFunction(const char *function) override;
void leaveTestFunction() override;
void addIncident(IncidentTypes type, const char *description,
const char *file = 0, int line = 0);
void addBenchmarkResult(const QBenchmarkResult &result);
const char *file = 0, int line = 0) override;
void addBenchmarkResult(const QBenchmarkResult &result) override;
void addMessage(MessageTypes type, const QString &message,
const char *file = 0, int line = 0);
const char *file = 0, int line = 0) override;
static int xmlCdata(QTestCharBuffer *dest, char const* src);
static int xmlQuote(QTestCharBuffer *dest, char const* src);

View File

@ -64,19 +64,19 @@ class QXunitTestLogger : public QAbstractTestLogger
QXunitTestLogger(const char *filename);
~QXunitTestLogger();
void startLogging();
void stopLogging();
void startLogging() override;
void stopLogging() override;
void enterTestFunction(const char *function);
void leaveTestFunction();
void enterTestFunction(const char *function) override;
void leaveTestFunction() override;
void addIncident(IncidentTypes type, const char *description,
const char *file = 0, int line = 0);
void addBenchmarkResult(const QBenchmarkResult &result);
const char *file = 0, int line = 0) override;
void addBenchmarkResult(const QBenchmarkResult &result) override;
void addTag(QTestElement* element);
void addMessage(MessageTypes type, const QString &message,
const char *file = 0, int line = 0);
const char *file = 0, int line = 0) override;
private:
QTestElement *listOfTestcases;