fsfw/unittests/mock/cfdp/UserMock.cpp
2024-11-07 12:26:00 +01:00

37 lines
1.5 KiB
C++

#include "UserMock.h"
namespace cfdp {
cfdp::UserMock::UserMock(HasFileSystemIF& vfs) : UserBase(vfs) {}
void UserMock::transactionIndication(const TransactionId& id) { transactionIndicRecvd.emplace(id); }
void UserMock::eofSentIndication(const TransactionId& id) { eofSentRecvd.emplace(id); }
void UserMock::abandonedIndication(const TransactionId& id, cfdp::ConditionCode code,
uint64_t progress) {}
void UserMock::eofRecvIndication(const TransactionId& id) { eofRecvdRecvd.push(id); }
void UserMock::transactionFinishedIndication(const TransactionFinishedParams& finishedParams) {
finishedRecvd.emplace(finishedParams.id, finishedParams);
}
void UserMock::metadataRecvdIndication(const MetadataRecvdParams& params) {
metadataRecvd.emplace(params.id, params);
}
void UserMock::fileSegmentRecvdIndication(const FileSegmentRecvdParams& params) {}
void UserMock::reportIndication(const TransactionId& id, StatusReportIF& report) {}
void UserMock::suspendedIndication(const TransactionId& id, ConditionCode code) {}
void UserMock::resumedIndication(const TransactionId& id, size_t progress) {}
void UserMock::faultIndication(const TransactionId& id, cfdp::ConditionCode code, size_t progress) {
}
void UserMock::reset() {
std::queue<TransactionId>().swap(eofRecvdRecvd);
std::queue<std::pair<TransactionId, cfdp::MetadataRecvdParams>>().swap(metadataRecvd);
std::queue<std::pair<TransactionId, cfdp::TransactionFinishedParams>>().swap(finishedRecvd);
}
} // namespace cfdp