diff options
author | gleb-kov <gleb-kov@yandex-team.ru> | 2022-02-18 11:43:49 +0300 |
---|---|---|
committer | gleb-kov <gleb-kov@yandex-team.ru> | 2022-02-18 11:43:49 +0300 |
commit | f7134d2525269ea8412b3bf0736239fbfd545a2e (patch) | |
tree | e1e6a227e5732fcf865f13fc5d7a4ff276e2971a | |
parent | af118429225479ca21bc858033203e67c0c066e3 (diff) | |
download | ydb-f7134d2525269ea8412b3bf0736239fbfd545a2e.tar.gz |
introduce util/digest/city_ut.cpp
ref:2bd6e26cda5245c96d0b2f3c326dd13e0827c326
-rw-r--r-- | util/digest/city.cpp | 10 | ||||
-rw-r--r-- | util/digest/city_ut.cpp | 15 | ||||
-rw-r--r-- | util/digest/ut/ya.make | 3 |
3 files changed, 17 insertions, 11 deletions
diff --git a/util/digest/city.cpp b/util/digest/city.cpp index c25f175d54..a1436a47e0 100644 --- a/util/digest/city.cpp +++ b/util/digest/city.cpp @@ -310,14 +310,4 @@ uint128 CityHash128(const char* s, size_t len) noexcept { } } -// TODO(yazevnul): move this function to unittests -void TestCompilationOfCityHashTemplates() { - TStringBuf s; - CityHash64(s); - CityHash64WithSeed(s, 1); - CityHash64WithSeeds(s, 1, 2); - CityHash128(s); - CityHash128WithSeed(s, uint128(1, 2)); -} - #endif diff --git a/util/digest/city_ut.cpp b/util/digest/city_ut.cpp new file mode 100644 index 0000000000..fdd2dab8ea --- /dev/null +++ b/util/digest/city_ut.cpp @@ -0,0 +1,15 @@ +#include "city.h" + +#include <library/cpp/testing/unittest/registar.h> + +Y_UNIT_TEST_SUITE(TCityTest) { + Y_UNIT_TEST(TestTemplatesCompiling) { + TStringBuf s; + CityHash64(s); + CityHash64WithSeed(s, 1); + CityHash64WithSeeds(s, 1, 2); + CityHash128(s); + CityHash128WithSeed(s, uint128(1, 2)); + UNIT_ASSERT(s.empty()); + } +}; diff --git a/util/digest/ut/ya.make b/util/digest/ut/ya.make index 245b2cf6d2..4cd8e95857 100644 --- a/util/digest/ut/ya.make +++ b/util/digest/ut/ya.make @@ -4,9 +4,10 @@ OWNER(g:util) SUBSCRIBER(g:util-subscribers) SRCS( + digest/city_ut.cpp digest/fnv_ut.cpp - digest/murmur_ut.cpp digest/multi_ut.cpp + digest/murmur_ut.cpp digest/sequence_ut.cpp ) |