From d39e916c6f397801ac329968515d90f0d1b9ef8f Mon Sep 17 00:00:00 2001 From: Denis Shienkov Date: Sun, 18 May 2014 16:13:47 +0000 Subject: 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 Reviewed-by: Denis Shienkov --- tests/auto/qserialport/tst_qserialport.cpp | 8 ++++---- 1 file 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)); -- cgit v1.2.1