From c7b9ee03339774bd1cae7793d91dad7809be987a Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Tue, 3 Aug 2010 19:41:55 +0200 Subject: 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 --- src/testlib/qtestfilelogger.cpp | 16 +++++++++++++--- 1 file 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 + #include #include @@ -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 == '.')) { -- cgit v0.12