summaryrefslogtreecommitdiffstats
path: root/tests/auto/qprocess
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2009-04-01 15:09:48 (GMT)
committerSimon Hausmann <simon.hausmann@nokia.com>2009-04-01 15:09:48 (GMT)
commitb92516d571eb608e0bb273f0871eeeaf20671b9d (patch)
tree5a711dd58ff0e9abe4523e893340676fe17bdc62 /tests/auto/qprocess
parent815eb0e1d05318dfdd3cadb7f45c7e8e80ff4790 (diff)
parentef46fa38e50b807c6122dc37d84d2944069ef3ea (diff)
downloadQt-b92516d571eb608e0bb273f0871eeeaf20671b9d.zip
Qt-b92516d571eb608e0bb273f0871eeeaf20671b9d.tar.gz
Qt-b92516d571eb608e0bb273f0871eeeaf20671b9d.tar.bz2
Merge branch '4.5' of git@scm.dev.nokia.troll.no:qt/qt
Conflicts: src/gui/inputmethod/qximinputcontext_x11.cpp
Diffstat (limited to 'tests/auto/qprocess')
-rw-r--r--tests/auto/qprocess/tst_qprocess.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/auto/qprocess/tst_qprocess.cpp b/tests/auto/qprocess/tst_qprocess.cpp
index ebfe33a..ef78c2e 100644
--- a/tests/auto/qprocess/tst_qprocess.cpp
+++ b/tests/auto/qprocess/tst_qprocess.cpp
@@ -141,6 +141,8 @@ private slots:
void switchReadChannels();
void setWorkingDirectory();
void startFinishStartFinish();
+ void invalidProgramString_data();
+ void invalidProgramString();
// keep these at the end, since they use lots of processes and sometimes
// caused obscure failures to occur in tests that followed them (esp. on the Mac)
@@ -2106,5 +2108,29 @@ void tst_QProcess::startFinishStartFinish()
}
}
+//-----------------------------------------------------------------------------
+void tst_QProcess::invalidProgramString_data()
+{
+ QTest::addColumn<QString>("programString");
+ QTest::newRow("null string") << QString();
+ QTest::newRow("empty string") << QString("");
+ QTest::newRow("only blank string") << QString(" ");
+}
+
+void tst_QProcess::invalidProgramString()
+{
+ QFETCH(QString, programString);
+ QProcess process;
+
+ qRegisterMetaType<QProcess::ProcessError>("QProcess::ProcessError");
+ QSignalSpy spy(&process, SIGNAL(error(QProcess::ProcessError)));
+
+ process.start(programString);
+ QCOMPARE(process.error(), QProcess::FailedToStart);
+ QCOMPARE(spy.count(), 1);
+
+ QVERIFY(!QProcess::startDetached(programString));
+}
+
QTEST_MAIN(tst_QProcess)
#include "tst_qprocess.moc"