diff options
author | Alex Blasche <alexander.blasche@theqtcompany.com> | 2015-11-04 16:32:43 +0100 |
---|---|---|
committer | Karsten Heimrich <karsten.heimrich@theqtcompany.com> | 2015-11-05 09:26:25 +0000 |
commit | 48e107fa39b0af5255882741bf60fd04ebd4af3f (patch) | |
tree | ceb41d2f04395af9cf2d65057c78f0dfb14d8c0d /tests | |
parent | 4a1b4284df76656996c701f9660969cff0f3cee3 (diff) |
Do not overload transmission and Modbus exception codes
QModbusReply::ProtocolError stands for Modbus exception codes.
Change-Id: I2dfb89ebe574c8e83b9f8621bc4a451e4663dffa
Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qmodbuspdu/tst_qmodbuspdu.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/auto/qmodbuspdu/tst_qmodbuspdu.cpp b/tests/auto/qmodbuspdu/tst_qmodbuspdu.cpp index b4c89d7..e293224 100644 --- a/tests/auto/qmodbuspdu/tst_qmodbuspdu.cpp +++ b/tests/auto/qmodbuspdu/tst_qmodbuspdu.cpp @@ -113,20 +113,20 @@ private slots: QCOMPARE(request.isValid(), false); QCOMPARE(request.isException(), false); QCOMPARE(request.functionCode(), QModbusRequest::FunctionCode(0x00)); - QCOMPARE(request.exceptionCode(), QModbusPdu::UnknownError); + QCOMPARE(request.exceptionCode(), QModbusPdu::ExtendedException); QCOMPARE(request.data().toHex(), QByteArray()); QModbusResponse response; QCOMPARE(response.isValid(), false); QCOMPARE(response.isException(), false); QCOMPARE(response.functionCode(), QModbusResponse::FunctionCode(0x00)); - QCOMPARE(response.exceptionCode(), QModbusPdu::UnknownError); + QCOMPARE(response.exceptionCode(), QModbusPdu::ExtendedException); QCOMPARE(response.data().toHex(), QByteArray()); QModbusExceptionResponse exception; QCOMPARE(exception.isValid(), false); QCOMPARE(exception.isException(), false); - QCOMPARE(exception.exceptionCode(), QModbusPdu::UnknownError); + QCOMPARE(exception.exceptionCode(), QModbusPdu::ExtendedException); QCOMPARE(exception.functionCode(), QModbusExceptionResponse::FunctionCode(0x00)); QCOMPARE(exception.data().toHex(), QByteArray()); } @@ -137,7 +137,7 @@ private slots: QCOMPARE(request.isValid(), true); QCOMPARE(request.isException(), false); QCOMPARE(request.functionCode(), QModbusRequest::ReportServerId); - QCOMPARE(request.exceptionCode(), QModbusPdu::UnknownError); + QCOMPARE(request.exceptionCode(), QModbusPdu::ExtendedException); QCOMPARE(request.data().toHex(), QByteArray()); // Byte Count, Server ID, Run Indicator Status @@ -146,7 +146,7 @@ private slots: QCOMPARE(response.isValid(), true); QCOMPARE(response.isException(), false); QCOMPARE(response.functionCode(), QModbusResponse::ReportServerId); - QCOMPARE(response.exceptionCode(), QModbusPdu::UnknownError); + QCOMPARE(response.exceptionCode(), QModbusPdu::ExtendedException); QCOMPARE(response.data().toHex(), QByteArray("0201ff")); } @@ -273,14 +273,14 @@ private slots: QModbusExceptionResponse exception2(pdu); QCOMPARE(exception2.isException(), true); QCOMPARE(exception2.functionCode(), QModbusExceptionResponse::FunctionCode(0x81)); - QCOMPARE(exception2.exceptionCode(), QModbusExceptionResponse::UnknownError); + QCOMPARE(exception2.exceptionCode(), QModbusExceptionResponse::ExtendedException); exception2.setExceptionCode(QModbusExceptionResponse::IllegalFunction); QCOMPARE(exception2.exceptionCode(), QModbusExceptionResponse::IllegalFunction); QModbusExceptionResponse exception3 = pdu; QCOMPARE(exception3.isException(), true); QCOMPARE(exception3.functionCode(), QModbusExceptionResponse::FunctionCode(0x81)); - QCOMPARE(exception3.exceptionCode(), QModbusExceptionResponse::UnknownError); + QCOMPARE(exception3.exceptionCode(), QModbusExceptionResponse::ExtendedException); } void testQDebugStreamOperator() |