diff options
| author | lucius <[email protected]> | 2022-02-10 16:50:14 +0300 | 
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:50:14 +0300 | 
| commit | fcc260ce89e9b359b47474d8dfa6dfcb6aae3fe9 (patch) | |
| tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/cache/ut | |
| parent | 95ad0bd7bde5cd56bd6395ad6b7c47f0e73e4c99 (diff) | |
Restoring authorship annotation for <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/cache/ut')
| -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 cf2ea3eeab4..329872cfdee 100644 --- a/library/cpp/cache/ut/cache_ut.cpp +++ b/library/cpp/cache/ut/cache_ut.cpp @@ -2,12 +2,12 @@  #include <library/cpp/cache/thread_safe_cache.h>  #include <library/cpp/testing/unittest/registar.h> -struct TStrokaWeighter {  +struct TStrokaWeighter {      static size_t Weight(const TString& s) { -        return s.size();  -    }  -};  -  +        return s.size(); +    } +}; +  Y_UNIT_TEST_SUITE(TCacheTest) {      Y_UNIT_TEST(LRUListTest) {          typedef TLRUList<int, TString> TListType; @@ -88,32 +88,32 @@ Y_UNIT_TEST_SUITE(TCacheTest) {      Y_UNIT_TEST(LWListTest) {          typedef TLWList<int, TString, size_t, TStrokaWeighter> TListType;          TListType list(2); -  +          TListType::TItem x1(1, "tt");          list.Insert(&x1);          UNIT_ASSERT_EQUAL(list.GetLightest()->Key, 1);          UNIT_ASSERT_EQUAL(list.GetSize(), 1); -  +          TListType::TItem x2(2, "yyyy");          list.Insert(&x2);          UNIT_ASSERT_EQUAL(list.GetLightest()->Key, 1);          UNIT_ASSERT_EQUAL(list.GetSize(), 2); -  +          TListType::TItem x3(3, "z");          list.Insert(&x3);          UNIT_ASSERT_EQUAL(list.GetLightest()->Key, 1);          UNIT_ASSERT_EQUAL(list.GetSize(), 2); -  +          TListType::TItem x4(4, "xxxxxx");          list.Insert(&x4);          UNIT_ASSERT_EQUAL(list.GetLightest()->Key, 2);          UNIT_ASSERT_EQUAL(list.GetSize(), 2); -  +          list.Erase(&x2);          UNIT_ASSERT_EQUAL(list.GetLightest()->Key, 4);          UNIT_ASSERT_EQUAL(list.GetSize(), 1); -    }  -  +    } +      Y_UNIT_TEST(SimpleTest) {          typedef TLRUCache<int, TString> TCache;          TCache s(2); // size 2 | 
