Skip to content

Commit 23ba4bc

Browse files
authored
Issue #180 Fix src/library/digest/lower_case tests (#240)
1 parent aa27d9c commit 23ba4bc

File tree

7 files changed

+26
-12
lines changed

7 files changed

+26
-12
lines changed

src/library/digest/lower_case/hash_ops.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include <ydb-cpp-sdk/util/generic/algorithm.h>
66

77
size_t TCIOps::operator()(const std::string_view& s) const noexcept {
8-
return FnvCaseLess(s, (size_t)0xBEE);
8+
return FnvCaseLess(s, size_t{0xBEE});
99
}
1010

1111
size_t TCIOps::operator()(const char* s) const noexcept {

src/library/digest/lower_case/hash_ops.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#include <string_view>
44

5-
// can be used for caseless hashes like: THashMap<std::string_view, T, TCIOps, TCIOps>
5+
// can be used for caseless hashes like: std::unordered_map<std::string_view, T, TCIOps, TCIOps>
66

77
struct TCIOps {
88
size_t operator()(const char* s) const noexcept;

src/library/digest/lower_case/ut/ya.make

Lines changed: 0 additions & 8 deletions
This file was deleted.

tests/library/digest/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
add_subdirectory(lower_case)
12
add_subdirectory(md5)
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
add_ydb_test(NAME library-digest-lower_case-hash_ops_ut
2+
SOURCES
3+
hash_ops_ut.cpp
4+
INCLUDE_DIRS
5+
${YDB_SDK_SOURCE_DIR}/src/library/digest/lower_case
6+
LINK_LIBRARIES
7+
cpp-digest-lower_case
8+
cpp-testing-unittest_main
9+
)
10+
11+
add_ydb_test(NAME library-digest-lower_case-lchash_ut
12+
SOURCES
13+
lchash_ut.cpp
14+
INCLUDE_DIRS
15+
${YDB_SDK_SOURCE_DIR}/src/library/digest/lower_case
16+
LINK_LIBRARIES
17+
cpp-digest-lower_case
18+
cpp-testing-unittest_main
19+
)

src/library/digest/lower_case/hash_ops_ut.cpp renamed to tests/library/digest/lower_case/hash_ops_ut.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
#include <src/library/testing/unittest/registar.h>
44

5+
#include <unordered_map>
6+
57
Y_UNIT_TEST_SUITE(TestCIHash) {
68
Y_UNIT_TEST(TestYHash1) {
7-
THashMap<std::string_view, int, TCIOps, TCIOps> h;
9+
std::unordered_map<std::string_view, int, TCIOps, TCIOps> h;
810

911
h["Ab"] = 1;
1012
h["aB"] = 2;
@@ -14,7 +16,7 @@ Y_UNIT_TEST_SUITE(TestCIHash) {
1416
}
1517

1618
Y_UNIT_TEST(TestYHash2) {
17-
THashMap<const char*, int, TCIOps, TCIOps> h;
19+
std::unordered_map<const char*, int, TCIOps, TCIOps> h;
1820

1921
h["Ab"] = 1;
2022
h["aB"] = 2;

0 commit comments

Comments
 (0)