This commit is contained in:
Jakob Meier 2022-06-06 12:26:00 +02:00
parent ae2f7219fd
commit 103661facc

View File

@ -35,26 +35,26 @@ TEST_CASE("Device Handler Base", "[DeviceHandlerBase]") {
REQUIRE(result == HasReturnvaluesIF::RETURN_OK);
}
SECTION("Commanding missed reply") {
comIF.setTestCase(ComIFMock::TestCase::MISSED_REPLY);
deviceHandlerCommander.resetReplyReturnCode();
// Set the timeout to 0 to immediately timeout the reply
deviceHandlerMock.changeSimpleCommandReplyCountdown(0);
result = deviceHandlerCommander.sendCommand(objects::DEVICE_HANDLER_MOCK,
DeviceHandlerMock::SIMPLE_COMMAND);
REQUIRE(result == HasReturnvaluesIF::RETURN_OK);
deviceHandlerMock.performOperation(DeviceHandlerIF::PERFORM_OPERATION);
deviceHandlerMock.performOperation(DeviceHandlerIF::SEND_WRITE);
deviceHandlerMock.performOperation(DeviceHandlerIF::GET_WRITE);
deviceHandlerMock.performOperation(DeviceHandlerIF::SEND_READ);
deviceHandlerMock.performOperation(DeviceHandlerIF::GET_READ);
deviceHandlerMock.performOperation(DeviceHandlerIF::PERFORM_OPERATION);
deviceHandlerCommander.performOperation();
result = deviceHandlerCommander.getReplyReturnCode();
REQUIRE(result == DeviceHandlerIF::TIMEOUT);
uint32_t missedReplies = deviceFdirMock.getMissedReplyCount();
REQUIRE(missedReplies == 1);
}
// SECTION("Commanding missed reply") {
// comIF.setTestCase(ComIFMock::TestCase::MISSED_REPLY);
// deviceHandlerCommander.resetReplyReturnCode();
// // Set the timeout to 0 to immediately timeout the reply
// deviceHandlerMock.changeSimpleCommandReplyCountdown(0);
// result = deviceHandlerCommander.sendCommand(objects::DEVICE_HANDLER_MOCK,
// DeviceHandlerMock::SIMPLE_COMMAND);
// REQUIRE(result == HasReturnvaluesIF::RETURN_OK);
// deviceHandlerMock.performOperation(DeviceHandlerIF::PERFORM_OPERATION);
// deviceHandlerMock.performOperation(DeviceHandlerIF::SEND_WRITE);
// deviceHandlerMock.performOperation(DeviceHandlerIF::GET_WRITE);
// deviceHandlerMock.performOperation(DeviceHandlerIF::SEND_READ);
// deviceHandlerMock.performOperation(DeviceHandlerIF::GET_READ);
// deviceHandlerMock.performOperation(DeviceHandlerIF::PERFORM_OPERATION);
// deviceHandlerCommander.performOperation();
// result = deviceHandlerCommander.getReplyReturnCode();
// REQUIRE(result == DeviceHandlerIF::TIMEOUT);
// uint32_t missedReplies = deviceFdirMock.getMissedReplyCount();
// REQUIRE(missedReplies == 1);
// }
SECTION("Periodic reply nominal") {
comIF.setTestCase(ComIFMock::TestCase::PERIODIC_REPLY_NOMINAL);