diff options
author | Ruslan Kovalev <ruslan.a.kovalev@gmail.com> | 2022-02-10 16:46:45 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:45 +0300 |
commit | 9123176b341b6f2658cff5132482b8237c1416c8 (patch) | |
tree | 49e222ea1c5804306084bb3ae065bb702625360f /library/cpp/deprecated/accessors/accessors_ut.cpp | |
parent | 59e19371de37995fcb36beb16cd6ec030af960bc (diff) | |
download | ydb-9123176b341b6f2658cff5132482b8237c1416c8.tar.gz |
Restoring authorship annotation for Ruslan Kovalev <ruslan.a.kovalev@gmail.com>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/deprecated/accessors/accessors_ut.cpp')
-rw-r--r-- | library/cpp/deprecated/accessors/accessors_ut.cpp | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/library/cpp/deprecated/accessors/accessors_ut.cpp b/library/cpp/deprecated/accessors/accessors_ut.cpp index 80453964fd..a9bdc9fcc4 100644 --- a/library/cpp/deprecated/accessors/accessors_ut.cpp +++ b/library/cpp/deprecated/accessors/accessors_ut.cpp @@ -1,27 +1,27 @@ -#include "accessors.h" - +#include "accessors.h" + #include <library/cpp/testing/unittest/registar.h> -#include <util/generic/buffer.h> -#include <util/generic/vector.h> - +#include <util/generic/buffer.h> +#include <util/generic/vector.h> + #include <array> -class TAccessorsTest: public TTestBase { +class TAccessorsTest: public TTestBase { UNIT_TEST_SUITE(TAccessorsTest); UNIT_TEST(TestAccessors); UNIT_TEST_SUITE_END(); -private: - template <typename T> - void TestRead(const T& t, const char* comm) { - const char* beg = (const char*)NAccessors::Begin(t); - const char* end = (const char*)NAccessors::End(t); +private: + template <typename T> + void TestRead(const T& t, const char* comm) { + const char* beg = (const char*)NAccessors::Begin(t); + const char* end = (const char*)NAccessors::End(t); long sz = NAccessors::Size(t) * sizeof(typename TMemoryTraits<T>::TElementType); - - UNIT_ASSERT_VALUES_EQUAL_C(end - beg, sz, comm); - } - + + UNIT_ASSERT_VALUES_EQUAL_C(end - beg, sz, comm); + } + template <typename T> void TestWrite(const char* comm) { typename TMemoryTraits<T>::TElementType val[4] = {'t', 'e', 's', 't'}; @@ -46,32 +46,32 @@ private: UNIT_ASSERT_VALUES_EQUAL_C(0u, sz, comm); } - void TestAccessors() { - TestRead('a', "char"); - TestRead(1, "int"); - + void TestAccessors() { + TestRead('a', "char"); + TestRead(1, "int"); + int t[4] = {0, 1, 2, 3}; - - TestRead(t, "int[4]"); - - TStringBuf sbuf = "test"; - - TestRead(sbuf, "TStringBuf"); - + + TestRead(t, "int[4]"); + + TStringBuf sbuf = "test"; + + TestRead(sbuf, "TStringBuf"); + TUtf16String wtr; - wtr.resize(10, 1024); - + wtr.resize(10, 1024); + TestRead(wtr, "TUtf16String"); - - TBuffer buf; - buf.Resize(30); - - TestRead(buf, "TBuffer"); - + + TBuffer buf; + buf.Resize(30); + + TestRead(buf, "TBuffer"); + TVector<ui64> vec(10, 100); - + TestRead(vec, "TVector<ui64>"); - + TestWrite<TString>("TString"); TestWrite<TVector<char>>("TVector<char>"); TestWrite<TBuffer>("TBuffer"); @@ -86,7 +86,7 @@ private: NAccessors::Init(carr); NAccessors::Clear(carr); TestRead(carr, "std::array<char, 10>"); - } -}; - -UNIT_TEST_SUITE_REGISTRATION(TAccessorsTest) + } +}; + +UNIT_TEST_SUITE_REGISTRATION(TAccessorsTest) |