diff options
author | kimkim <kimkim@yandex-team.ru> | 2022-02-10 16:49:27 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:27 +0300 |
commit | 13f84424ed9975f6827d9786087c6fe6ea265cda (patch) | |
tree | b94acc282c49a5de96b9e3e19feead21736f3273 /util/system/guard_ut.cpp | |
parent | 35f29a67a6b8e50e1826c837330086049114c5ba (diff) | |
download | ydb-13f84424ed9975f6827d9786087c6fe6ea265cda.tar.gz |
Restoring authorship annotation for <kimkim@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/system/guard_ut.cpp')
-rw-r--r-- | util/system/guard_ut.cpp | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/util/system/guard_ut.cpp b/util/system/guard_ut.cpp index 404ede99ab..e5901d1c8e 100644 --- a/util/system/guard_ut.cpp +++ b/util/system/guard_ut.cpp @@ -2,11 +2,11 @@ #include "rwlock.h" #include <library/cpp/testing/unittest/registar.h> - + #include <util/thread/pool.h> - + struct TTestGuard: public TTestBase { - UNIT_TEST_SUITE(TTestGuard); + UNIT_TEST_SUITE(TTestGuard); UNIT_TEST(TestGuard) UNIT_TEST(TestTryGuard) UNIT_TEST(TestMove) @@ -15,20 +15,20 @@ struct TTestGuard: public TTestBase { UNIT_TEST(TestTryReadGuard) UNIT_TEST(TestWithLock) UNIT_TEST(TestWithLockScope); - UNIT_TEST_SUITE_END(); - - struct TGuardChecker { - TGuardChecker() - : guarded(false) - { - } - - void Acquire() { - guarded = true; - } - void Release() { - guarded = false; - } + UNIT_TEST_SUITE_END(); + + struct TGuardChecker { + TGuardChecker() + : guarded(false) + { + } + + void Acquire() { + guarded = true; + } + void Release() { + guarded = false; + } bool TryAcquire() { if (guarded) { return false; @@ -37,10 +37,10 @@ struct TTestGuard: public TTestBase { return true; } } - - bool guarded; - }; - + + bool guarded; + }; + void TestUnguard() { TGuardChecker m; @@ -101,16 +101,16 @@ struct TTestGuard: public TTestBase { UNIT_ASSERT_VALUES_EQUAL(n, 1); } - void TestGuard() { - TGuardChecker checker; - - UNIT_ASSERT(!checker.guarded); - { - TGuard<TGuardChecker> guard(checker); - UNIT_ASSERT(checker.guarded); - } - UNIT_ASSERT(!checker.guarded); - } + void TestGuard() { + TGuardChecker checker; + + UNIT_ASSERT(!checker.guarded); + { + TGuard<TGuardChecker> guard(checker); + UNIT_ASSERT(checker.guarded); + } + UNIT_ASSERT(!checker.guarded); + } void TestTryGuard() { TGuardChecker checker; @@ -175,6 +175,6 @@ struct TTestGuard: public TTestBase { Y_UNUSED(Guard); } } -}; - -UNIT_TEST_SUITE_REGISTRATION(TTestGuard) +}; + +UNIT_TEST_SUITE_REGISTRATION(TTestGuard) |