From b094ba145f596bf7f94448da1c3baf07daebe919 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 14 Aug 2023 12:15:35 +0200 Subject: [PATCH] multi file segment works --- unittests/cfdp/handler/testSourceHandler.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/unittests/cfdp/handler/testSourceHandler.cpp b/unittests/cfdp/handler/testSourceHandler.cpp index da07a036..1e32b769 100644 --- a/unittests/cfdp/handler/testSourceHandler.cpp +++ b/unittests/cfdp/handler/testSourceHandler.cpp @@ -229,5 +229,17 @@ TEST_CASE("CFDP Source Handler", "[cfdp]") { for (unsigned i = 0; i < fileDataSize; i++) { CHECK(fileData[i] == largerFileData[MAX_FILE_SEGMENT_SIZE + i]); } + mqMock.clearMessages(); + + // Check EOF and verify checksum. + fsmResult = sourceHandler.stateMachine(); + + etl::crc32 crcCalc; + crcCalc.add(largerFileData.data(), largerFileData.data() + largerFileData.size()); + // Verify EOF PDU was sent. + genericEofCheck(fsmResult, expectedFileSize, crcCalc.value()); + + CHECK(sourceHandler.getStep() == SourceHandler::TransactionStep::IDLE); + CHECK(sourceHandler.getState() == CfdpState::IDLE); } } \ No newline at end of file