test no crc generation

This commit is contained in:
Robin Müller 2022-07-28 13:37:07 +02:00
parent cb118176a0
commit 1b5fa2a8fa
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
2 changed files with 12 additions and 2 deletions

View File

@ -146,4 +146,13 @@ TEST_CASE("PUS TM Creator", "[pus-tm-creator]") {
SerializeIF::BUFFER_TOO_SHORT);
}
}
SECTION("No CRC Generation") {
creator.disableCrcCalculation();
REQUIRE(not creator.crcCalculationEnabled());
REQUIRE(creator.serialize(dataPtr, serLen, buf.size()) == HasReturnvaluesIF::RETURN_OK);
REQUIRE(serLen == 22);
REQUIRE(buf[20] == 0x00);
REQUIRE(buf[21] == 0x00);
}
}

View File

@ -38,9 +38,10 @@ TEST_CASE("PUS TM Reader", "[pus-tm-reader]") {
readerPtr->setTimeReader(&timeStamperAndReader);
deleteReader = true;
}
REQUIRE(readerPtr);
REQUIRE(not readerPtr->isNull());
REQUIRE(not *readerPtr);
REQUIRE(readerPtr->isNull());
REQUIRE(readerPtr->parseDataWithCrcCheck() == HasReturnvaluesIF::RETURN_OK);
REQUIRE(not readerPtr->isNull());
REQUIRE(readerPtr->getService() == 17);
REQUIRE(readerPtr->getSubService() == 2);
REQUIRE(readerPtr->getApid() == 0xef);