summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Shienkov <denis.shienkov@gmail.com>2014-05-18 16:13:47 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-05-23 14:55:54 +0200
commitd39e916c6f397801ac329968515d90f0d1b9ef8f (patch)
tree6aa84cf8fd87160af46b13574a0dfe8135cc5c6f
parentd27ce6689855550ff89c5f84d38bded3c3da1dca (diff)
downloadqtserialport-d39e916c6f397801ac329968515d90f0d1b9ef8f.tar.gz
Fix compilation of qserialport auto-test with Qt4
In qt4 the macro QCOMPARE can not make type cast between "int" and "qint64", though on qt5 there are no problems. Tested build on Lixux 64bit with Qt4 and then Qt5. Change-Id: I258f8ee4d26b65cc81720d66714ef69df23e7266 Reviewed-by: Sergey Belyashov <Sergey.Belyashov@gmail.com> Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
-rw-r--r--tests/auto/qserialport/tst_qserialport.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/auto/qserialport/tst_qserialport.cpp b/tests/auto/qserialport/tst_qserialport.cpp
index 7d13732..990f6ee 100644
--- a/tests/auto/qserialport/tst_qserialport.cpp
+++ b/tests/auto/qserialport/tst_qserialport.cpp
@@ -251,7 +251,7 @@ void tst_QSerialPort::openNotExisting()
void tst_QSerialPort::handleBytesWrittenAndExitLoopSlot(qint64 bytesWritten)
{
- QCOMPARE(bytesWritten, (alphabetArray.size() + newlineArray.size()));
+ QCOMPARE(bytesWritten, qint64(alphabetArray.size() + newlineArray.size()));
exitLoop();
}
@@ -267,7 +267,7 @@ void tst_QSerialPort::flush()
QVERIFY(serialPort.open(QIODevice::WriteOnly));
serialPort.write(alphabetArray + newlineArray);
- QCOMPARE(serialPort.bytesToWrite(), (alphabetArray.size() + newlineArray.size()));
+ QCOMPARE(serialPort.bytesToWrite(), qint64(alphabetArray.size() + newlineArray.size()));
serialPort.flush();
QCOMPARE(serialPort.bytesToWrite(), qint64(0));
enterLoop(1);
@@ -298,11 +298,11 @@ void tst_QSerialPort::doubleFlush()
QVERIFY(serialPort.open(QIODevice::WriteOnly));
serialPort.write(alphabetArray);
- QCOMPARE(serialPort.bytesToWrite(), alphabetArray.size());
+ QCOMPARE(serialPort.bytesToWrite(), qint64(alphabetArray.size()));
serialPort.flush();
QCOMPARE(serialPort.bytesToWrite(), qint64(0));
serialPort.write(newlineArray);
- QCOMPARE(serialPort.bytesToWrite(), newlineArray.size());
+ QCOMPARE(serialPort.bytesToWrite(), qint64(newlineArray.size()));
serialPort.flush();
QCOMPARE(serialPort.bytesToWrite(), qint64(0));