Simple SerializeIF adaptions

- Returns serialized or deserialized size
This commit is contained in:
2022-07-27 21:29:05 +02:00
parent 5bb7023ff3
commit b485afea57
9 changed files with 101 additions and 47 deletions

View File

@ -94,6 +94,18 @@ TEST_CASE("PUS TC Creator", "[pus-tc-creator]") {
REQUIRE(buf[13] == 3);
}
SECTION("Test with Application Data Serializable Simple Ser API") {
auto& params = creator.getPusParams();
auto simpleSer = SimpleSerializable();
creator.setSerializableUserData(simpleSer);
REQUIRE(creator.getSerializedSize() == 16);
REQUIRE(creator.serialize(dataPtr, serLen, buf.size()) == HasReturnvaluesIF::RETURN_OK);
REQUIRE(serLen == 16);
REQUIRE(buf[11] == 1);
REQUIRE(buf[12] == 2);
REQUIRE(buf[13] == 3);
}
SECTION("Deserialization Fails") {
SerializeIF& deser = creator;
size_t deserLen = buf.size();