add tm zc test

This commit is contained in:
Robin Müller 2022-07-28 12:52:20 +02:00
parent b485afea57
commit 72bc5d4d60
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
2 changed files with 24 additions and 0 deletions

View File

@ -6,4 +6,5 @@ target_sources(${FSFW_TEST_TGT} PRIVATE
testPusTmCreator.cpp testPusTmCreator.cpp
testPusTmReader.cpp testPusTmReader.cpp
testCcsds.cpp testCcsds.cpp
testZcTmWriter.cpp
) )

View File

@ -0,0 +1,23 @@
#include <catch2/catch_test_macros.hpp>
#include "fsfw/tmtcpacket/pus/tm.h"
#include "fsfw/tmtcpacket/pus/tm/PusTmZcWriter.h"
#include "mocks/CdsShortTimestamperMock.h"
TEST_CASE("TM ZC Helper", "[tm-zc-helper]") {
auto packetId = PacketId(ccsds::PacketType::TC, true, 0xef);
auto spParams =
SpacePacketParams(packetId, PacketSeqCtrl(ccsds::SequenceFlags::UNSEGMENTED, 22), 0x00);
auto timeStamper = CdsShortTimestamperMock();
auto pusTmParams = PusTmParams(17, 2, &timeStamper);
timeStamper.valueToStamp = {1, 2, 3, 4, 5, 6, 7};
PusTmCreator creator(spParams, pusTmParams);
std::array<uint8_t, 32> buf{};
uint8_t* dataPtr = buf.data();
size_t serLen = 0;
SECTION("Basic") {
REQUIRE(creator.serialize(dataPtr, serLen, buf.size()) == result::OK);
PusTmZeroCopyWriter()
}
}