test_crc32Fast.cpp 493 B

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