seems to work well

This commit is contained in:
2023-07-27 14:55:46 +02:00
parent 5679b139ad
commit 0f208ec75a
20 changed files with 142 additions and 124 deletions

View File

@ -55,13 +55,13 @@ TEST_CASE("CFDP Dest Handler", "[cfdp]") {
std::string destNameString = "hello-cpy.txt";
StringLv srcName(srcNameString);
StringLv destName(destNameString);
MetadataInfo info(false, checksumType, cfdpFileSize, srcName, destName);
MetadataGenericInfo info(false, checksumType, std::move(cfdpFileSize));
TransactionSeqNum seqNum(UnsignedByteField<uint16_t>(1));
conf.sourceId = remoteId;
conf.destId = localId;
conf.mode = TransmissionMode::UNACKNOWLEDGED;
conf.seqNum = seqNum;
MetadataPduCreator metadataCreator(conf, info, nullptr, 0);
MetadataPduCreator metadataCreator(conf, info, srcName, destName, nullptr, 0);
REQUIRE(tcStore.getFreeElement(&storeId, metadataCreator.getSerializedSize(), &buf) == OK);
REQUIRE(metadataCreator.serialize(buf, serLen, metadataCreator.getSerializedSize()) == OK);
PacketInfo packetInfo(metadataCreator.getPduType(), storeId,
@ -81,7 +81,7 @@ TEST_CASE("CFDP Dest Handler", "[cfdp]") {
auto& idMetadataPair = userMock.metadataRecvd.back();
REQUIRE(idMetadataPair.first == destHandler.getTransactionId());
REQUIRE(idMetadataPair.second.sourceId.getValue() == 3);
REQUIRE(idMetadataPair.second.fileSize == fileLen);
REQUIRE(idMetadataPair.second.fileSize.getSize(nullptr) == fileLen);
REQUIRE(strcmp(idMetadataPair.second.destFileName, destName) == 0);
REQUIRE(strcmp(idMetadataPair.second.sourceFileName, sourceName) == 0);
userMock.metadataRecvd.pop();