From 3f645884a44bc3dc32b04cc57e0803cf5e5e5884 Mon Sep 17 00:00:00 2001 From: Oleg Hahm Date: Thu, 4 Feb 2016 12:00:07 +0100 Subject: [PATCH] crc: rename checksum to CRC --- sys/{checksum => crc}/Makefile | 0 sys/{checksum => crc}/crc16_ccitt.c | 4 ++-- sys/{checksum => crc}/doc.txt | 4 ++-- sys/include/{checksum => crc}/crc16_ccitt.h | 4 ++-- tests/unittests/tests-checksum/Makefile.include | 1 - .../{tests-checksum => tests-crc}/Makefile | 0 tests/unittests/tests-crc/Makefile.include | 1 + .../tests-crc-crc16-ccitt.c} | 14 +++++++------- .../tests-checksum.c => tests-crc/tests-crc.c} | 6 +++--- .../tests-checksum.h => tests-crc/tests-crc.h} | 8 ++++---- 10 files changed, 21 insertions(+), 21 deletions(-) rename sys/{checksum => crc}/Makefile (100%) rename sys/{checksum => crc}/crc16_ccitt.c (97%) rename sys/{checksum => crc}/doc.txt (75%) rename sys/include/{checksum => crc}/crc16_ccitt.h (95%) delete mode 100644 tests/unittests/tests-checksum/Makefile.include rename tests/unittests/{tests-checksum => tests-crc}/Makefile (100%) create mode 100644 tests/unittests/tests-crc/Makefile.include rename tests/unittests/{tests-checksum/tests-checksum-crc16-ccitt.c => tests-crc/tests-crc-crc16-ccitt.c} (89%) rename tests/unittests/{tests-checksum/tests-checksum.c => tests-crc/tests-crc.c} (70%) rename tests/unittests/{tests-checksum/tests-checksum.h => tests-crc/tests-crc.h} (79%) diff --git a/sys/checksum/Makefile b/sys/crc/Makefile similarity index 100% rename from sys/checksum/Makefile rename to sys/crc/Makefile diff --git a/sys/checksum/crc16_ccitt.c b/sys/crc/crc16_ccitt.c similarity index 97% rename from sys/checksum/crc16_ccitt.c rename to sys/crc/crc16_ccitt.c index a3fb59598ca7..d22c25a1e43b 100644 --- a/sys/checksum/crc16_ccitt.c +++ b/sys/crc/crc16_ccitt.c @@ -7,7 +7,7 @@ */ /** - * @ingroup sys_checksum_crc16_ccitt + * @ingroup sys_crc_crc16_ccitt * @{ * * @file @@ -21,7 +21,7 @@ #include #include -#include "checksum/crc16_ccitt.h" +#include "crc/crc16_ccitt.h" static const uint16_t _crc16_lookuptable[256] = { 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7, diff --git a/sys/checksum/doc.txt b/sys/crc/doc.txt similarity index 75% rename from sys/checksum/doc.txt rename to sys/crc/doc.txt index c3fc700e5658..c2f42a7b6ff4 100644 --- a/sys/checksum/doc.txt +++ b/sys/crc/doc.txt @@ -7,7 +7,7 @@ */ /** - * @defgroup sys_checksum Checksum + * @defgroup sys_crc CRC Cyclic redundancy checks * @ingroup sys - * @brief Checksum function libraries + * @brief CRC hashing functions */ diff --git a/sys/include/checksum/crc16_ccitt.h b/sys/include/crc/crc16_ccitt.h similarity index 95% rename from sys/include/checksum/crc16_ccitt.h rename to sys/include/crc/crc16_ccitt.h index 1eaded39aaa9..04b29e5827da 100644 --- a/sys/include/checksum/crc16_ccitt.h +++ b/sys/include/crc/crc16_ccitt.h @@ -7,8 +7,8 @@ */ /** - * @defgroup sys_checksum_crc16_ccitt CRC16-CCITT - * @ingroup sys_checksum + * @defgroup sys_crc_crc16_ccitt CRC16-CCITT + * @ingroup sys_crc * * @brief CRC16-CCITT checksum algorithm * @details This implementation of CRC16 is based on the CCITT diff --git a/tests/unittests/tests-checksum/Makefile.include b/tests/unittests/tests-checksum/Makefile.include deleted file mode 100644 index 5cbd968a589f..000000000000 --- a/tests/unittests/tests-checksum/Makefile.include +++ /dev/null @@ -1 +0,0 @@ -USEMODULE += checksum diff --git a/tests/unittests/tests-checksum/Makefile b/tests/unittests/tests-crc/Makefile similarity index 100% rename from tests/unittests/tests-checksum/Makefile rename to tests/unittests/tests-crc/Makefile diff --git a/tests/unittests/tests-crc/Makefile.include b/tests/unittests/tests-crc/Makefile.include new file mode 100644 index 000000000000..79a6daa4eb87 --- /dev/null +++ b/tests/unittests/tests-crc/Makefile.include @@ -0,0 +1 @@ +USEMODULE += crc diff --git a/tests/unittests/tests-checksum/tests-checksum-crc16-ccitt.c b/tests/unittests/tests-crc/tests-crc-crc16-ccitt.c similarity index 89% rename from tests/unittests/tests-checksum/tests-checksum-crc16-ccitt.c rename to tests/unittests/tests-crc/tests-crc-crc16-ccitt.c index 2159999eb41f..e8c5d8276112 100644 --- a/tests/unittests/tests-checksum/tests-checksum-crc16-ccitt.c +++ b/tests/unittests/tests-crc/tests-crc-crc16-ccitt.c @@ -10,9 +10,9 @@ #include "embUnit/embUnit.h" -#include "checksum/crc16_ccitt.h" +#include "crc/crc16_ccitt.h" -#include "tests-checksum.h" +#include "tests-crc.h" static int calc_and_compare_crc_with_update(const unsigned char *buf, size_t len, size_t split, uint16_t expected) @@ -32,7 +32,7 @@ static int calc_and_compare_crc(const unsigned char *buf, size_t len, return result == expected; } -static void test_checksum_crc16_ccitt_sequence(void) +static void test_crc_crc16_ccitt_sequence(void) { /* Reference values according to * http://srecord.sourceforge.net/crc16-ccitt.html */ @@ -85,13 +85,13 @@ static void test_checksum_crc16_ccitt_sequence(void) } } -Test *tests_checksum_crc16_ccitt_tests(void) +Test *tests_crc_crc16_ccitt_tests(void) { EMB_UNIT_TESTFIXTURES(fixtures) { - new_TestFixture(test_checksum_crc16_ccitt_sequence), + new_TestFixture(test_crc_crc16_ccitt_sequence), }; - EMB_UNIT_TESTCALLER(checksum_crc16_ccitt_tests, NULL, NULL, fixtures); + EMB_UNIT_TESTCALLER(crc_crc16_ccitt_tests, NULL, NULL, fixtures); - return (Test *)&checksum_crc16_ccitt_tests; + return (Test *)&crc_crc16_ccitt_tests; } diff --git a/tests/unittests/tests-checksum/tests-checksum.c b/tests/unittests/tests-crc/tests-crc.c similarity index 70% rename from tests/unittests/tests-checksum/tests-checksum.c rename to tests/unittests/tests-crc/tests-crc.c index 356c081ecf1b..38376518fc97 100644 --- a/tests/unittests/tests-checksum/tests-checksum.c +++ b/tests/unittests/tests-crc/tests-crc.c @@ -6,9 +6,9 @@ * directory for more details. */ -#include "tests-checksum.h" +#include "tests-crc.h" -void tests_checksum(void) +void tests_crc(void) { - TESTS_RUN(tests_checksum_crc16_ccitt_tests()); + TESTS_RUN(tests_crc_crc16_ccitt_tests()); } diff --git a/tests/unittests/tests-checksum/tests-checksum.h b/tests/unittests/tests-crc/tests-crc.h similarity index 79% rename from tests/unittests/tests-checksum/tests-checksum.h rename to tests/unittests/tests-crc/tests-crc.h index 10c90e13669e..80b0ab3d5c01 100644 --- a/tests/unittests/tests-checksum/tests-checksum.h +++ b/tests/unittests/tests-crc/tests-crc.h @@ -11,7 +11,7 @@ * @{ * * @file - * @brief Unittests for the ``checksum`` module + * @brief Unittests for the ``crc`` module * * @author Ludwig Knüpfer */ @@ -28,14 +28,14 @@ extern "C" { /** * @brief The entry point of this test suite. */ -void tests_checksum(void); +void tests_crc(void); /** - * @brief Generates tests for checksum/crc16_ccitt.h + * @brief Generates tests for crc/crc16_ccitt.h * * @return embUnit tests if successful, NULL if not. */ -Test *tests_checksum_crc16_ccitt_tests(void); +Test *tests_crc_crc16_ccitt_tests(void); #ifdef __cplusplus }