remove doubly defines

This commit is contained in:
Robin Müller 2022-07-23 10:29:19 +02:00
parent fd55de9e95
commit b66fd63cb4
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
2 changed files with 1 additions and 15 deletions

View File

@ -74,20 +74,6 @@ class SerializeIF {
return serialize(buffer, size, maxSize, SerializeIF::Endianness::MACHINE);
}
/**
* Forwards to regular @serialize call with network endianness
*/
virtual ReturnValue_t serializeNe(uint8_t** buffer, size_t* size, size_t maxSize) {
return serialize(buffer, size, maxSize, SerializeIF::Endianness::NETWORK);
}
/**
* If endianness is not explicitly specified, use machine endianness
*/
virtual ReturnValue_t serialize(uint8_t **buffer, size_t *size, size_t maxSize) {
return serialize(buffer, size, maxSize, SerializeIF::Endianness::MACHINE);
}
/**
* Gets the size of a object if it would be serialized in a buffer
* @return Size of serialized object

View File

@ -41,7 +41,7 @@ TEST_CASE("CCSDS Packet ID", "[ccsds-packet-id]") {
packetId.secHeaderFlag = false;
packetId.packetType = ccsds::PacketType::TM;
REQUIRE(packetId.raw() == 0x1ff);
REQUIRE(packetId.SerializeIF::serialize(buf.data(), buf.size(), SerializeIF::Endianness::NETWORK) ==
REQUIRE(packetId.SerializeIF::serializeNe(buf.data(), buf.size()) ==
HasReturnvaluesIF::RETURN_OK);
REQUIRE(buf[0] == 0x1);
REQUIRE(buf[1] == 0xff);