diff options
author | Jason McDonald <jason.mcdonald@nokia.com> | 2011-09-02 17:08:20 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-09-05 06:33:07 +0200 |
commit | cab90f8c8b19892b2e026d12411702dbc8c10fb9 (patch) | |
tree | 5163e3739d118b646b56cda5a48228e15ae49d6c /src/testlib/qabstracttestlogger.cpp | |
parent | 91fe1fd9e8f5b040511721cb64b11772e034b265 (diff) |
Pass log file name when constructing loggers.
Pass the filename when creating the logger rather than when commencing
output. This will simplify forthcoming changes for running multiple
loggers.
Change-Id: I563aa97661caf279a5dcccb1321ff3ce4725b332
Reviewed-on: http://codereview.qt.nokia.com/4116
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'src/testlib/qabstracttestlogger.cpp')
-rw-r--r-- | src/testlib/qabstracttestlogger.cpp | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/src/testlib/qabstracttestlogger.cpp b/src/testlib/qabstracttestlogger.cpp index d71addb655..e2f253c22e 100644 --- a/src/testlib/qabstracttestlogger.cpp +++ b/src/testlib/qabstracttestlogger.cpp @@ -54,18 +54,8 @@ QT_BEGIN_NAMESPACE -void QAbstractTestLogger::outputString(const char *msg) +QAbstractTestLogger::QAbstractTestLogger(const char *filename) { - QTEST_ASSERT(stream); - - ::fputs(msg, stream); - ::fflush(stream); -} - -void QAbstractTestLogger::startLogging(const char *filename) -{ - QTEST_ASSERT(!stream); - if (!filename) { stream = stdout; return; @@ -81,7 +71,7 @@ void QAbstractTestLogger::startLogging(const char *filename) } } -void QAbstractTestLogger::stopLogging() +QAbstractTestLogger::~QAbstractTestLogger() { QTEST_ASSERT(stream); if (stream != stdout) { @@ -97,6 +87,22 @@ void QAbstractTestLogger::stopLogging() stream = 0; } +void QAbstractTestLogger::outputString(const char *msg) +{ + QTEST_ASSERT(stream); + + ::fputs(msg, stream); + ::fflush(stream); +} + +void QAbstractTestLogger::startLogging() +{ +} + +void QAbstractTestLogger::stopLogging() +{ +} + namespace QTest { |