summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@theqtcompany.com>2015-11-02 13:18:27 +0100
committerKarsten Heimrich <karsten.heimrich@theqtcompany.com>2015-11-04 20:47:07 +0000
commit10cb96d96d62b70d9bd5839d1572bd31d795d8a2 (patch)
treebd88428a4028943a8f2c18dff4b4b8aed8317131 /tests
parentf0cd212bc50c406c6cba32f3fdb1bdf26b3ec897 (diff)
Move exceptionCode() from QModbusExceptionResponse to QModbusPdu
Change-Id: I8e50417ba4973721f7d9f40f4d87d11c0b705925 Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qmodbuspdu/tst_qmodbuspdu.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/auto/qmodbuspdu/tst_qmodbuspdu.cpp b/tests/auto/qmodbuspdu/tst_qmodbuspdu.cpp
index 1a37155..b4c89d7 100644
--- a/tests/auto/qmodbuspdu/tst_qmodbuspdu.cpp
+++ b/tests/auto/qmodbuspdu/tst_qmodbuspdu.cpp
@@ -113,17 +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.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.data().toHex(), QByteArray());
QModbusExceptionResponse exception;
QCOMPARE(exception.isValid(), false);
QCOMPARE(exception.isException(), false);
+ QCOMPARE(exception.exceptionCode(), QModbusPdu::UnknownError);
QCOMPARE(exception.functionCode(), QModbusExceptionResponse::FunctionCode(0x00));
QCOMPARE(exception.data().toHex(), QByteArray());
}
@@ -134,6 +137,7 @@ private slots:
QCOMPARE(request.isValid(), true);
QCOMPARE(request.isException(), false);
QCOMPARE(request.functionCode(), QModbusRequest::ReportServerId);
+ QCOMPARE(request.exceptionCode(), QModbusPdu::UnknownError);
QCOMPARE(request.data().toHex(), QByteArray());
// Byte Count, Server ID, Run Indicator Status
@@ -142,6 +146,7 @@ private slots:
QCOMPARE(response.isValid(), true);
QCOMPARE(response.isException(), false);
QCOMPARE(response.functionCode(), QModbusResponse::ReportServerId);
+ QCOMPARE(response.exceptionCode(), QModbusPdu::UnknownError);
QCOMPARE(response.data().toHex(), QByteArray("0201ff"));
}