aboutsummaryrefslogtreecommitdiffstats
path: root/util/system
diff options
context:
space:
mode:
authorSergey Polovko <sergey@polovko.me>2022-02-10 16:47:02 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:47:02 +0300
commit3e0b762a82514bac89c1dd6ea7211e381d8aa248 (patch)
treec2d1b379ecaf05ca8f11ed0b5da9d1a950e6e554 /util/system
parentab3783171cc30e262243a0227c86118f7080c896 (diff)
downloadydb-3e0b762a82514bac89c1dd6ea7211e381d8aa248.tar.gz
Restoring authorship annotation for Sergey Polovko <sergey@polovko.me>. Commit 1 of 2.
Diffstat (limited to 'util/system')
-rw-r--r--util/system/guard_ut.cpp36
-rw-r--r--util/system/mem_info_ut.cpp4
2 files changed, 20 insertions, 20 deletions
diff --git a/util/system/guard_ut.cpp b/util/system/guard_ut.cpp
index 404ede99ab..cab4ca9e37 100644
--- a/util/system/guard_ut.cpp
+++ b/util/system/guard_ut.cpp
@@ -13,7 +13,7 @@ struct TTestGuard: public TTestBase {
UNIT_TEST(TestSync)
UNIT_TEST(TestUnguard)
UNIT_TEST(TestTryReadGuard)
- UNIT_TEST(TestWithLock)
+ UNIT_TEST(TestWithLock)
UNIT_TEST(TestWithLockScope);
UNIT_TEST_SUITE_END();
@@ -119,11 +119,11 @@ struct TTestGuard: public TTestBase {
{
TTryGuard<TGuardChecker> guard(checker);
UNIT_ASSERT(checker.guarded);
- UNIT_ASSERT(guard.WasAcquired());
- {
+ UNIT_ASSERT(guard.WasAcquired());
+ {
TTryGuard<TGuardChecker> guard2(checker);
UNIT_ASSERT(checker.guarded);
- UNIT_ASSERT(!guard2.WasAcquired());
+ UNIT_ASSERT(!guard2.WasAcquired());
}
UNIT_ASSERT(checker.guarded);
}
@@ -152,21 +152,21 @@ struct TTestGuard: public TTestBase {
TTryReadGuard tryGuard(mutex);
UNIT_ASSERT(tryGuard.WasAcquired());
}
-
- int WithLockIncrement(TGuardChecker& m, int n) {
+
+ int WithLockIncrement(TGuardChecker& m, int n) {
with_lock (m) {
- UNIT_ASSERT(m.guarded);
- return n + 1;
- }
- }
-
- void TestWithLock() {
- TGuardChecker m;
- int n = 42;
- n = WithLockIncrement(m, n);
- UNIT_ASSERT(!m.guarded);
- UNIT_ASSERT_EQUAL(n, 43);
- }
+ UNIT_ASSERT(m.guarded);
+ return n + 1;
+ }
+ }
+
+ void TestWithLock() {
+ TGuardChecker m;
+ int n = 42;
+ n = WithLockIncrement(m, n);
+ UNIT_ASSERT(!m.guarded);
+ UNIT_ASSERT_EQUAL(n, 43);
+ }
void TestWithLockScope() {
auto Guard = [](auto) { UNIT_FAIL("Non global Guard used"); return 0; };
diff --git a/util/system/mem_info_ut.cpp b/util/system/mem_info_ut.cpp
index a1100ba646..2dcfc9c5c4 100644
--- a/util/system/mem_info_ut.cpp
+++ b/util/system/mem_info_ut.cpp
@@ -13,8 +13,8 @@ class TMemInfoTest: public NUnitTest::TTestBase {
TMemInfo stats = GetMemInfo();
- UNIT_ASSERT(stats.RSS >= NSystemInfo::GetPageSize());
- UNIT_ASSERT(stats.VMS >= stats.RSS);
+ UNIT_ASSERT(stats.RSS >= NSystemInfo::GetPageSize());
+ UNIT_ASSERT(stats.VMS >= stats.RSS);
}
};