diff options
author | Andrey Fomichev <andrey.fomichev@gmail.com> | 2022-02-10 16:49:12 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:12 +0300 |
commit | e542cc14db4240643a06bb0dde87ecf361f101ab (patch) | |
tree | 3b03a4b94acd11a4eca042532035806e5fa08ad1 /library/cpp/sliding_window/sliding_window_ut.cpp | |
parent | e2ac73225f30f7fcf7df3cb225cba257f56144c1 (diff) | |
download | ydb-e542cc14db4240643a06bb0dde87ecf361f101ab.tar.gz |
Restoring authorship annotation for Andrey Fomichev <andrey.fomichev@gmail.com>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/sliding_window/sliding_window_ut.cpp')
-rw-r--r-- | library/cpp/sliding_window/sliding_window_ut.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/library/cpp/sliding_window/sliding_window_ut.cpp b/library/cpp/sliding_window/sliding_window_ut.cpp index 1e7343a8d3..d655f0bb0c 100644 --- a/library/cpp/sliding_window/sliding_window_ut.cpp +++ b/library/cpp/sliding_window/sliding_window_ut.cpp @@ -1,9 +1,9 @@ #include "sliding_window.h" #include <library/cpp/testing/unittest/registar.h> - + using namespace NSlidingWindow; - + Y_UNIT_TEST_SUITE(TSlidingWindowTest) { Y_UNIT_TEST(TestSlidingWindowMax) { TSlidingWindow<TMaxOperation<unsigned>> w(TDuration::Minutes(5), 5); @@ -29,7 +29,7 @@ Y_UNIT_TEST_SUITE(TSlidingWindowTest) { now += TDuration::Minutes(5); w.Update(1, now); // ~ 1 ~ ~ ~ UNIT_ASSERT_VALUES_EQUAL(w.GetValue(), 1); // ^ - + // update current bucket w.Update(2, now); // ~ 2 ~ ~ ~ UNIT_ASSERT_VALUES_EQUAL(w.GetValue(), 2); // ^ @@ -44,8 +44,8 @@ Y_UNIT_TEST_SUITE(TSlidingWindowTest) { now += TDuration::Minutes(5); // ~ ~ ~ ~ ~ UNIT_ASSERT_VALUES_EQUAL(w.Update(now), 0); - } - + } + Y_UNIT_TEST(TestSlidingWindowMin) { TSlidingWindow<TMinOperation<unsigned>> w(TDuration::Minutes(5), 5); TInstant start = TInstant::MicroSeconds(TDuration::Hours(1).MicroSeconds()); |