summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/io
diff options
context:
space:
mode:
authorAlex Trotsenko <alex1973tr@gmail.com>2021-04-12 16:31:51 +0300
committerOswald Buddenhagen <oswald.buddenhagen@gmx.de>2021-04-15 19:00:42 +0000
commit063cdb9870ab8a9b0f1a3741a001c06289f02af4 (patch)
tree3dcba5254f8ae4d2f250ffadaec0f93f865048e7 /tests/auto/corelib/io
parent92d351089bf7e285c9800342ff72205c04984f6c (diff)
QWindowsPipe{Reader|Writer}: restructure signals
For QProcess, there is no point in suppressing recursive QWPR::readyRead() emission, as the former manages this logic itself. On top of that, the non-recursive nature of QWPR::readyRead() indirectly disallowed reading from the channels inside QProcess::waitForReadyRead(), if that is called from a slot connected to QProcess::readyRead(). QWPW had two signals, one allowing recursion and one not. This commit allows recursion of QWPR::readyRead() and QWPW::bytesWritten(), and moves recursion suppression to the higher- level classes. This makes the code more uniform and efficient, at the cost of a few duplicated lines. Change-Id: Ib20017fff4d92403d0bf2335f1622de4aa1ddcef Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Diffstat (limited to 'tests/auto/corelib/io')
-rw-r--r--tests/auto/corelib/io/qprocess/tst_qprocess.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp
index 857c24c571..035c5941c2 100644
--- a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp
+++ b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp
@@ -1294,7 +1294,7 @@ void tst_QProcess::waitForReadyReadInAReadyReadSlot()
QVERIFY(process.waitForFinished(5000));
QCOMPARE(process.exitStatus(), QProcess::NormalExit);
QCOMPARE(process.exitCode(), 0);
- QVERIFY(process.bytesAvailable() > bytesAvailable);
+ QVERIFY(process.bytesAvailable() >= bytesAvailable);
}
void tst_QProcess::waitForReadyReadInAReadyReadSlotSlot()
@@ -1304,6 +1304,8 @@ void tst_QProcess::waitForReadyReadInAReadyReadSlotSlot()
bytesAvailable = process->bytesAvailable();
process->write("bar", 4);
QVERIFY(process->waitForReadyRead(5000));
+ QVERIFY(process->bytesAvailable() > bytesAvailable);
+ bytesAvailable = process->bytesAvailable();
QTestEventLoop::instance().exitLoop();
}