multi file segment works

This commit is contained in:
Robin Müller 2023-08-14 12:15:35 +02:00
parent 15629abf19
commit b094ba145f
Signed by: muellerr
GPG Key ID: 407F9B00F858F270

View File

@ -229,5 +229,17 @@ TEST_CASE("CFDP Source Handler", "[cfdp]") {
for (unsigned i = 0; i < fileDataSize; i++) { for (unsigned i = 0; i < fileDataSize; i++) {
CHECK(fileData[i] == largerFileData[MAX_FILE_SEGMENT_SIZE + 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);
} }
} }