diff options
author | Denis Shienkov <denis.shienkov@gmail.com> | 2015-08-04 23:54:07 +0300 |
---|---|---|
committer | Denis Shienkov <denis.shienkov@gmail.com> | 2015-08-05 05:37:10 +0000 |
commit | a5114f9a9249c5f3263c848d96600ea8e30f22da (patch) | |
tree | 815afe35ca4826718ce98005ab0d14c20c35fe68 /tests | |
parent | 506370bfa0fc24a1fa1747fb28507d17b34dfcb4 (diff) | |
download | qtserialport-a5114f9a9249c5f3263c848d96600ea8e30f22da.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.
Change-Id: I85ff942c5b7e8276f22867921239bfc8933dac77
Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qserialport/tst_qserialport.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
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))); |