aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/containers/stack_vector/stack_vec_ut.cpp
diff options
context:
space:
mode:
authorswarmer <swarmer@yandex-team.ru>2022-02-10 16:46:31 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:31 +0300
commit11a24635da4c4f39428b182c49a7bc35e47c9534 (patch)
tree1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /library/cpp/containers/stack_vector/stack_vec_ut.cpp
parent317da38588b7898a99fd9168571408123350012b (diff)
downloadydb-11a24635da4c4f39428b182c49a7bc35e47c9534.tar.gz
Restoring authorship annotation for <swarmer@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/containers/stack_vector/stack_vec_ut.cpp')
-rw-r--r--library/cpp/containers/stack_vector/stack_vec_ut.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/library/cpp/containers/stack_vector/stack_vec_ut.cpp b/library/cpp/containers/stack_vector/stack_vec_ut.cpp
index bdb66f8c4f..19f9677781 100644
--- a/library/cpp/containers/stack_vector/stack_vec_ut.cpp
+++ b/library/cpp/containers/stack_vector/stack_vec_ut.cpp
@@ -9,16 +9,16 @@ namespace {
static_assert(std::is_copy_constructible_v<TNotCopyAssignable>);
static_assert(!std::is_copy_assignable_v<TNotCopyAssignable>);
-
- template <class T, size_t JunkPayloadSize>
- struct TThickAlloc: public std::allocator<T> {
- template <class U>
- struct rebind {
- using other = TThickAlloc<U, JunkPayloadSize>;
- };
-
- char Junk[JunkPayloadSize]{sizeof(T)};
- };
+
+ template <class T, size_t JunkPayloadSize>
+ struct TThickAlloc: public std::allocator<T> {
+ template <class U>
+ struct rebind {
+ using other = TThickAlloc<U, JunkPayloadSize>;
+ };
+
+ char Junk[JunkPayloadSize]{sizeof(T)};
+ };
template <class T>
struct TStatefulAlloc: public std::allocator<T> {
@@ -126,12 +126,12 @@ Y_UNIT_TEST_SUITE(TStackBasedVectorTest) {
}
// Just verify that the program did not crash.
}
-
- Y_UNIT_TEST(TestCustomAllocSize) {
- constexpr size_t n = 16384;
- using TVec = TStackVec<size_t, 1, true, TThickAlloc<size_t, n>>;
- UNIT_ASSERT_LT(sizeof(TVec), 1.5 * n);
- }
+
+ Y_UNIT_TEST(TestCustomAllocSize) {
+ constexpr size_t n = 16384;
+ using TVec = TStackVec<size_t, 1, true, TThickAlloc<size_t, n>>;
+ UNIT_ASSERT_LT(sizeof(TVec), 1.5 * n);
+ }
Y_UNIT_TEST(TestStatefulAlloc) {
size_t count = 0;