forked from qt-creator/qt-creator
Valgrind: Replace QDir::separator with slash
Change-Id: I8f8192dc065702cb1c6bb218b8d992bb9775cd10 Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
@@ -200,7 +200,7 @@ void CallgrindController::getLocalDataFile()
|
||||
arg(m_valgrindProc->pid());
|
||||
const QString workingDir = m_valgrindProc->workingDirectory();
|
||||
// first, set the to-be-parsed file to callgrind.out.PID
|
||||
QString fileName = workingDir.isEmpty() ? baseFileName : (workingDir + QDir::separator() + baseFileName);
|
||||
QString fileName = workingDir.isEmpty() ? baseFileName : (workingDir + QLatin1Char('/') + baseFileName);
|
||||
|
||||
if (!m_valgrindProc->isLocal()) {
|
||||
///TODO: error handling
|
||||
@@ -217,7 +217,7 @@ void CallgrindController::getLocalDataFile()
|
||||
QStringList outputFiles = dir.entryList();
|
||||
// if there are files like callgrind.out.PID.NUM, set it to the most recent one of those
|
||||
if (!outputFiles.isEmpty())
|
||||
fileName = workingDir + QDir::separator() + dir.entryList().first();
|
||||
fileName = workingDir + QLatin1Char('/') + dir.entryList().first();
|
||||
|
||||
emit localParseDataAvailable(fileName);
|
||||
}
|
||||
@@ -237,7 +237,7 @@ void CallgrindController::foundRemoteFile()
|
||||
void CallgrindController::sftpInitialized()
|
||||
{
|
||||
cleanupTempFile();
|
||||
QTemporaryFile dataFile(QDir::tempPath() + QDir::separator() + QLatin1String("callgrind.out."));
|
||||
QTemporaryFile dataFile(QDir::tempPath() + QLatin1Char('/') + QLatin1String("callgrind.out."));
|
||||
QTC_ASSERT(dataFile.open(), return);
|
||||
m_tempDataFile = dataFile.fileName();
|
||||
dataFile.setAutoRemove(false);
|
||||
|
@@ -92,7 +92,7 @@ static QString makeFrameName(const Frame &frame, const QString &relativeTo,
|
||||
const QString d = frame.directory();
|
||||
const QString f = frame.file();
|
||||
const QString fn = frame.functionName();
|
||||
const QString fullPath = d + QDir::separator() + f;
|
||||
const QString fullPath = d + QLatin1Char('/') + f;
|
||||
|
||||
QString path;
|
||||
if (!d.isEmpty() && !f.isEmpty())
|
||||
@@ -109,12 +109,12 @@ static QString makeFrameName(const Frame &frame, const QString &relativeTo,
|
||||
if (frame.line() != -1)
|
||||
path += QLatin1Char(':') + QString::number(frame.line());
|
||||
|
||||
path = path.toHtmlEscaped();
|
||||
path = QDir::toNativeSeparators(path.toHtmlEscaped());
|
||||
|
||||
if (link && !f.isEmpty() && QFile::exists(fullPath)) {
|
||||
// make a hyperlink label
|
||||
path = QString::fromLatin1("<a href=\"file://%1:%2\" %4>%3</a>")
|
||||
.arg(fullPath, QString::number(frame.line()), path, linkAttr);
|
||||
.arg(fullPath).arg(frame.line()).arg(path).arg(linkAttr);
|
||||
}
|
||||
|
||||
if (!fn.isEmpty())
|
||||
@@ -130,8 +130,9 @@ static QString relativeToPath()
|
||||
const ProjectExplorer::Project *project = ProjectExplorer::SessionManager::startupProject();
|
||||
|
||||
QString relativeTo(project ? project->projectDirectory().toString() : QDir::homePath());
|
||||
if (!relativeTo.endsWith(QDir::separator()))
|
||||
relativeTo.append(QDir::separator());
|
||||
const QChar slash = QLatin1Char('/');
|
||||
if (!relativeTo.endsWith(slash))
|
||||
relativeTo.append(slash);
|
||||
|
||||
return relativeTo;
|
||||
}
|
||||
|
@@ -455,7 +455,7 @@ void MemcheckTool::engineStarting(const AnalyzerRunControl *engine)
|
||||
|
||||
QString dir;
|
||||
if (RunConfiguration *rc = engine->runConfiguration())
|
||||
dir = rc->target()->project()->projectDirectory().toString() + QDir::separator();
|
||||
dir = rc->target()->project()->projectDirectory().toString() + QLatin1Char('/');
|
||||
|
||||
const MemcheckRunControl *mEngine = dynamic_cast<const MemcheckRunControl *>(engine);
|
||||
QTC_ASSERT(mEngine, return);
|
||||
|
@@ -113,7 +113,7 @@ QString ErrorListModel::Private::formatAbsoluteFilePath(const Error &error) cons
|
||||
{
|
||||
const Frame f = findRelevantFrame(error);
|
||||
if (!f.directory().isEmpty() && !f.file().isEmpty())
|
||||
return QString(f.directory() + QDir::separator() + f.file());
|
||||
return f.directory() + QLatin1Char('/') + f.file();
|
||||
return QString();
|
||||
}
|
||||
|
||||
|
@@ -44,7 +44,7 @@ QString toolTipForFrame(const Frame &frame)
|
||||
{
|
||||
QString location;
|
||||
if (!frame.file().isEmpty()) {
|
||||
location = frame.directory() + QDir::separator() + frame.file();
|
||||
location = frame.directory() + QLatin1Char('/') + frame.file();
|
||||
if (frame.line() > 0)
|
||||
location += QLatin1Char(':') + QString::number(frame.line());
|
||||
}
|
||||
|
@@ -65,8 +65,8 @@ static QString makeName(const Frame &frame)
|
||||
if (!fn.isEmpty())
|
||||
return fn;
|
||||
if (!d.isEmpty() && !f.isEmpty())
|
||||
return frame.line() > 0 ? QString::fromLatin1("%1%2%3:%4").arg(d, QDir::separator(), f, QString::number(frame.line()))
|
||||
: QString::fromLatin1("%1%2%3").arg(d, QDir::separator(), f);
|
||||
return frame.line() > 0 ? QString::fromLatin1("%1/%2:%3").arg(d, f).arg(frame.line())
|
||||
: QString::fromLatin1("%1/%2").arg(d, f);
|
||||
return frame.object();
|
||||
}
|
||||
|
||||
|
@@ -58,7 +58,7 @@ bool on64bit()
|
||||
|
||||
QString srcDirForApp(const QString &app)
|
||||
{
|
||||
return appSrcDir + QDir::separator() + app;
|
||||
return appSrcDir + QLatin1Char('/') + app;
|
||||
}
|
||||
|
||||
QTEST_MAIN(Valgrind::TestRunner)
|
||||
@@ -79,7 +79,7 @@ TestRunner::TestRunner(QObject *parent)
|
||||
|
||||
QString TestRunner::runTestBinary(const QString &binary, const QStringList &vArgs)
|
||||
{
|
||||
const QString binPath = appBinDir + QDir::separator() + binary;
|
||||
const QString binPath = appBinDir + QLatin1Char('/') + binary;
|
||||
if (!QFileInfo(binPath).isExecutable())
|
||||
qFatal("No such test app: %s", qPrintable(binPath));
|
||||
m_runner->setValgrindArguments(QStringList() << "--num-callers=50" << "--track-origins=yes" << vArgs);
|
||||
@@ -263,7 +263,7 @@ void TestRunner::testLeak3()
|
||||
void TestRunner::testLeak4()
|
||||
{
|
||||
const QString app("leak4");
|
||||
const QString binary = runTestBinary(app + QDir::separator() + app,
|
||||
const QString binary = runTestBinary(app + QLatin1Char('/') + app,
|
||||
QStringList() << "--show-reachable=yes");
|
||||
const QString srcDir = srcDirForApp("leak4");
|
||||
|
||||
@@ -341,7 +341,7 @@ void TestRunner::testLeak4()
|
||||
void TestRunner::uninit1()
|
||||
{
|
||||
const QString app("uninit1");
|
||||
const QString binary = runTestBinary(app + QDir::separator() + app);
|
||||
const QString binary = runTestBinary(app + QLatin1Char('/') + app);
|
||||
const QString srcDir = srcDirForApp(app);
|
||||
|
||||
QVERIFY(m_logMessages.isEmpty());
|
||||
@@ -384,7 +384,7 @@ void TestRunner::uninit2()
|
||||
{
|
||||
const QString app("uninit2");
|
||||
m_expectCrash = true;
|
||||
const QString binary = runTestBinary(app + QDir::separator() + app);
|
||||
const QString binary = runTestBinary(app + QLatin1Char('/') + app);
|
||||
const QString srcDir = srcDirForApp(app);
|
||||
|
||||
QVERIFY(m_logMessages.isEmpty());
|
||||
@@ -448,7 +448,7 @@ void TestRunner::uninit3()
|
||||
{
|
||||
const QString app("uninit3");
|
||||
m_expectCrash = true;
|
||||
const QString binary = runTestBinary(app + QDir::separator() + app);
|
||||
const QString binary = runTestBinary(app + QLatin1Char('/') + app);
|
||||
const QString srcDir = srcDirForApp(app);
|
||||
|
||||
QVERIFY(m_logMessages.isEmpty());
|
||||
@@ -511,7 +511,7 @@ void TestRunner::uninit3()
|
||||
void TestRunner::syscall()
|
||||
{
|
||||
const QString app("syscall");
|
||||
const QString binary = runTestBinary(app + QDir::separator() + app);
|
||||
const QString binary = runTestBinary(app + QLatin1Char('/') + app);
|
||||
const QString srcDir = srcDirForApp(app);
|
||||
|
||||
QVERIFY(m_logMessages.isEmpty());
|
||||
@@ -570,7 +570,7 @@ void TestRunner::syscall()
|
||||
void TestRunner::free1()
|
||||
{
|
||||
const QString app("free1");
|
||||
const QString binary = runTestBinary(app + QDir::separator() + app);
|
||||
const QString binary = runTestBinary(app + QLatin1Char('/') + app);
|
||||
const QString srcDir = srcDirForApp(app);
|
||||
|
||||
QVERIFY(m_logMessages.isEmpty());
|
||||
@@ -624,7 +624,7 @@ void TestRunner::free1()
|
||||
void TestRunner::free2()
|
||||
{
|
||||
const QString app("free2");
|
||||
const QString binary = runTestBinary(app + QDir::separator() + app);
|
||||
const QString binary = runTestBinary(app + QLatin1Char('/') + app);
|
||||
const QString srcDir = srcDirForApp(app);
|
||||
|
||||
QVERIFY(m_logMessages.isEmpty());
|
||||
@@ -683,7 +683,7 @@ void TestRunner::invalidjump()
|
||||
{
|
||||
const QString app("invalidjump");
|
||||
m_expectCrash = true;
|
||||
const QString binary = runTestBinary(app + QDir::separator() + app);
|
||||
const QString binary = runTestBinary(app + QLatin1Char('/') + app);
|
||||
const QString srcDir = srcDirForApp(app);
|
||||
|
||||
QVERIFY(m_logMessages.isEmpty());
|
||||
@@ -711,7 +711,7 @@ void TestRunner::overlap()
|
||||
{
|
||||
const QString app("overlap");
|
||||
m_expectCrash = true;
|
||||
const QString binary = runTestBinary(app + QDir::separator() + app);
|
||||
const QString binary = runTestBinary(app + QLatin1Char('/') + app);
|
||||
const QString srcDir = srcDirForApp(app);
|
||||
|
||||
QVERIFY(m_logMessages.isEmpty());
|
||||
|
Reference in New Issue
Block a user