summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Shienkov <denis.shienkov@gmail.com>2015-08-04 23:54:07 +0300
committerDenis Shienkov <denis.shienkov@gmail.com>2015-08-05 07:22:09 +0000
commit35d0bfe273f71b9384f9de7e95a71d6642134f54 (patch)
tree9ce14a4831a8f7a96371e59c9ae0a4ff39b64026
parent990514e77e91cdf7ce7fb8c02992ad72d77c0c72 (diff)
downloadqtserialport-35d0bfe273f71b9384f9de7e95a71d6642134f54.tar.gz
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. (cherry-picked from a5114f9a9249c5f3263c848d96600ea8e30f22da) Change-Id: I85ff942c5b7e8276f22867921239bfc8933dac77 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
-rw-r--r--tests/auto/qserialport/tst_qserialport.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/auto/qserialport/tst_qserialport.cpp b/tests/auto/qserialport/tst_qserialport.cpp
index a931101..970d30b 100644
--- a/tests/auto/qserialport/tst_qserialport.cpp
+++ b/tests/auto/qserialport/tst_qserialport.cpp
@@ -330,6 +330,10 @@ void tst_QSerialPort::flush()
QSKIP("flush() does not work on Windows", SkipAll);
#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)));
@@ -361,6 +365,10 @@ void tst_QSerialPort::doubleFlush()
QSKIP("flush() does not work on Windows", SkipAll);
#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)));