fsfw/unittests/mocks/cfdp/UserMock.cpp

37 lines
1.5 KiB
C++
Raw Normal View History

#include "UserMock.h"
namespace cfdp {
cfdp::UserMock::UserMock(HasFileSystemIF& vfs) : UserBase(vfs) {}
2023-08-14 13:33:47 +02:00
void UserMock::transactionIndication(const TransactionId& id) { transactionIndicRecvd.emplace(id); }
void UserMock::eofSentIndication(const TransactionId& id) {}
void UserMock::abandonedIndication(const TransactionId& id, cfdp::ConditionCode code,
2022-08-24 17:31:26 +02:00
uint64_t progress) {}
void UserMock::eofRecvIndication(const TransactionId& id) { eofsRevd.push(id); }
2022-09-06 14:06:22 +02:00
void UserMock::transactionFinishedIndication(const TransactionFinishedParams& finishedParams) {
2023-08-14 13:33:47 +02:00
finishedRecvd.emplace(finishedParams.id, finishedParams);
2022-09-06 14:06:22 +02:00
}
2022-09-06 13:16:00 +02:00
void UserMock::metadataRecvdIndication(const MetadataRecvdParams& params) {
2023-08-14 13:33:47 +02:00
metadataRecvd.emplace(params.id, params);
2022-09-06 13:16:00 +02:00
}
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) {}
2022-08-24 17:31:26 +02:00
void UserMock::faultIndication(const TransactionId& id, cfdp::ConditionCode code, size_t progress) {
}
2022-08-24 17:31:26 +02:00
2022-09-06 13:16:00 +02:00
void UserMock::reset() {
std::queue<TransactionId>().swap(eofsRevd);
2022-09-06 14:06:22 +02:00
std::queue<std::pair<TransactionId, cfdp::MetadataRecvdParams>>().swap(metadataRecvd);
std::queue<std::pair<TransactionId, cfdp::TransactionFinishedParams>>().swap(finishedRecvd);
2022-09-06 13:16:00 +02:00
}
2022-08-24 17:31:26 +02:00
} // namespace cfdp