separate unittest folder

This commit is contained in:
2022-07-18 11:42:51 +02:00
parent 3b23fb77b4
commit 8465670374
107 changed files with 1 additions and 1 deletions

View File

@ -0,0 +1,14 @@
#include <array>
#include "catch2/catch_test_macros.hpp"
#include "fsfw/globalfunctions/CRC.h"
#include "fsfw_tests/unit/CatchDefinitions.h"
TEST_CASE("CRC", "[CRC]") {
std::array<uint8_t, 10> testData = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
uint16_t crc = CRC::crc16ccitt(testData.data(), 10);
REQUIRE(crc == 49729);
for (uint8_t index = 0; index < testData.size(); index++) {
REQUIRE(testData[index] == index);
}
}