summaryrefslogtreecommitdiffstats
path: root/src/testlib/qplaintestlogger.cpp
diff options
context:
space:
mode:
authorJason Barron <jbarron@trolltech.com>2009-08-04 11:17:47 (GMT)
committerJason Barron <jbarron@trolltech.com>2009-08-04 11:17:47 (GMT)
commitbe212bf108e71ba3b5b75802b1f4de6613ba315c (patch)
treec541ad12e8698f04e8fe386c2e1b94e8baca6c1b /src/testlib/qplaintestlogger.cpp
parent67ae1b0dac175f48875507f3187ed49276a29ddf (diff)
parente6bb00250b321b149dd80259dc4f479088d5949b (diff)
downloadQt-be212bf108e71ba3b5b75802b1f4de6613ba315c.zip
Qt-be212bf108e71ba3b5b75802b1f4de6613ba315c.tar.gz
Qt-be212bf108e71ba3b5b75802b1f4de6613ba315c.tar.bz2
Merge commit 'origin/master'
Conflicts: src/corelib/global/qglobal.h src/corelib/kernel/qmetatype.cpp src/corelib/kernel/qobject.cpp src/corelib/thread/qthread_unix.cpp src/gui/graphicsview/qgraphicssceneevent.h src/gui/itemviews/qheaderview.h src/gui/kernel/qapplication_qws.cpp src/gui/kernel/qgesture.h src/gui/kernel/qgesturerecognizer.h src/gui/painting/qpaintengine_raster.cpp src/network/access/qhttpnetworkreply.cpp src/network/access/qnetworkcookie.h src/network/socket/qnativesocketengine_unix.cpp
Diffstat (limited to 'src/testlib/qplaintestlogger.cpp')
-rw-r--r--src/testlib/qplaintestlogger.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/testlib/qplaintestlogger.cpp b/src/testlib/qplaintestlogger.cpp
index db221dd..c529d3e 100644
--- a/src/testlib/qplaintestlogger.cpp
+++ b/src/testlib/qplaintestlogger.cpp
@@ -129,7 +129,11 @@ namespace QTest {
static const char *messageType2String(QAbstractTestLogger::MessageTypes type)
{
+#ifdef Q_OS_WIN
static bool colored = (!qgetenv("QTEST_COLORED").isEmpty());
+#else
+ static bool colored = ::getenv("QTEST_COLORED");
+#endif
switch (type) {
case QAbstractTestLogger::Skip:
return COLORED_MSG(0, 37, "SKIP "); //white
@@ -165,10 +169,16 @@ namespace QTest {
LeaveCriticalSection(&outputCriticalSection);
#elif defined(Q_OS_SYMBIAN)
TPtrC8 ptr(reinterpret_cast<const TUint8*>(str));
- HBufC* hbuffer = HBufC::NewL(ptr.Length());
- hbuffer->Des().Copy(ptr);
- RDebug::Print(_L("[QTestLib Message] %S"), hbuffer);
- delete hbuffer;
+ HBufC* hbuffer = HBufC::New(ptr.Length());
+ if (hbuffer) {
+ hbuffer->Des().Copy(ptr);
+ RDebug::Print(_L("[QTestLib Message] %S"), hbuffer);
+ delete hbuffer;
+ } else {
+ TBuf<256> tmp;
+ tmp.Copy(ptr.Left(Min(256, ptr.Length())));
+ RDebug::Print(_L("[QTestLib Message] %S"), &tmp);
+ }
#endif
QAbstractTestLogger::outputString(str);
}