From 1fedd456ce5445031028c0f539716463a604fb71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludwig=20Kn=C3=BCpfer?= Date: Sat, 13 Feb 2016 17:34:59 +0100 Subject: [PATCH] Revert "crc: rename checksum to CRC" This reverts commit 3f645884a44bc3dc32b04cc57e0803cf5e5e5884. --- sys/{crc => checksum}/Makefile | 0 sys/{crc => checksum}/crc16_ccitt.c | 4 ++-- sys/{crc => checksum}/doc.txt | 4 ++-- sys/include/{crc => checksum}/crc16_ccitt.h | 4 ++-- .../{tests-crc => tests-checksum}/Makefile | 0 tests/unittests/tests-checksum/Makefile.include | 1 + .../tests-checksum-crc16-ccitt.c} | 14 +++++++------- .../tests-checksum.c} | 6 +++--- .../tests-checksum.h} | 8 ++++---- tests/unittests/tests-crc/Makefile.include | 1 - 10 files changed, 21 insertions(+), 21 deletions(-) rename sys/{crc => checksum}/Makefile (100%) rename sys/{crc => checksum}/crc16_ccitt.c (97%) rename sys/{crc => checksum}/doc.txt (75%) rename sys/include/{crc => checksum}/crc16_ccitt.h (95%) rename tests/unittests/{tests-crc => tests-checksum}/Makefile (100%) create mode 100644 tests/unittests/tests-checksum/Makefile.include rename tests/unittests/{tests-crc/tests-crc-crc16-ccitt.c => tests-checksum/tests-checksum-crc16-ccitt.c} (89%) rename tests/unittests/{tests-crc/tests-crc.c => tests-checksum/tests-checksum.c} (70%) rename tests/unittests/{tests-crc/tests-crc.h => tests-checksum/tests-checksum.h} (79%) delete mode 100644 tests/unittests/tests-crc/Makefile.include diff --git a/sys/crc/Makefile b/sys/checksum/Makefile similarity index 100% rename from sys/crc/Makefile rename to sys/checksum/Makefile diff --git a/sys/crc/crc16_ccitt.c b/sys/checksum/crc16_ccitt.c similarity index 97% rename from sys/crc/crc16_ccitt.c rename to sys/checksum/crc16_ccitt.c index d22c25a1e4..a3fb59598c 100644 --- a/sys/crc/crc16_ccitt.c +++ b/sys/checksum/crc16_ccitt.c @@ -7,7 +7,7 @@ */ /** - * @ingroup sys_crc_crc16_ccitt + * @ingroup sys_checksum_crc16_ccitt * @{ * * @file @@ -21,7 +21,7 @@ #include #include -#include "crc/crc16_ccitt.h" +#include "checksum/crc16_ccitt.h" static const uint16_t _crc16_lookuptable[256] = { 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7, diff --git a/sys/crc/doc.txt b/sys/checksum/doc.txt similarity index 75% rename from sys/crc/doc.txt rename to sys/checksum/doc.txt index c2f42a7b6f..c3fc700e56 100644 --- a/sys/crc/doc.txt +++ b/sys/checksum/doc.txt @@ -7,7 +7,7 @@ */ /** - * @defgroup sys_crc CRC Cyclic redundancy checks + * @defgroup sys_checksum Checksum * @ingroup sys - * @brief CRC hashing functions + * @brief Checksum function libraries */ diff --git a/sys/include/crc/crc16_ccitt.h b/sys/include/checksum/crc16_ccitt.h similarity index 95% rename from sys/include/crc/crc16_ccitt.h rename to sys/include/checksum/crc16_ccitt.h index 04b29e5827..1eaded39aa 100644 --- a/sys/include/crc/crc16_ccitt.h +++ b/sys/include/checksum/crc16_ccitt.h @@ -7,8 +7,8 @@ */ /** - * @defgroup sys_crc_crc16_ccitt CRC16-CCITT - * @ingroup sys_crc + * @defgroup sys_checksum_crc16_ccitt CRC16-CCITT + * @ingroup sys_checksum * * @brief CRC16-CCITT checksum algorithm * @details This implementation of CRC16 is based on the CCITT diff --git a/tests/unittests/tests-crc/Makefile b/tests/unittests/tests-checksum/Makefile similarity index 100% rename from tests/unittests/tests-crc/Makefile rename to tests/unittests/tests-checksum/Makefile diff --git a/tests/unittests/tests-checksum/Makefile.include b/tests/unittests/tests-checksum/Makefile.include new file mode 100644 index 0000000000..5cbd968a58 --- /dev/null +++ b/tests/unittests/tests-checksum/Makefile.include @@ -0,0 +1 @@ +USEMODULE += checksum diff --git a/tests/unittests/tests-crc/tests-crc-crc16-ccitt.c b/tests/unittests/tests-checksum/tests-checksum-crc16-ccitt.c similarity index 89% rename from tests/unittests/tests-crc/tests-crc-crc16-ccitt.c rename to tests/unittests/tests-checksum/tests-checksum-crc16-ccitt.c index e8c5d82761..2159999eb4 100644 --- a/tests/unittests/tests-crc/tests-crc-crc16-ccitt.c +++ b/tests/unittests/tests-checksum/tests-checksum-crc16-ccitt.c @@ -10,9 +10,9 @@ #include "embUnit/embUnit.h" -#include "crc/crc16_ccitt.h" +#include "checksum/crc16_ccitt.h" -#include "tests-crc.h" +#include "tests-checksum.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_crc_crc16_ccitt_sequence(void) +static void test_checksum_crc16_ccitt_sequence(void) { /* Reference values according to * http://srecord.sourceforge.net/crc16-ccitt.html */ @@ -85,13 +85,13 @@ static void test_crc_crc16_ccitt_sequence(void) } } -Test *tests_crc_crc16_ccitt_tests(void) +Test *tests_checksum_crc16_ccitt_tests(void) { EMB_UNIT_TESTFIXTURES(fixtures) { - new_TestFixture(test_crc_crc16_ccitt_sequence), + new_TestFixture(test_checksum_crc16_ccitt_sequence), }; - EMB_UNIT_TESTCALLER(crc_crc16_ccitt_tests, NULL, NULL, fixtures); + EMB_UNIT_TESTCALLER(checksum_crc16_ccitt_tests, NULL, NULL, fixtures); - return (Test *)&crc_crc16_ccitt_tests; + return (Test *)&checksum_crc16_ccitt_tests; } diff --git a/tests/unittests/tests-crc/tests-crc.c b/tests/unittests/tests-checksum/tests-checksum.c similarity index 70% rename from tests/unittests/tests-crc/tests-crc.c rename to tests/unittests/tests-checksum/tests-checksum.c index 38376518fc..356c081ecf 100644 --- a/tests/unittests/tests-crc/tests-crc.c +++ b/tests/unittests/tests-checksum/tests-checksum.c @@ -6,9 +6,9 @@ * directory for more details. */ -#include "tests-crc.h" +#include "tests-checksum.h" -void tests_crc(void) +void tests_checksum(void) { - TESTS_RUN(tests_crc_crc16_ccitt_tests()); + TESTS_RUN(tests_checksum_crc16_ccitt_tests()); } diff --git a/tests/unittests/tests-crc/tests-crc.h b/tests/unittests/tests-checksum/tests-checksum.h similarity index 79% rename from tests/unittests/tests-crc/tests-crc.h rename to tests/unittests/tests-checksum/tests-checksum.h index 80b0ab3d5c..10c90e1366 100644 --- a/tests/unittests/tests-crc/tests-crc.h +++ b/tests/unittests/tests-checksum/tests-checksum.h @@ -11,7 +11,7 @@ * @{ * * @file - * @brief Unittests for the ``crc`` module + * @brief Unittests for the ``checksum`` module * * @author Ludwig Knüpfer */ @@ -28,14 +28,14 @@ extern "C" { /** * @brief The entry point of this test suite. */ -void tests_crc(void); +void tests_checksum(void); /** - * @brief Generates tests for crc/crc16_ccitt.h + * @brief Generates tests for checksum/crc16_ccitt.h * * @return embUnit tests if successful, NULL if not. */ -Test *tests_crc_crc16_ccitt_tests(void); +Test *tests_checksum_crc16_ccitt_tests(void); #ifdef __cplusplus } diff --git a/tests/unittests/tests-crc/Makefile.include b/tests/unittests/tests-crc/Makefile.include deleted file mode 100644 index 79a6daa4eb..0000000000 --- a/tests/unittests/tests-crc/Makefile.include +++ /dev/null @@ -1 +0,0 @@ -USEMODULE += crc