From 063cdb9870ab8a9b0f1a3741a001c06289f02af4 Mon Sep 17 00:00:00 2001 From: Alex Trotsenko Date: Mon, 12 Apr 2021 16:31:51 +0300 Subject: 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 --- tests/auto/corelib/io/qprocess/tst_qprocess.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tests/auto/corelib/io') 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(); } -- cgit v1.2.3