summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Shienkov <denis.shienkov@gmail.com>2015-09-09 17:45:50 +0300
committerDenis Shienkov <denis.shienkov@gmail.com>2015-09-10 08:46:55 +0000
commit9ca188fea79e3909ab09d3a335ce84ca5330fa9b (patch)
treed549edef99f5626ceecea480395e1db34d171b6d
parent9be50642172b1fcb8c539e534b64afc063dc42ba (diff)
Remove the clearReceiver() function from the tests
It is not necessary any more. Now all tests with the com0com serial ports are passed without this function. (cherry-picked from ae4056a5e70df905a16716da3797ed297642a358) Change-Id: I02b50ca5f28cf93e9e2731d3d0351607ffd2b814 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
-rw-r--r--tests/auto/qserialport/tst_qserialport.cpp54
1 files changed, 0 insertions, 54 deletions
diff --git a/tests/auto/qserialport/tst_qserialport.cpp b/tests/auto/qserialport/tst_qserialport.cpp
index 8aeca3c1..c14976d5 100644
--- a/tests/auto/qserialport/tst_qserialport.cpp
+++ b/tests/auto/qserialport/tst_qserialport.cpp
@@ -145,8 +145,6 @@ protected slots:
void handleBytesWrittenAndExitLoopSlot2(qint64 bytesWritten);
private:
- void clearReceiver(const QString &customReceiverName = QString());
-
QString m_senderPortName;
QString m_receiverPortName;
QStringList m_availablePortNames;
@@ -165,24 +163,6 @@ tst_QSerialPort::tst_QSerialPort()
{
}
-// This method is a workaround for the "com0com" virtual serial port
-// driver, which is installed on CI. The problem is that the close/clear
-// methods have no effect on sender serial port. If any data didn't manage
-// to be transferred before closing, then this data will continue to be
-// transferred at next opening of sender port.
-// Thus, this behavior influences other tests and leads to the wrong results
-// (e.g. the receiver port on other test can receive some data which are
-// not expected). It is recommended to use this method for cleaning of
-// read FIFO of receiver for those tests in which reception of data is
-// required.
-void tst_QSerialPort::clearReceiver(const QString &customReceiverName)
-{
- QSerialPort receiver(customReceiverName.isEmpty()
- ? m_receiverPortName : customReceiverName);
- if (receiver.open(QIODevice::ReadOnly))
- enterLoopMsecs(100);
-}
-
void tst_QSerialPort::initTestCase()
{
m_senderPortName = QString::fromLocal8Bit(qgetenv("QTEST_SERIALPORT_SENDER"));
@@ -577,7 +557,6 @@ void tst_QSerialPort::waitForBytesWritten()
void tst_QSerialPort::waitForReadyReadWithTimeout()
{
#ifdef Q_OS_WIN
- clearReceiver();
// the dummy device on other side also has to be open
QSerialPort dummySerialPort(m_senderPortName);
QVERIFY(dummySerialPort.open(QIODevice::WriteOnly));
@@ -592,10 +571,6 @@ void tst_QSerialPort::waitForReadyReadWithTimeout()
void tst_QSerialPort::waitForReadyReadWithOneByte()
{
-#ifdef Q_OS_WIN
- clearReceiver();
-#endif
-
const qint64 oneByte = 1;
const int waitMsecs = 50;
@@ -615,10 +590,6 @@ void tst_QSerialPort::waitForReadyReadWithOneByte()
void tst_QSerialPort::waitForReadyReadWithAlphabet()
{
-#ifdef Q_OS_WIN
- clearReceiver();
-#endif
-
const int waitMsecs = 50;
QSerialPort senderSerialPort(m_senderPortName);
@@ -640,11 +611,6 @@ void tst_QSerialPort::waitForReadyReadWithAlphabet()
void tst_QSerialPort::twoStageSynchronousLoopback()
{
-#ifdef Q_OS_WIN
- clearReceiver();
- clearReceiver(m_senderPortName);
-#endif
-
QSerialPort senderPort(m_senderPortName);
QVERIFY(senderPort.open(QSerialPort::ReadWrite));
@@ -683,10 +649,6 @@ void tst_QSerialPort::twoStageSynchronousLoopback()
void tst_QSerialPort::synchronousReadWrite()
{
-#ifdef Q_OS_WIN
- clearReceiver();
-#endif
-
QSerialPort senderPort(m_senderPortName);
QVERIFY(senderPort.open(QSerialPort::WriteOnly));
@@ -770,10 +732,6 @@ void tst_QSerialPort::asynchronousWriteByBytesWritten_data()
void tst_QSerialPort::asynchronousWriteByBytesWritten()
{
-#ifdef Q_OS_WIN
- clearReceiver();
-#endif
-
QFETCH(Qt::ConnectionType, readConnectionType);
QFETCH(Qt::ConnectionType, writeConnectionType);
@@ -834,10 +792,6 @@ void tst_QSerialPort::asynchronousWriteByTimer_data()
void tst_QSerialPort::asynchronousWriteByTimer()
{
-#ifdef Q_OS_WIN
- clearReceiver();
-#endif
-
QFETCH(Qt::ConnectionType, readConnectionType);
QFETCH(Qt::ConnectionType, writeConnectionType);
@@ -857,8 +811,6 @@ void tst_QSerialPort::asynchronousWriteByTimer()
void tst_QSerialPort::readBufferOverflow()
{
- clearReceiver();
-
QSerialPort senderPort(m_senderPortName);
QVERIFY(senderPort.open(QSerialPort::WriteOnly));
@@ -886,8 +838,6 @@ void tst_QSerialPort::readBufferOverflow()
void tst_QSerialPort::readAfterInputClear()
{
- clearReceiver();
-
QSerialPort senderPort(m_senderPortName);
QVERIFY(senderPort.open(QSerialPort::WriteOnly));
@@ -1047,10 +997,6 @@ private:
void tst_QSerialPort::controlBreak()
{
-#ifdef Q_OS_WIN
- clearReceiver();
-#endif
-
QSerialPort senderPort(m_senderPortName);
QVERIFY(senderPort.open(QSerialPort::WriteOnly));
QCOMPARE(senderPort.isBreakEnabled(), false);