diff --git a/sys/hash_string/Makefile b/sys/hash_string/Makefile deleted file mode 100644 index 48422e909a47d7cd428d10fa73825060ccc8d8c2..0000000000000000000000000000000000000000 --- a/sys/hash_string/Makefile +++ /dev/null @@ -1 +0,0 @@ -include $(RIOTBASE)/Makefile.base diff --git a/sys/hash_string/hash_string.c b/sys/hash_string/hash_string.c deleted file mode 100644 index a23d194e55060ed7e92f386b03d048cefdca586e..0000000000000000000000000000000000000000 --- a/sys/hash_string/hash_string.c +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2013 Kaspar Schleiser <kaspar@schleiser.de> - * - * This file is subject to the terms and conditions of the GNU Lesser - * General Public License v2.1. See the file LICENSE in the top level - * directory for more details. - */ - -/** - * @defgroup sys_hash_string - * @ingroup sys - * - * @brief Hash string implementation - * - * @{ - * @file - * @author Kaspar Schleiser <kaspar@schleiser.de> - * @} - */ - -#include <string.h> -#include "hash_string.h" - -unsigned long hash_string(unsigned char *str) -{ - unsigned long hash = 5381; - int c; - - while ((c = *str++)) { - hash = ((hash << 5) + hash) + c; /* hash * 33 + c */ - } - - return hash; -} - -int cmp_string(char *a, char *b) -{ - return (strcmp(a, b) == 0); -} diff --git a/sys/include/hash_string.h b/sys/include/hash_string.h deleted file mode 100644 index d65dedd8ca128c2a2901fc98a7bb57feeec7ac7e..0000000000000000000000000000000000000000 --- a/sys/include/hash_string.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2010 Kaspar Schleiser - * - * This file is subject to the terms and conditions of the GNU Lesser - * General Public License v2.1. See the file LICENSE in the top level - * directory for more details. - */ - -#ifndef __HASH_STRING_H -#define __HASH_STRING_H - -#ifdef __cplusplus -extern "C" { -#endif - -unsigned long hash_string(unsigned char *str); -int cmp_string(char *a, char *b); - -#ifdef __cplusplus -} -#endif - -#endif /* __HASH_STRING_H */ diff --git a/tests/unittests/tests-hash_string/Makefile b/tests/unittests/tests-hash_string/Makefile deleted file mode 100644 index 48422e909a47d7cd428d10fa73825060ccc8d8c2..0000000000000000000000000000000000000000 --- a/tests/unittests/tests-hash_string/Makefile +++ /dev/null @@ -1 +0,0 @@ -include $(RIOTBASE)/Makefile.base diff --git a/tests/unittests/tests-hash_string/Makefile.include b/tests/unittests/tests-hash_string/Makefile.include deleted file mode 100644 index f00ccb4f5b4193e97661dfafd527136483843f7c..0000000000000000000000000000000000000000 --- a/tests/unittests/tests-hash_string/Makefile.include +++ /dev/null @@ -1 +0,0 @@ -USEMODULE += hash_string diff --git a/tests/unittests/tests-hash_string/tests-hash_string.c b/tests/unittests/tests-hash_string/tests-hash_string.c deleted file mode 100644 index 13b292dfbcabef8de4773be26cce793f238cf2e5..0000000000000000000000000000000000000000 --- a/tests/unittests/tests-hash_string/tests-hash_string.c +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2015 Kushal Singh <kushal.spiderman.singh@gmail.com> - * - * This file is subject to the terms and conditions of the GNU Lesser - * General Public License v2.1. See the file LICENSE in the top level - * directory for more details. - */ - -#include "tests-hash_string.h" -#include "hash_string.h" - -static void test_hash_value(void) -{ - TEST_ASSERT_EQUAL_INT(177621, hash_string((unsigned char *)"0")); - TEST_ASSERT_EQUAL_INT(685012521, hash_string((unsigned char *)"0123456789ab" - "cde-0123456789abcde-0123456789" - "abcde-0123456789abcde-")); - TEST_ASSERT_EQUAL_INT(900068641, hash_string((unsigned char *)"Frank jagt " - "im komplett verwahrlosten Taxi" - " quer durch Bayern")); - TEST_ASSERT_EQUAL_INT(1857959484, hash_string((unsigned char *)"12A5B6cd_")); - TEST_ASSERT_EQUAL_INT(5381, hash_string((unsigned char *)"")); -} - -Test *tests_hash_string_tests(void) -{ - EMB_UNIT_TESTFIXTURES(fixtures) { - new_TestFixture(test_hash_value), - }; - - EMB_UNIT_TESTCALLER(hash_string_tests, NULL, NULL, fixtures); - - return (Test *)&hash_string_tests; -} - -void tests_hash_string(void) -{ - TESTS_RUN(tests_hash_string_tests()); -} diff --git a/tests/unittests/tests-hash_string/tests-hash_string.h b/tests/unittests/tests-hash_string/tests-hash_string.h deleted file mode 100644 index 75cb503c4720a26af2e16e9ba3cc6d1244baf624..0000000000000000000000000000000000000000 --- a/tests/unittests/tests-hash_string/tests-hash_string.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (C) 2015 Kushal Singh <kushal.spiderman.singh@gmail.com> - * - * This file is subject to the terms and conditions of the GNU Lesser - * General Public License v2.1. See the file LICENSE in the top level - * directory for more details. - */ - -/** - * @addtogroup unittests - * @{ - * - * @file - * @brief Unittests for the ``hash_string`` module - * - * @author Kushal Singh <kushal.spiderman.singh@gmail.com> - */ -#ifndef TESTS_HASH_STRING_H_ -#define TESTS_HASH_STRING_H_ - -#include "embUnit.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief The entry point of this test suite. - */ -void tests_hash_string(void); - -/** - * @brief Generates tests for hash_string - * - * @return embUnit tests if successful, NULL if not. - */ -Test *tests_hash_string_tests(void); - -#ifdef __cplusplus -} -#endif - -#endif /* TESTS_HASH_STRING_H_ */ -/** @} */