diff options
author | breakneck <[email protected]> | 2022-02-10 16:47:58 +0300 |
---|---|---|
committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:47:58 +0300 |
commit | f860932520ce9bc8540a3c19e84c0109c3437dc5 (patch) | |
tree | c0748b5dcbade83af788c0abfa89c0383d6b779c /util/digest/murmur_ut.cpp | |
parent | e2021f9a0e54d13b7c48796318b13b66dc625e74 (diff) |
Restoring authorship annotation for <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'util/digest/murmur_ut.cpp')
-rw-r--r-- | util/digest/murmur_ut.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/util/digest/murmur_ut.cpp b/util/digest/murmur_ut.cpp index 4f763ba366d..29287668bc4 100644 --- a/util/digest/murmur_ut.cpp +++ b/util/digest/murmur_ut.cpp @@ -9,7 +9,7 @@ class TMurmurHashTest: public TTestBase { UNIT_TEST(TestUnalignedHash32) UNIT_TEST(TestHash64) UNIT_TEST(TestUnalignedHash64) - UNIT_TEST(TestWrapperBiggerTypes) + UNIT_TEST(TestWrapperBiggerTypes) UNIT_TEST_SUITE_END(); private: @@ -21,7 +21,7 @@ private: } Test<ui32>(buf, 256, 2373126550UL); - TestWrapper<ui8, ui32>({buf, buf + 256}, 2373126550UL); + TestWrapper<ui8, ui32>({buf, buf + 256}, 2373126550UL); Test<ui32>(buf, 255, 3301607533UL); Test<ui32>(buf, 254, 2547410121UL); Test<ui32>(buf, 253, 80030810UL); @@ -46,7 +46,7 @@ private: } Test<ui64>(buf, 256, ULL(12604435678857905857)); - TestWrapper<ui8, ui64>({buf, buf + 256}, ULL(12604435678857905857)); + TestWrapper<ui8, ui64>({buf, buf + 256}, ULL(12604435678857905857)); Test<ui64>(buf, 255, ULL(1708835094528446095)); Test<ui64>(buf, 254, ULL(5077937678736514994)); Test<ui64>(buf, 253, ULL(11553864555081396353)); @@ -63,23 +63,23 @@ private: Test<ui64>(unalignedBuf, 256, ULL(12604435678857905857)); } - inline void TestWrapperBiggerTypes() { - ui32 buf[] = {24, 42}; - TestWrapper<ui32, ui32>({buf, buf + 2}, MurmurHash<ui32>(buf, sizeof(ui32) * 2)); - TestWrapper<ui32, ui64>({buf, buf + 2}, MurmurHash<ui64>(buf, sizeof(ui32) * 2)); - } - + inline void TestWrapperBiggerTypes() { + ui32 buf[] = {24, 42}; + TestWrapper<ui32, ui32>({buf, buf + 2}, MurmurHash<ui32>(buf, sizeof(ui32) * 2)); + TestWrapper<ui32, ui64>({buf, buf + 2}, MurmurHash<ui64>(buf, sizeof(ui32) * 2)); + } + private: template <class T> inline void Test(const void* data, size_t len, T expected) { UNIT_ASSERT_STRINGS_EQUAL(ToString(MurmurHash<T>(data, len)), ToString(expected)); } - - template <class E, class T> + + template <class E, class T> inline void TestWrapper(const TArrayRef<E>& array, T expected) { - auto val = TMurmurHash<T>()(array); - UNIT_ASSERT_EQUAL(val, expected); - } + auto val = TMurmurHash<T>()(array); + UNIT_ASSERT_EQUAL(val, expected); + } }; UNIT_TEST_SUITE_REGISTRATION(TMurmurHashTest); |