summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRohan McGovern <rohan.mcgovern@nokia.com>2009-07-22 05:33:39 (GMT)
committerRohan McGovern <rohan.mcgovern@nokia.com>2009-07-22 05:33:39 (GMT)
commit220b1cbcd253c8133ad185cd2be55db584071e67 (patch)
treee333e09862790d067e3624bea4bd63b1814f0fa0 /tests
parent150470d47d6871d163226de19f27c8b11a0131cf (diff)
downloadQt-220b1cbcd253c8133ad185cd2be55db584071e67.zip
Qt-220b1cbcd253c8133ad185cd2be55db584071e67.tar.gz
Qt-220b1cbcd253c8133ad185cd2be55db584071e67.tar.bz2
Add a (failing) test for QProcess bug 258462.
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qprocess/tst_qprocess.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/auto/qprocess/tst_qprocess.cpp b/tests/auto/qprocess/tst_qprocess.cpp
index 6318d1d..3ce080a 100644
--- a/tests/auto/qprocess/tst_qprocess.cpp
+++ b/tests/auto/qprocess/tst_qprocess.cpp
@@ -141,6 +141,7 @@ private slots:
void startFinishStartFinish();
void invalidProgramString_data();
void invalidProgramString();
+ void processEventsInAReadyReadSlot();
// 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)
@@ -154,6 +155,7 @@ protected slots:
void restartProcess();
void waitForReadyReadInAReadyReadSlotSlot();
void waitForBytesWrittenInABytesWrittenSlotSlot();
+ void processEventsInAReadyReadSlotSlot();
private:
QProcess *process;
@@ -2024,5 +2026,34 @@ void tst_QProcess::invalidProgramString()
QVERIFY(!QProcess::startDetached(programString));
}
+//-----------------------------------------------------------------------------
+void tst_QProcess::processEventsInAReadyReadSlot()
+{
+#ifdef Q_OS_WINCE
+ QSKIP("Reading and writing to a process is not supported on Qt/CE", SkipAll);
+#endif
+
+ QProcess process;
+ QVERIFY(QObject::connect(&process, SIGNAL(readyReadStandardOutput()), this, SLOT(processEventsInAReadyReadSlotSlot())));
+
+ for (int i = 0; i < 10; ++i) {
+ QCOMPARE(process.state(), QProcess::NotRunning);
+
+#ifdef Q_OS_MAC
+ process.start("testProcessOutput/testProcessOutput.app");
+#else
+ process.start("testProcessOutput/testProcessOutput");
+#endif
+
+ QVERIFY(process.waitForFinished(10000));
+ }
+}
+
+//-----------------------------------------------------------------------------
+void tst_QProcess::processEventsInAReadyReadSlotSlot()
+{
+ qApp->processEvents();
+}
+
QTEST_MAIN(tst_QProcess)
#include "tst_qprocess.moc"