summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSamuel Gaist <samuel.gaist@edeltech.ch>2014-09-11 21:52:52 +0200
committerSamuel Gaist <samuel.gaist@edeltech.ch>2014-09-12 17:09:29 +0200
commitf1761c1236edce428278f7a9e8aa1091097eaa57 (patch)
treebcfca24e79b36014aceb725fef1f5436995d0585 /tests
parentc399044e2a9ccdc14b627889320f34e87b7d6b7e (diff)
downloadqtserialport-f1761c1236edce428278f7a9e8aa1091097eaa57.tar.gz
Make tst_qtserialport build with Qt 4
The newly moved twoStageSynchronousLoopback fails to compile since there's no qCompare available for int and long long with Qt 4. This patch allows to build it again with Qt 4 Change-Id: Ib3764b125f371ae70864bd578c7ccda39d08ae22 Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qserialport/tst_qserialport.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/auto/qserialport/tst_qserialport.cpp b/tests/auto/qserialport/tst_qserialport.cpp
index 6fcb941..af767dd 100644
--- a/tests/auto/qserialport/tst_qserialport.cpp
+++ b/tests/auto/qserialport/tst_qserialport.cpp
@@ -470,12 +470,13 @@ void tst_QSerialPort::twoStageSynchronousLoopback()
senderPort.waitForBytesWritten(waitMsecs);
QTest::qSleep(waitMsecs);
receiverPort.waitForReadyRead(waitMsecs);
- QCOMPARE(newlineArray.size(), receiverPort.bytesAvailable());
+ QCOMPARE(qint64(newlineArray.size()), receiverPort.bytesAvailable());
+
receiverPort.write(receiverPort.readAll());
receiverPort.waitForBytesWritten(waitMsecs);
QTest::qSleep(waitMsecs);
senderPort.waitForReadyRead(waitMsecs);
- QCOMPARE(newlineArray.size(), senderPort.bytesAvailable());
+ QCOMPARE(qint64(newlineArray.size()), receiverPort.bytesAvailable());
QCOMPARE(newlineArray, senderPort.readAll());
// second stage
@@ -483,12 +484,12 @@ void tst_QSerialPort::twoStageSynchronousLoopback()
senderPort.waitForBytesWritten(waitMsecs);
QTest::qSleep(waitMsecs);
receiverPort.waitForReadyRead(waitMsecs);
- QCOMPARE(newlineArray.size(), receiverPort.bytesAvailable());
+ QCOMPARE(qint64(newlineArray.size()), receiverPort.bytesAvailable());
receiverPort.write(receiverPort.readAll());
receiverPort.waitForBytesWritten(waitMsecs);
QTest::qSleep(waitMsecs);
senderPort.waitForReadyRead(waitMsecs);
- QCOMPARE(newlineArray.size(), senderPort.bytesAvailable());
+ QCOMPARE(qint64(newlineArray.size()), receiverPort.bytesAvailable());
QCOMPARE(newlineArray, senderPort.readAll());
}