aboutsummaryrefslogtreecommitdiffstats
path: root/util/generic
diff options
context:
space:
mode:
authorsvshevtsov <svshevtsov@yandex-team.ru>2022-02-10 16:49:37 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:49:37 +0300
commit657337012a264721d58c470b4e9e796611f3c492 (patch)
tree82753fd92cf7cc2dea4e522a945ed570131f920b /util/generic
parent44f31b316af517a4fbc6a82ebed8a1c51807deac (diff)
downloadydb-657337012a264721d58c470b4e9e796611f3c492.tar.gz
Restoring authorship annotation for <svshevtsov@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/generic')
-rw-r--r--util/generic/map_ut.cpp70
1 files changed, 35 insertions, 35 deletions
diff --git a/util/generic/map_ut.cpp b/util/generic/map_ut.cpp
index 79e832b024..c705c7d636 100644
--- a/util/generic/map_ut.cpp
+++ b/util/generic/map_ut.cpp
@@ -402,49 +402,49 @@ Y_UNIT_TEST_SUITE(TYMapTest) {
EmptyAndInsertTest<TMap<char, int, TLess<char>>>(std::pair<char, int>('a', 1));
EmptyAndInsertTest<TMultiMap<char, int, TLess<char>>>(std::pair<char, int>('a', 1));
}
-
- struct TParametrizedKeyCmp {
- bool Inverse;
-
- TParametrizedKeyCmp(bool inverse = false)
- : Inverse(inverse)
- {
- }
-
- bool operator()(TKey lhs, TKey rhs) const {
- if (Inverse) {
- return lhs.m_data > rhs.m_data;
- } else {
- return lhs.m_data < rhs.m_data;
- }
- }
- };
-
+
+ struct TParametrizedKeyCmp {
+ bool Inverse;
+
+ TParametrizedKeyCmp(bool inverse = false)
+ : Inverse(inverse)
+ {
+ }
+
+ bool operator()(TKey lhs, TKey rhs) const {
+ if (Inverse) {
+ return lhs.m_data > rhs.m_data;
+ } else {
+ return lhs.m_data < rhs.m_data;
+ }
+ }
+ };
+
Y_UNIT_TEST(TestMoveComparator) {
using Container = TMultiMap<TKey, int, TParametrizedKeyCmp>;
-
- TParametrizedKeyCmp direct(false);
- TParametrizedKeyCmp inverse(true);
-
- {
- Container c(direct);
- c = Container(inverse);
-
+
+ TParametrizedKeyCmp direct(false);
+ TParametrizedKeyCmp inverse(true);
+
+ {
+ Container c(direct);
+ c = Container(inverse);
+
c.insert(std::make_pair(TKey(1), 101));
c.insert(std::make_pair(TKey(2), 102));
c.insert(std::make_pair(TKey(3), 103));
-
+
TVector<int> values;
for (auto& i : c) {
values.push_back(i.second);
- }
-
- UNIT_ASSERT_VALUES_EQUAL(values.size(), 3);
- UNIT_ASSERT_VALUES_EQUAL(values[0], 103);
- UNIT_ASSERT_VALUES_EQUAL(values[1], 102);
- UNIT_ASSERT_VALUES_EQUAL(values[2], 101);
- }
- }
+ }
+
+ UNIT_ASSERT_VALUES_EQUAL(values.size(), 3);
+ UNIT_ASSERT_VALUES_EQUAL(values[0], 103);
+ UNIT_ASSERT_VALUES_EQUAL(values[1], 102);
+ UNIT_ASSERT_VALUES_EQUAL(values[2], 101);
+ }
+ }
Y_UNIT_TEST(TestMapInitializerList) {
TMap<TString, int> m = {