1
0
forked from fsfw/fsfw

completed all indication parameters

This commit is contained in:
2022-08-10 10:34:02 +02:00
parent e45a99143c
commit 3e1fd15613
15 changed files with 64 additions and 73 deletions

View File

@ -8,8 +8,6 @@ TEST_CASE("CFDP Dest Handler", "[cfdp]") {
EntityId localId = EntityId(UnsignedByteField<uint16_t>(2));
auto fhMock = FaultHandlerMock();
auto localEntityCfg = LocalEntityCfg(localId, IndicationCfg(), fhMock);
// auto destHandler = DestHandler();
cfdp::testFunc();
SECTION("State") {}
}

View File

@ -35,7 +35,7 @@ TEST_CASE("Finished PDU", "[cfdp][pdu]") {
// Add a filestore response
std::string firstName = "hello.txt";
cfdp::Lv firstNameLv(reinterpret_cast<const uint8_t*>(firstName.data()), firstName.size());
cfdp::StringLv firstNameLv(firstName);
FilestoreResponseTlv response(cfdp::FilestoreActionCode::DELETE_FILE,
cfdp::FSR_APPEND_FILE_1_NOT_EXISTS, firstNameLv, nullptr);
FilestoreResponseTlv* responsePtr = &response;
@ -53,7 +53,7 @@ TEST_CASE("Finished PDU", "[cfdp][pdu]") {
// Add two filestore responses and a fault location parameter
std::string secondName = "hello2.txt";
cfdp::Lv secondNameLv(reinterpret_cast<const uint8_t*>(secondName.data()), secondName.size());
cfdp::StringLv secondNameLv(secondName);
FilestoreResponseTlv response2(cfdp::FilestoreActionCode::DENY_FILE, cfdp::FSR_SUCCESS,
secondNameLv, nullptr);
REQUIRE(response2.getSerializedSize() == 15);
@ -101,7 +101,7 @@ TEST_CASE("Finished PDU", "[cfdp][pdu]") {
sz = 0;
buffer = fnBuffer.data();
std::string firstName = "hello.txt";
cfdp::Lv firstNameLv(reinterpret_cast<const uint8_t*>(firstName.data()), firstName.size());
cfdp::StringLv firstNameLv(firstName);
FilestoreResponseTlv response(cfdp::FilestoreActionCode::DELETE_FILE, cfdp::FSR_NOT_PERFORMED,
firstNameLv, nullptr);
FilestoreResponseTlv* responsePtr = &response;
@ -130,7 +130,7 @@ TEST_CASE("Finished PDU", "[cfdp][pdu]") {
// Add two filestore responses and a fault location parameter
std::string secondName = "hello2.txt";
cfdp::Lv secondNameLv(reinterpret_cast<const uint8_t*>(secondName.data()), secondName.size());
cfdp::StringLv secondNameLv(secondName);
FilestoreResponseTlv response2(cfdp::FilestoreActionCode::DENY_FILE, cfdp::FSR_SUCCESS,
secondNameLv, nullptr);
REQUIRE(response2.getSerializedSize() == 15);

View File

@ -20,8 +20,7 @@ TEST_CASE("Metadata PDU", "[cfdp][pdu]") {
PduConfig pduConf(sourceId, destId, TransmissionModes::ACKNOWLEDGED, seqNum);
std::string firstFileName = "hello.txt";
cfdp::Lv sourceFileName(reinterpret_cast<const uint8_t*>(firstFileName.data()),
firstFileName.size());
cfdp::StringLv sourceFileName(firstFileName);
cfdp::Lv destFileName;
FileSize fileSize(35);
MetadataInfo info(false, ChecksumType::MODULAR, fileSize, sourceFileName, destFileName);

View File

@ -25,9 +25,9 @@ TEST_CASE("CFDP LV", "[cfdp][lv]") {
SECTION("Filestore Response TLV") {
std::string name = "hello.txt";
cfdp::Lv firstName(reinterpret_cast<const uint8_t*>(name.data()), name.size());
cfdp::StringLv firstName(name);
std::string name2 = "hello2.txt";
cfdp::Lv secondName(reinterpret_cast<const uint8_t*>(name2.data()), name2.size());
cfdp::StringLv secondName(name2);
std::string msg = "12345";
cfdp::Lv fsMsg(reinterpret_cast<const uint8_t*>(msg.data()), msg.size());
FilestoreResponseTlv response(cfdp::FilestoreActionCode::APPEND_FILE, cfdp::FSR_SUCCESS,
@ -42,8 +42,8 @@ TEST_CASE("CFDP LV", "[cfdp][lv]") {
SerializeIF::Endianness::NETWORK);
REQUIRE(result == HasReturnvaluesIF::RETURN_OK);
REQUIRE(rawResponse.getType() == cfdp::TlvTypes::FILESTORE_RESPONSE);
cfdp::Lv emptyMsg;
cfdp::Lv emptySecondName;
cfdp::StringLv emptyMsg;
cfdp::StringLv emptySecondName;
FilestoreResponseTlv emptyTlv(firstName, &emptyMsg);
emptyTlv.setSecondFileName(&emptySecondName);
result = emptyTlv.deSerialize(rawResponse, SerializeIF::Endianness::NETWORK);
@ -59,9 +59,9 @@ TEST_CASE("CFDP LV", "[cfdp][lv]") {
SECTION("Filestore Request TLV") {
std::string name = "hello.txt";
cfdp::Lv firstName(reinterpret_cast<const uint8_t*>(name.data()), name.size());
cfdp::StringLv firstName(name);
std::string name2 = "hello2.txt";
cfdp::Lv secondName(reinterpret_cast<const uint8_t*>(name2.data()), name2.size());
cfdp::StringLv secondName(name2);
FilestoreRequestTlv request(cfdp::FilestoreActionCode::APPEND_FILE, firstName);
// second name not set yet

View File

@ -8,8 +8,10 @@ void cfdp::UserMock::abandonedIndication(cfdp::TransactionId id, cfdp::Condition
uint64_t progress) {}
void cfdp::UserMock::eofRecvIndication(cfdp::TransactionId id) {}
void cfdp::UserMock::transactionFinishedIndication(TransactionFinishedParams finishedParams) {}
void cfdp::UserMock::metadataRecvdIndication(MetadataRecvParams params) {}
void cfdp::UserMock::metadataRecvdIndication(MetadataRecvdParams params) {}
void cfdp::UserMock::fileSegmentRecvdIndication(FileSegmentRecvdParams params) {}
void cfdp::UserMock::reportIndication() {}
void cfdp::UserMock::suspendedIndication() {}
void cfdp::UserMock::resumedIndication() {}
void cfdp::UserMock::reportIndication(TransactionId id, StatusReportIF& report) {}
void cfdp::UserMock::suspendedIndication(TransactionId id, ConditionCode code) {}
void cfdp::UserMock::resumedIndication(TransactionId id, size_t progress) {}
void cfdp::UserMock::faultIndication(cfdp::TransactionId id, cfdp::ConditionCode code,
size_t progress) {}

View File

@ -10,14 +10,15 @@ class UserMock : public UserBase {
public:
void transactionIndication(TransactionId id) override;
void eofSentIndication(TransactionId id) override;
void abandonedIndication(TransactionId id, ConditionCode code, uint64_t progress) override;
void abandonedIndication(TransactionId id, ConditionCode code, size_t progress) override;
void eofRecvIndication(TransactionId id) override;
void transactionFinishedIndication(TransactionFinishedParams params) override;
void metadataRecvdIndication(MetadataRecvParams params) override;
void metadataRecvdIndication(MetadataRecvdParams params) override;
void fileSegmentRecvdIndication(FileSegmentRecvdParams params) override;
void reportIndication() override;
void suspendedIndication() override;
void resumedIndication() override;
void reportIndication(TransactionId id, StatusReportIF& report) override;
void suspendedIndication(TransactionId id, ConditionCode code) override;
void resumedIndication(TransactionId id, size_t progress) override;
void faultIndication(TransactionId id, ConditionCode code, size_t progress) override;
};
} // namespace cfdp