test_crc16Slow.cpp 460 B

123456789101112131415161718192021
  1. #include "test/framework/catch.hpp"
  2. #include <string.h>
  3. #define SHELLMATTA_TRANSPORT
  4. #define SHELLMATTA_YMODEM_CRC_NO_LOOKUP
  5. #include "test_crc_data.h"
  6. #include "src/shellmatta_crc.c"
  7. TEST_CASE("shellmatta_crc crc16Slow" ) {
  8. uint32_t crc = crc16Slow((char*)"123456789", 9);
  9. REQUIRE(crc == 0x31C3u);
  10. }
  11. TEST_CASE("shellmatta_crc crc16Slow - more data") {
  12. uint32_t crc = crc16Slow((char*)data, sizeof(data));
  13. REQUIRE(crc == data_crc_16);
  14. }