Fix small problems with tst_QProcess

Remember to register the metatype where we use it, so we don't depend
on another test being run previously.

And skip the setWorkingDirectory test completely on Unix. I don't know
why it needs to be skipped, but if we're not going to verify anything,
don't even try to do anything. This saves us one memory leak at least.

Change-Id: I22e151cc3fa7b4e976972aca8978b88b263d9bee
Reviewed-by: Mitch Curtis <mitch.curtis@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
This commit is contained in:
Thiago Macieira 2012-07-10 18:45:28 +02:00 committed by Qt by Nokia
parent f235ca4079
commit d693a8914c

View File

@ -2122,12 +2122,12 @@ void tst_QProcess::setWorkingDirectory()
#ifdef Q_OS_WINCE
QSKIP("Windows CE does not support working directory logic");
#endif
process = new QProcess;
process->setWorkingDirectory("test");
process->start("testSetWorkingDirectory/testSetWorkingDirectory");
#ifndef Q_OS_WIN
QSKIP("setWorkingDirectory will chdir before starting the process on unices");
#endif
process = new QProcess;
process->setWorkingDirectory("test");
process->start("testSetWorkingDirectory/testSetWorkingDirectory");
QVERIFY(process->waitForFinished());
QByteArray workingDir = process->readAllStandardOutput();
@ -2184,6 +2184,7 @@ void tst_QProcess::invalidProgramString()
//-----------------------------------------------------------------------------
void tst_QProcess::onlyOneStartedSignal()
{
qRegisterMetaType<QProcess::ExitStatus>("QProcess::ExitStatus");
QProcess process;
QSignalSpy spyStarted(&process, SIGNAL(started()));