test_crc32Slow.cpp 471 B

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