diff --git a/unittests/tmtcpacket/CMakeLists.txt b/unittests/tmtcpacket/CMakeLists.txt index dd0100a6..5b53328f 100644 --- a/unittests/tmtcpacket/CMakeLists.txt +++ b/unittests/tmtcpacket/CMakeLists.txt @@ -6,4 +6,5 @@ target_sources(${FSFW_TEST_TGT} PRIVATE testPusTmCreator.cpp testPusTmReader.cpp testCcsds.cpp + testZcTmWriter.cpp ) diff --git a/unittests/tmtcpacket/testZcTmWriter.cpp b/unittests/tmtcpacket/testZcTmWriter.cpp new file mode 100644 index 00000000..366697d1 --- /dev/null +++ b/unittests/tmtcpacket/testZcTmWriter.cpp @@ -0,0 +1,23 @@ +#include + +#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 buf{}; + uint8_t* dataPtr = buf.data(); + size_t serLen = 0; + + SECTION("Basic") { + REQUIRE(creator.serialize(dataPtr, serLen, buf.size()) == result::OK); + PusTmZeroCopyWriter() + } +} \ No newline at end of file