diff options
author | nga <nga@yandex-team.ru> | 2022-02-10 16:48:09 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:48:09 +0300 |
commit | c2a1af049e9deca890e9923abe64fe6c59060348 (patch) | |
tree | b222e5ac2e2e98872661c51ccceee5da0d291e13 /library/cpp/messagebus/async_result_ut.cpp | |
parent | 1f553f46fb4f3c5eec631352cdd900a0709016af (diff) | |
download | ydb-c2a1af049e9deca890e9923abe64fe6c59060348.tar.gz |
Restoring authorship annotation for <nga@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/messagebus/async_result_ut.cpp')
-rw-r--r-- | library/cpp/messagebus/async_result_ut.cpp | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/library/cpp/messagebus/async_result_ut.cpp b/library/cpp/messagebus/async_result_ut.cpp index 93f010d1f5..2e96492afd 100644 --- a/library/cpp/messagebus/async_result_ut.cpp +++ b/library/cpp/messagebus/async_result_ut.cpp @@ -1,37 +1,37 @@ - + #include <library/cpp/testing/unittest/registar.h> - -#include "async_result.h" - -namespace { - void SetValue(int* location, const int& value) { - *location = value; - } - -} - + +#include "async_result.h" + +namespace { + void SetValue(int* location, const int& value) { + *location = value; + } + +} + Y_UNIT_TEST_SUITE(TAsyncResult) { Y_UNIT_TEST(AndThen_Here) { - TAsyncResult<int> r; - - int var = 1; - - r.SetResult(17); - + TAsyncResult<int> r; + + int var = 1; + + r.SetResult(17); + r.AndThen(std::bind(&SetValue, &var, std::placeholders::_1)); - - UNIT_ASSERT_VALUES_EQUAL(17, var); - } - + + UNIT_ASSERT_VALUES_EQUAL(17, var); + } + Y_UNIT_TEST(AndThen_Later) { - TAsyncResult<int> r; - - int var = 1; - + TAsyncResult<int> r; + + int var = 1; + r.AndThen(std::bind(&SetValue, &var, std::placeholders::_1)); - - r.SetResult(17); - - UNIT_ASSERT_VALUES_EQUAL(17, var); - } -} + + r.SetResult(17); + + UNIT_ASSERT_VALUES_EQUAL(17, var); + } +} |