Remove circular dependency in testlib logging

Remove one of the circular dependencies between QPlainTestLogger and
QTestLog by directly checking whether we're writing to stdout rather
than inferring the same by examining whether the output file name is
null.

Change-Id: I798288482c9e2e071e17a8622e8a8f8d5016dc7e
Reviewed-on: http://codereview.qt.nokia.com/4052
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-09-01 18:24:55 +10:00 committed by Qt by Nokia
parent 592d53a17c
commit f1af291d49
2 changed files with 2 additions and 2 deletions

View File

@ -98,7 +98,7 @@ public:
void outputString(const char *msg);
private:
protected:
FILE *stream;
};

View File

@ -211,7 +211,7 @@ void QPlainTestLogger::outputMessage(const char *str)
OutputDebugString((wchar_t*)tmp.utf16());
strUtf16.remove(0, maxOutputLength);
} while (!strUtf16.isEmpty());
if (QTestLog::outputFileName())
if (stream != stdout)
#elif defined(Q_OS_WIN)
EnterCriticalSection(&QTest::outputCriticalSection);
// OutputDebugString is not threadsafe