From e8e9b62f725f2229ae9e6d0218bbcbf7d54425ee Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Thu, 25 Aug 2011 18:20:19 +1000 Subject: Enable multiple instances of QAbstractTestLogger. Previously QAbstractTestLogger used a global variable for the file pointer to which it was writing test output. This effectively meant that only one instance of this or its derived classes could exist at any time. This commit moves the file pointer inside the class, so that multiple loggers can exist at the same time. This means that the outputString() method can no longer be static, which in turn means that several functions used by QPlainTestLogger need to move from the QTest namespace into the class, and also that QTestBasicStreamer must hold a non-const pointer to its associated logger instead of a const pointer. Task-number: QTBUG-20615 Change-Id: If941f1f9399cf20fb93e3e87f3390bceeca1cbfc Reviewed-on: http://codereview.qt.nokia.com/3576 Reviewed-by: Qt Sanity Bot Reviewed-by: Rohan McGovern --- src/testlib/qplaintestlogger_p.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/testlib/qplaintestlogger_p.h') diff --git a/src/testlib/qplaintestlogger_p.h b/src/testlib/qplaintestlogger_p.h index 1784e3be77..5fa33e6b51 100644 --- a/src/testlib/qplaintestlogger_p.h +++ b/src/testlib/qplaintestlogger_p.h @@ -79,6 +79,10 @@ public: private: unsigned int randomSeed; bool hasRandomSeed; + + void printMessage(const char *type, const char *msg, const char *file = 0, int line = 0); + void outputMessage(const char *str); + void printBenchmarkResult(const QBenchmarkResult &result); }; QT_END_NAMESPACE -- cgit v1.2.3