From 6021257a87a439ed5c54d7f3c0646332093bbb88 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 19 Oct 2023 10:21:18 +0200 Subject: [PATCH] unittest fix --- src/fsfw/cfdp/handler/SourceHandler.cpp | 14 +++++--------- src/fsfw/cfdp/handler/SourceHandler.h | 1 - 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/fsfw/cfdp/handler/SourceHandler.cpp b/src/fsfw/cfdp/handler/SourceHandler.cpp index eba21b7d..f0f89607 100644 --- a/src/fsfw/cfdp/handler/SourceHandler.cpp +++ b/src/fsfw/cfdp/handler/SourceHandler.cpp @@ -50,19 +50,16 @@ cfdp::SourceHandler::FsmResult& cfdp::SourceHandler::fsmNacked() { } if (step == TransactionStep::TRANSACTION_START) { sourceParams.user.transactionIndication(transactionParams.id); - step = TransactionStep::CRC_PROCEDURE; - } - if (step == TransactionStep::CRC_PROCEDURE) { result = checksumGeneration(); if (result != OK) { - // TODO: Some error handling + addError(result); } step = TransactionStep::SENDING_METADATA; } if (step == TransactionStep::SENDING_METADATA) { result = prepareAndSendMetadataPdu(); if (result != OK) { - // TODO: Error handling + addError(result); } fsmResult.callStatus = CallStatus::CALL_AGAIN; return fsmResult; @@ -72,13 +69,13 @@ cfdp::SourceHandler::FsmResult& cfdp::SourceHandler::fsmNacked() { result = prepareAndSendNextFileDataPdu(noFdPdu); if (result == OK and !noFdPdu) { fsmResult.callStatus = CallStatus::CALL_AGAIN; + return fsmResult; } - return fsmResult; } if (step == TransactionStep::SENDING_EOF) { result = prepareAndSendEofPdu(); if (result != OK) { - // TODO: Error handling + addError(result); } if (sourceParams.cfg.indicCfg.eofSentIndicRequired) { sourceParams.user.eofSentIndication(transactionParams.id); @@ -139,8 +136,7 @@ ReturnValue_t cfdp::SourceHandler::checksumGeneration() { params.size = readLen; auto result = sourceParams.user.vfs.readFromFile(params, buf.data(), buf.size()); if (result != OK) { - // TODO: I think this is a case for a filestore rejection, but it might sense to print - // a warning or trigger an event because this should generally not happen + addError(result); return FAILED; } crcCalc.add(buf.begin(), buf.begin() + readLen); diff --git a/src/fsfw/cfdp/handler/SourceHandler.h b/src/fsfw/cfdp/handler/SourceHandler.h index 60634e0a..d1d3fab2 100644 --- a/src/fsfw/cfdp/handler/SourceHandler.h +++ b/src/fsfw/cfdp/handler/SourceHandler.h @@ -30,7 +30,6 @@ class SourceHandler { enum class TransactionStep : uint8_t { IDLE = 0, TRANSACTION_START = 1, - CRC_PROCEDURE = 2, SENDING_METADATA = 3, SENDING_FILE_DATA = 4, SENDING_EOF = 5,