diff options
author | vskipin <vskipin@yandex-team.ru> | 2022-02-10 16:46:00 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:00 +0300 |
commit | 4d8b546b89b5afc08cf3667e176271c7ba935f33 (patch) | |
tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /util/system/atomic_ut.cpp | |
parent | 4e4b78bd7b67e2533da4dbb9696374a6d6068e32 (diff) | |
download | ydb-4d8b546b89b5afc08cf3667e176271c7ba935f33.tar.gz |
Restoring authorship annotation for <vskipin@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/system/atomic_ut.cpp')
-rw-r--r-- | util/system/atomic_ut.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/util/system/atomic_ut.cpp b/util/system/atomic_ut.cpp index c53722766a..07211ffba7 100644 --- a/util/system/atomic_ut.cpp +++ b/util/system/atomic_ut.cpp @@ -145,13 +145,13 @@ private: inline void TestAtomicSwap() { TAtomic v = 0; - UNIT_ASSERT_VALUES_EQUAL(AtomicSwap(&v, 3), 0); - UNIT_ASSERT_VALUES_EQUAL(AtomicSwap(&v, 5), 3); - UNIT_ASSERT_VALUES_EQUAL(AtomicSwap(&v, -7), 5); - UNIT_ASSERT_VALUES_EQUAL(AtomicSwap(&v, Max<intptr_t>()), -7); + UNIT_ASSERT_VALUES_EQUAL(AtomicSwap(&v, 3), 0); + UNIT_ASSERT_VALUES_EQUAL(AtomicSwap(&v, 5), 3); + UNIT_ASSERT_VALUES_EQUAL(AtomicSwap(&v, -7), 5); + UNIT_ASSERT_VALUES_EQUAL(AtomicSwap(&v, Max<intptr_t>()), -7); UNIT_ASSERT_VALUES_EQUAL(v, Max<intptr_t>()); } - + inline void TestAtomicOr() { TAtomic v = 0xf0; @@ -173,19 +173,19 @@ private: UNIT_ASSERT_VALUES_EQUAL(AtomicXor(v, 0xff), 0x00); } - inline void TestAtomicPtr() { - int* p; + inline void TestAtomicPtr() { + int* p; AtomicSet(p, nullptr); - - UNIT_ASSERT_VALUES_EQUAL(AtomicGet(p), 0); - - int i; - AtomicSet(p, &i); - - UNIT_ASSERT_VALUES_EQUAL(AtomicGet(p), &i); + + UNIT_ASSERT_VALUES_EQUAL(AtomicGet(p), 0); + + int i; + AtomicSet(p, &i); + + UNIT_ASSERT_VALUES_EQUAL(AtomicGet(p), &i); UNIT_ASSERT_VALUES_EQUAL(AtomicSwap(&p, nullptr), &i); UNIT_ASSERT(AtomicCas(&p, &i, nullptr)); - } + } }; UNIT_TEST_SUITE_REGISTRATION(TAtomicTest<TAtomic>); |