Enable multiple instances of QAbstractTestLogger.
authorJason McDonald <jason.mcdonald@nokia.com>
Thu, 25 Aug 2011 08:20:19 +0000 (18:20 +1000)
committerQt by Nokia <qt-info@nokia.com>
Mon, 29 Aug 2011 01:45:35 +0000 (03:45 +0200)
commite8e9b62f725f2229ae9e6d0218bbcbf7d54425ee
treebb79546be6e68ed1a53a05cae1d1e6ceb317f719
parentdc7b2b8d9ca1d394d8338ce1c1f51eafac187908
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 <qt_sanity_bot@ovi.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
src/testlib/qabstracttestlogger.cpp
src/testlib/qabstracttestlogger_p.h
src/testlib/qplaintestlogger.cpp
src/testlib/qplaintestlogger_p.h
src/testlib/qtestbasicstreamer.cpp
src/testlib/qtestbasicstreamer.h