diff options
author | Alex Trotsenko <alex1973tr@gmail.com> | 2015-07-22 10:56:06 +0300 |
---|---|---|
committer | Alex Trotsenko <alex1973tr@gmail.com> | 2016-01-29 09:14:44 +0000 |
commit | 7ff655360f1bebb657a7c035211058b340bf9f57 (patch) | |
tree | 08911a78216b58022c53aff4d232049e5a1dd803 /tests/auto/corelib/io/qprocess | |
parent | 8f92baf5c946a93430e73adc79b4435060840777 (diff) |
Integrate QProcess into QIODevice's multistreaming infrastructure
As a result, this patch eliminates double-buffering in QProcess.
Change-Id: I436faa4a5ffc28ce77f959dd6089bef400ac39f6
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Diffstat (limited to 'tests/auto/corelib/io/qprocess')
-rw-r--r-- | tests/auto/corelib/io/qprocess/tst_qprocess.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp index e115c4224b..43a9c53de2 100644 --- a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp +++ b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp @@ -493,9 +493,11 @@ void tst_QProcess::echoTest2() QCOMPARE(process.error(), QProcess::Timedout); process.write("Hello"); + QSignalSpy spy0(&process, &QProcess::channelReadyRead); QSignalSpy spy1(&process, &QProcess::readyReadStandardOutput); QSignalSpy spy2(&process, &QProcess::readyReadStandardError); + QVERIFY(spy0.isValid()); QVERIFY(spy1.isValid()); QVERIFY(spy2.isValid()); @@ -514,6 +516,7 @@ void tst_QProcess::echoTest2() break; } + QVERIFY(spy0.count() > 0); QVERIFY(spy1.count() > 0); QVERIFY(spy2.count() > 0); @@ -985,6 +988,9 @@ public: this, &SoftExitProcess::terminateSlot); break; case 4: + setReadChannelMode(QProcess::MergedChannels); + connect(this, SIGNAL(channelReadyRead(int)), this, SLOT(terminateSlot())); + break; default: connect(this, &QProcess::stateChanged, this, &SoftExitProcess::terminateSlot); @@ -1057,7 +1063,7 @@ void tst_QProcess::softExitInSlots() { QFETCH(QString, appName); - for (int i = 0; i < 5; ++i) { + for (int i = 0; i < 6; ++i) { SoftExitProcess proc(i); proc.writeAfterStart("OLEBOLE", 8); // include the \0 proc.start(appName); |