if (usingWinMain)
#endif
{
- // OutputDebugString is not threadsafe.
- static QBasicMutex outputDebugStringMutex;
- QMutexLocker locker(&outputDebugStringMutex);
OutputDebugString(reinterpret_cast<const wchar_t *>(logMessage.utf16()));
return;
}
namespace QTest {
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
- static CRITICAL_SECTION outputCriticalSection;
-#endif
-
static const char *incidentType2String(QAbstractTestLogger::IncidentTypes type)
{
switch (type) {
} while (!strUtf16.isEmpty());
if (stream != stdout)
#elif defined(Q_OS_WIN)
- EnterCriticalSection(&QTest::outputCriticalSection);
- // OutputDebugString is not threadsafe
OutputDebugStringA(str);
- LeaveCriticalSection(&QTest::outputCriticalSection);
#endif
outputString(str);
}
QPlainTestLogger::QPlainTestLogger(const char *filename)
: QAbstractTestLogger(filename)
{
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
- InitializeCriticalSection(&QTest::outputCriticalSection);
-#endif
}
QPlainTestLogger::~QPlainTestLogger()
{
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
- DeleteCriticalSection(&QTest::outputCriticalSection);
-#endif
}
void QPlainTestLogger::startLogging()