aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/cache/ut/cache_ut.cpp
diff options
context:
space:
mode:
authorvskipin <vskipin@yandex-team.ru>2022-02-10 16:46:00 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:00 +0300
commit4d8b546b89b5afc08cf3667e176271c7ba935f33 (patch)
tree1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /library/cpp/cache/ut/cache_ut.cpp
parent4e4b78bd7b67e2533da4dbb9696374a6d6068e32 (diff)
downloadydb-4d8b546b89b5afc08cf3667e176271c7ba935f33.tar.gz
Restoring authorship annotation for <vskipin@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/cache/ut/cache_ut.cpp')
-rw-r--r--library/cpp/cache/ut/cache_ut.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/library/cpp/cache/ut/cache_ut.cpp b/library/cpp/cache/ut/cache_ut.cpp
index 96fabc10d7..329872cfde 100644
--- a/library/cpp/cache/ut/cache_ut.cpp
+++ b/library/cpp/cache/ut/cache_ut.cpp
@@ -12,23 +12,23 @@ Y_UNIT_TEST_SUITE(TCacheTest) {
Y_UNIT_TEST(LRUListTest) {
typedef TLRUList<int, TString> TListType;
TListType list(2);
-
+
TListType::TItem x1(1, "ttt");
list.Insert(&x1);
UNIT_ASSERT_EQUAL(list.GetOldest()->Key, 1);
-
+
TListType::TItem x2(2, "yyy");
list.Insert(&x2);
UNIT_ASSERT_EQUAL(list.GetOldest()->Key, 1);
-
+
list.Promote(list.GetOldest());
UNIT_ASSERT_EQUAL(list.GetOldest()->Key, 2);
-
+
TListType::TItem x3(3, "zzz");
list.Insert(&x3);
UNIT_ASSERT_EQUAL(list.GetOldest()->Key, 1);
- }
-
+ }
+
Y_UNIT_TEST(LRUListWeightedTest) {
typedef TLRUList<int, TString, size_t (*)(const TString&)> TListType;
TListType list(7, [](auto& string) {
@@ -68,23 +68,23 @@ Y_UNIT_TEST_SUITE(TCacheTest) {
Y_UNIT_TEST(LFUListTest) {
typedef TLFUList<int, TString> TListType;
TListType list(2);
-
+
TListType::TItem x1(1, "ttt");
list.Insert(&x1);
UNIT_ASSERT_EQUAL(list.GetLeastFrequentlyUsed()->Key, 1);
-
+
TListType::TItem x2(2, "yyy");
list.Insert(&x2);
UNIT_ASSERT_EQUAL(list.GetLeastFrequentlyUsed()->Key, 1);
-
+
list.Promote(list.GetLeastFrequentlyUsed());
UNIT_ASSERT_EQUAL(list.GetLeastFrequentlyUsed()->Key, 2);
-
+
TListType::TItem x3(3, "zzz");
list.Insert(&x3);
UNIT_ASSERT_EQUAL(list.GetLeastFrequentlyUsed()->Key, 1);
- }
-
+ }
+
Y_UNIT_TEST(LWListTest) {
typedef TLWList<int, TString, size_t, TStrokaWeighter> TListType;
TListType list(2);