some tests
This commit is contained in:
parent
c9d37e8d62
commit
99aaf7068d
@ -66,7 +66,7 @@ class SerializeIF {
|
|||||||
* Gets the size of a object if it would be serialized in a buffer
|
* Gets the size of a object if it would be serialized in a buffer
|
||||||
* @return Size of serialized object
|
* @return Size of serialized object
|
||||||
*/
|
*/
|
||||||
virtual size_t getSerializedSize() const = 0;
|
[[nodiscard]] virtual size_t getSerializedSize() const = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief
|
* @brief
|
||||||
@ -99,7 +99,7 @@ class SerializeIF {
|
|||||||
* @param streamEndianness
|
* @param streamEndianness
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
virtual ReturnValue_t serialize(uint8_t* buffer, size_t maxSize, Endianness streamEndianness) {
|
virtual ReturnValue_t serialize(uint8_t* buffer, size_t maxSize, Endianness streamEndianness) const {
|
||||||
size_t tmpSize = 0;
|
size_t tmpSize = 0;
|
||||||
return serialize(&buffer, &tmpSize, maxSize, streamEndianness);
|
return serialize(&buffer, &tmpSize, maxSize, streamEndianness);
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ TEST_CASE("CCSDS Packet ID", "[ccsds-packet-id]") {
|
|||||||
packetId.secHeaderFlag = false;
|
packetId.secHeaderFlag = false;
|
||||||
packetId.packetType = ccsds::PacketType::TM;
|
packetId.packetType = ccsds::PacketType::TM;
|
||||||
REQUIRE(packetId.raw() == 0x1ff);
|
REQUIRE(packetId.raw() == 0x1ff);
|
||||||
REQUIRE(packetId.serialize(&ptr, &serLen, buf.size(), SerializeIF::Endianness::NETWORK) ==
|
REQUIRE(packetId.serialize(buf.data(), buf.size(), SerializeIF::Endianness::NETWORK) ==
|
||||||
HasReturnvaluesIF::RETURN_OK);
|
HasReturnvaluesIF::RETURN_OK);
|
||||||
REQUIRE(buf[0] == 0x1);
|
REQUIRE(buf[0] == 0x1);
|
||||||
REQUIRE(buf[1] == 0xff);
|
REQUIRE(buf[1] == 0xff);
|
||||||
|
Loading…
Reference in New Issue
Block a user