aboutsummaryrefslogtreecommitdiffstats
path: root/util/generic/hash_ut.cpp
diff options
context:
space:
mode:
authoreeight <eeight@yandex-team.ru>2022-02-10 16:46:18 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:18 +0300
commit475c0a46f28166e83fd263badc7546377cddcabe (patch)
tree39c5a49b8aaad78fe390b6f1f2886bdbda40f3e7 /util/generic/hash_ut.cpp
parenta6e0145a095c7bb3770d6e07aee301de5c73f96e (diff)
downloadydb-475c0a46f28166e83fd263badc7546377cddcabe.tar.gz
Restoring authorship annotation for <eeight@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/generic/hash_ut.cpp')
-rw-r--r--util/generic/hash_ut.cpp42
1 files changed, 21 insertions, 21 deletions
diff --git a/util/generic/hash_ut.cpp b/util/generic/hash_ut.cpp
index 0551d58770..5804a53dca 100644
--- a/util/generic/hash_ut.cpp
+++ b/util/generic/hash_ut.cpp
@@ -177,9 +177,9 @@ void THashTest::TestHMap1() {
m['x'] = "10"; // Correct mistake.
UNIT_ASSERT(!strcmp(m['x'].c_str(), "10"));
- UNIT_ASSERT(!m.contains('z'));
+ UNIT_ASSERT(!m.contains('z'));
UNIT_ASSERT(!strcmp(m['z'].c_str(), ""));
- UNIT_ASSERT(m.contains('z'));
+ UNIT_ASSERT(m.contains('z'));
UNIT_ASSERT(m.count('z') == 1);
auto p = m.insert(std::pair<const char, TString>('c', TString("100")));
@@ -377,34 +377,34 @@ void THashTest::TestHSetConstructorsAndAssignments() {
UNIT_ASSERT_VALUES_EQUAL(2, c1.size());
UNIT_ASSERT_VALUES_EQUAL(2, c2.size());
- UNIT_ASSERT(c1.contains(100));
- UNIT_ASSERT(c2.contains(200));
+ UNIT_ASSERT(c1.contains(100));
+ UNIT_ASSERT(c2.contains(200));
container c3(std::move(c1));
UNIT_ASSERT_VALUES_EQUAL(0, c1.size());
UNIT_ASSERT_VALUES_EQUAL(2, c3.size());
- UNIT_ASSERT(c3.contains(100));
+ UNIT_ASSERT(c3.contains(100));
c2.insert(300);
c3 = c2;
UNIT_ASSERT_VALUES_EQUAL(3, c2.size());
UNIT_ASSERT_VALUES_EQUAL(3, c3.size());
- UNIT_ASSERT(c3.contains(300));
+ UNIT_ASSERT(c3.contains(300));
c2.insert(400);
c3 = std::move(c2);
UNIT_ASSERT_VALUES_EQUAL(0, c2.size());
UNIT_ASSERT_VALUES_EQUAL(4, c3.size());
- UNIT_ASSERT(c3.contains(400));
+ UNIT_ASSERT(c3.contains(400));
container c4 = {1, 2, 3};
UNIT_ASSERT_VALUES_EQUAL(c4.size(), 3);
- UNIT_ASSERT(c4.contains(1));
- UNIT_ASSERT(c4.contains(2));
- UNIT_ASSERT(c4.contains(3));
+ UNIT_ASSERT(c4.contains(1));
+ UNIT_ASSERT(c4.contains(2));
+ UNIT_ASSERT(c4.contains(3));
}
void THashTest::TestHSetSize() {
@@ -1010,31 +1010,31 @@ void THashTest::TestHMMapEmplaceDirect() {
void THashTest::TestHSetEmplace() {
using hash_t = THashSet<TNonCopyableInt<0>, THash<int>, TEqualTo<int>>;
hash_t hash;
- UNIT_ASSERT(!hash.contains(0));
+ UNIT_ASSERT(!hash.contains(0));
hash.emplace(0);
- UNIT_ASSERT(hash.contains(0));
- UNIT_ASSERT(!hash.contains(1));
+ UNIT_ASSERT(hash.contains(0));
+ UNIT_ASSERT(!hash.contains(1));
}
void THashTest::TestHSetEmplaceNoresize() {
using hash_t = THashSet<TNonCopyableInt<0>, THash<int>, TEqualTo<int>>;
hash_t hash;
hash.reserve(1);
- UNIT_ASSERT(!hash.contains(0));
+ UNIT_ASSERT(!hash.contains(0));
hash.emplace_noresize(0);
- UNIT_ASSERT(hash.contains(0));
- UNIT_ASSERT(!hash.contains(1));
+ UNIT_ASSERT(hash.contains(0));
+ UNIT_ASSERT(!hash.contains(1));
}
void THashTest::TestHSetEmplaceDirect() {
using hash_t = THashSet<TNonCopyableInt<0>, THash<int>, TEqualTo<int>>;
hash_t hash;
- UNIT_ASSERT(!hash.contains(0));
+ UNIT_ASSERT(!hash.contains(0));
hash_t::insert_ctx ins;
hash.find(0, ins);
hash.emplace_direct(ins, 1);
- UNIT_ASSERT(hash.contains(0));
- UNIT_ASSERT(!hash.contains(1));
+ UNIT_ASSERT(hash.contains(0));
+ UNIT_ASSERT(!hash.contains(1));
}
void THashTest::TestNonCopyable() {
@@ -1100,8 +1100,8 @@ void THashTest::TestReleaseNodes() {
set.insert(i);
}
UNIT_ASSERT_VALUES_EQUAL(counters.Allocations, 7);
- UNIT_ASSERT(set.contains(10));
- UNIT_ASSERT(!set.contains(0));
+ UNIT_ASSERT(set.contains(10));
+ UNIT_ASSERT(!set.contains(0));
set.basic_clear();
UNIT_ASSERT_VALUES_EQUAL(counters.Deallocations, 3);