summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@nokia.com>2010-08-03 17:41:55 (GMT)
committerLiang Qi <liang.qi@nokia.com>2010-08-03 17:41:55 (GMT)
commitc7b9ee03339774bd1cae7793d91dad7809be987a (patch)
tree86dfbf5293c0153d0d26a634d8df2d37a5a128ed
parent3246586d5a98465c38c21f191e9714e821788958 (diff)
downloadQt-c7b9ee03339774bd1cae7793d91dad7809be987a.zip
Qt-c7b9ee03339774bd1cae7793d91dad7809be987a.tar.gz
Qt-c7b9ee03339774bd1cae7793d91dad7809be987a.tar.bz2
Add QDir::homePath() for the log file in QTestFileLogger in testlib on Symbian, both hardware and emulator.
Task-number: QTBUG-12622 Reviewed-by: Shane Kearns
-rw-r--r--src/testlib/qtestfilelogger.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/testlib/qtestfilelogger.cpp b/src/testlib/qtestfilelogger.cpp
index a5cdc80..9d1ee6a 100644
--- a/src/testlib/qtestfilelogger.cpp
+++ b/src/testlib/qtestfilelogger.cpp
@@ -44,6 +44,8 @@
#include "QtTest/private/qtestlog_p.h"
#include "QtTest/private/qtestresult_p.h"
+#include <QtCore/qdir.h>
+
#include <stdlib.h>
#include <stdio.h>
@@ -69,11 +71,19 @@ QTestFileLogger::~QTestFileLogger()
void QTestFileLogger::init()
{
char filename[100];
+ int index = 0;
+#if defined(Q_OS_SYMBIAN)
+ QByteArray ba(QDir::toNativeSeparators(QString(QDir::homePath()+QDir::separator())).toUtf8());
+ index = ba.length();
+ QTest::qt_snprintf(filename, sizeof(filename), "%s%s.log",
+ ba.constData(), QTestResult::currentTestObjectName());
+#else
QTest::qt_snprintf(filename, sizeof(filename), "%s.log",
QTestResult::currentTestObjectName());
-
- // Keep filenames simple
- for (uint i = 0; i < sizeof(filename) && filename[i]; ++i) {
+#endif
+
+ // Keep filenames simple
+ for (uint i = index; i < sizeof(filename) && filename[i]; ++i) {
char& c = filename[i];
if (!((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')
|| (c >= '0' && c <= '9') || c == '-' || c == '.')) {