diff options
author | nightnord <nightnord@yandex-team.ru> | 2022-02-10 16:48:48 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:48:48 +0300 |
commit | 5423b8524031e92d72b6151c5ad8bdf9b0b01bdc (patch) | |
tree | bec61af12cf9823b5f812935dbd9d7241155b459 /util/generic/string_ut.cpp | |
parent | 62dfc04ee209ed1743131cfa14e49087cf5da9eb (diff) | |
download | ydb-5423b8524031e92d72b6151c5ad8bdf9b0b01bdc.tar.gz |
Restoring authorship annotation for <nightnord@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/generic/string_ut.cpp')
-rw-r--r-- | util/generic/string_ut.cpp | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/util/generic/string_ut.cpp b/util/generic/string_ut.cpp index ac82e9091d..8216742536 100644 --- a/util/generic/string_ut.cpp +++ b/util/generic/string_ut.cpp @@ -103,48 +103,48 @@ protected: //Expected exception is length_error: UNIT_ASSERT(false); } - - // Non-shared behaviour - never shrink - - s.reserve(256); + + // Non-shared behaviour - never shrink + + s.reserve(256); #ifndef TSTRING_IS_STD_STRING - const auto* data = s.data(); - - UNIT_ASSERT(s.capacity() >= 256); - - s.reserve(128); - - UNIT_ASSERT(s.capacity() >= 256 && s.data() == data); + const auto* data = s.data(); + + UNIT_ASSERT(s.capacity() >= 256); + + s.reserve(128); + + UNIT_ASSERT(s.capacity() >= 256 && s.data() == data); #endif - - s.resize(64, 'x'); - s.reserve(10); - + + s.resize(64, 'x'); + s.reserve(10); + #ifdef TSTRING_IS_STD_STRING UNIT_ASSERT(s.capacity() >= 64); #else - UNIT_ASSERT(s.capacity() >= 256 && s.data() == data); + UNIT_ASSERT(s.capacity() >= 256 && s.data() == data); #endif - + #ifndef TSTRING_IS_STD_STRING - // Shared behaviour - always reallocate, just as much as requisted - + // Shared behaviour - always reallocate, just as much as requisted + TStringType holder = s; - - UNIT_ASSERT(s.capacity() >= 256); - - s.reserve(128); - - UNIT_ASSERT(s.capacity() >= 128 && s.capacity() < 256 && s.data() != data); + + UNIT_ASSERT(s.capacity() >= 256); + + s.reserve(128); + + UNIT_ASSERT(s.capacity() >= 128 && s.capacity() < 256 && s.data() != data); UNIT_ASSERT(s.IsDetached()); - - s.resize(64, 'x'); - data = s.data(); - holder = s; - - s.reserve(10); - - UNIT_ASSERT(s.capacity() >= 64 && s.capacity() < 128 && s.data() != data); + + s.resize(64, 'x'); + data = s.data(); + holder = s; + + s.reserve(10); + + UNIT_ASSERT(s.capacity() >= 64 && s.capacity() < 128 && s.data() != data); UNIT_ASSERT(s.IsDetached()); #endif #endif |