diff options
author | sharpeye <sharpeye@yandex-team.ru> | 2022-02-10 16:49:16 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:16 +0300 |
commit | 9a407601824f50398148409237b90de3f95b5ae3 (patch) | |
tree | b5245ea2b5ed12d65fe1230d5f6dae0b9b129894 /util/generic/scope_ut.cpp | |
parent | 1c61afbf3db63940d05e6fefa3104b03457788a1 (diff) | |
download | ydb-9a407601824f50398148409237b90de3f95b5ae3.tar.gz |
Restoring authorship annotation for <sharpeye@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/generic/scope_ut.cpp')
-rw-r--r-- | util/generic/scope_ut.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/util/generic/scope_ut.cpp b/util/generic/scope_ut.cpp index bdb434d487..62547f0b1d 100644 --- a/util/generic/scope_ut.cpp +++ b/util/generic/scope_ut.cpp @@ -8,30 +8,30 @@ Y_UNIT_TEST_SUITE(ScopeToolsTest) { int i = 0; { - Y_SCOPE_EXIT(&i) { - i = i * 2; - }; - - Y_SCOPE_EXIT(&i) { - i = i + 1; - }; + Y_SCOPE_EXIT(&i) { + i = i * 2; + }; + + Y_SCOPE_EXIT(&i) { + i = i + 1; + }; } UNIT_ASSERT_VALUES_EQUAL(2, i); } - + Y_UNIT_TEST(OnScopeExitMoveTest) { THolder<int> i{new int{10}}; - int p = 0; - - { - Y_SCOPE_EXIT(i = std::move(i), &p) { - p = *i * 2; - }; - } - - UNIT_ASSERT_VALUES_EQUAL(20, p); - } + int p = 0; + + { + Y_SCOPE_EXIT(i = std::move(i), &p) { + p = *i * 2; + }; + } + + UNIT_ASSERT_VALUES_EQUAL(20, p); + } Y_UNIT_TEST(TestDefer) { int i = 0; |