test_crc32Fast.cpp 463 B

1234567891011121314151617181920
  1. #include "test/framework/catch.hpp"
  2. #include <string.h>
  3. #undef SHELLMATTA_TRANSPORT_CRC_NO_LOOKUP
  4. #include "test_crc32_data.h"
  5. #include "src/shellmatta_crc.c"
  6. TEST_CASE( "shellmatta_crc crc32Fast" ) {
  7. uint32_t crc = crc32Fast((char*)"123456789", 9, crc32Table);
  8. REQUIRE(crc == 0xCBF43926u);
  9. }
  10. TEST_CASE( "shellmatta_crc crc32Fast - more data" ) {
  11. uint32_t crc = crc32Fast((char*)data, sizeof(data), crc32Table);
  12. REQUIRE(crc == data_crc);
  13. }