diff options
author | Alex Blasche <alexander.blasche@theqtcompany.com> | 2015-11-10 13:26:52 +0100 |
---|---|---|
committer | Karsten Heimrich <karsten.heimrich@theqtcompany.com> | 2015-11-11 07:27:59 +0000 |
commit | e90f12be49a56bca0a1a38a9b87daf2340711fcf (patch) | |
tree | aed985b85ce1010e3cddc0bc954c57ba23853063 /tests | |
parent | 0e9212538da94d46924d76857a371c5a5d7b5dc4 (diff) |
QModbusReply::setError() does not have to be followed by setFinished()
setError() implicitly calls setFinished(). The unit tests have been
modified to ensure this behavior does not stop.
Change-Id: Id5f67e748fb330eada7575db79bc2239fa877385
Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qmodbusreply/tst_qmodbusreply.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/qmodbusreply/tst_qmodbusreply.cpp b/tests/auto/qmodbusreply/tst_qmodbusreply.cpp index f401ca9..0f179eb 100644 --- a/tests/auto/qmodbusreply/tst_qmodbusreply.cpp +++ b/tests/auto/qmodbusreply/tst_qmodbusreply.cpp @@ -163,6 +163,11 @@ void tst_QModbusReply::tst_setError() QCOMPARE(replyTest.error(), error); QCOMPARE(replyTest.errorText(), errorText); QCOMPARE(errorSpy.at(0).at(0).value<QModbusReply::ReplyError>(), error); + + replyTest.setError(error, errorText); + replyTest.setFinished(true); + QCOMPARE(finishedSpy.count(), 3); //setError() implies call to setFinished() + QCOMPARE(errorSpy.count(), 2); } void tst_QModbusReply::tst_setProtocolError_data() @@ -194,6 +199,11 @@ void tst_QModbusReply::tst_setProtocolError() QCOMPARE(replyTest.error(), QModbusReply::ProtocolError); QCOMPARE(replyTest.errorText(), errorText); QCOMPARE(errorSpy.at(0).at(0).value<QModbusReply::ReplyError>(), QModbusReply::ProtocolError); + + replyTest.setProtocolError(error, errorText); + replyTest.setFinished(true); + QCOMPARE(finishedSpy.count(), 3); //setError() implies call to setFinished() + QCOMPARE(errorSpy.count(), 2); } void tst_QModbusReply::tst_setResult() |