diff options
author | vskipin <vskipin@yandex-team.ru> | 2022-02-10 16:46:00 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:00 +0300 |
commit | 4e4b78bd7b67e2533da4dbb9696374a6d6068e32 (patch) | |
tree | a7a5543d815c451256ece74081d960b4e1d70ec2 /library/cpp/cache/ut/cache_ut.cpp | |
parent | 5b00ed04a5137a452fa6d3423cb0c9b54ac27408 (diff) | |
download | ydb-4e4b78bd7b67e2533da4dbb9696374a6d6068e32.tar.gz |
Restoring authorship annotation for <vskipin@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/cache/ut/cache_ut.cpp')
-rw-r--r-- | library/cpp/cache/ut/cache_ut.cpp | 24 |
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 329872cfde..96fabc10d7 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); |