From a5114f9a9249c5f3263c848d96600ea8e30f22da Mon Sep 17 00:00:00 2001 From: Denis Shienkov Date: Tue, 4 Aug 2015 23:54:07 +0300 Subject: Allow to pass the flush tests using the tty0tty virtual devices The receiver on other side should be opened even if it is not used; otherwise the tests will be fails with the EINVAL error. Change-Id: I85ff942c5b7e8276f22867921239bfc8933dac77 Reviewed-by: Sergey Belyashov Reviewed-by: Denis Shienkov --- tests/auto/qserialport/tst_qserialport.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests') diff --git a/tests/auto/qserialport/tst_qserialport.cpp b/tests/auto/qserialport/tst_qserialport.cpp index 54118af..c5c9113 100644 --- a/tests/auto/qserialport/tst_qserialport.cpp +++ b/tests/auto/qserialport/tst_qserialport.cpp @@ -327,6 +327,10 @@ void tst_QSerialPort::flush() QSKIP("flush() does not work on Windows"); #endif + // the dummy device on other side also has to be open + QSerialPort dummySerialPort(m_receiverPortName); + QVERIFY(dummySerialPort.open(QIODevice::ReadOnly)); + QSerialPort serialPort(m_senderPortName); connect(&serialPort, SIGNAL(bytesWritten(qint64)), this, SLOT(handleBytesWrittenAndExitLoopSlot(qint64))); QSignalSpy bytesWrittenSpy(&serialPort, SIGNAL(bytesWritten(qint64))); @@ -358,6 +362,10 @@ void tst_QSerialPort::doubleFlush() QSKIP("flush() does not work on Windows"); #endif + // the dummy device on other side also has to be open + QSerialPort dummySerialPort(m_receiverPortName); + QVERIFY(dummySerialPort.open(QIODevice::ReadOnly)); + QSerialPort serialPort(m_senderPortName); connect(&serialPort, SIGNAL(bytesWritten(qint64)), this, SLOT(handleBytesWrittenAndExitLoopSlot2(qint64))); QSignalSpy bytesWrittenSpy(&serialPort, SIGNAL(bytesWritten(qint64))); -- cgit v1.2.1