1234567891011121314151617181920212223242526272829303132333435 |
- /*
- * Copyright (c) 2021 - 2024 Stefan Strobel <stefan.strobel@shimatta.net>
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at https://mozilla.org/MPL/2.0/.
- */
- /**
- * @file test_crc16Slow.h
- * @brief unittest implementation for crc16 slow function
- * @author Stefan Strobel <stefan.strobel@shimatta.net>
- */
- #include "test/framework/catch.hpp"
- #include <string.h>
- #define SHELLMATTA_TRANSPORT
- #define SHELLMATTA_TRANSPORT_CRC_NO_LOOKUP
- #include "test_crc_data.h"
- #include "src/shellmatta_crc.c"
- TEST_CASE( "shellmatta_crc crc32Slow" ) {
- uint32_t crc = crc32Slow((char*)"123456789", 9);
- REQUIRE( crc == 0xCBF43926u);
- }
- TEST_CASE( "shellmatta_crc crc32Slow - more data" ) {
- uint32_t crc = crc32Slow((char*)data, sizeof(data));
- REQUIRE(crc == data_crc_32);
- }
|