aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/containers/stack_vector/stack_vec_ut.cpp
diff options
context:
space:
mode:
authoreeight <eeight@yandex-team.ru>2022-02-10 16:46:19 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:19 +0300
commitbd085aee9b4f7a0bee302ce687964ffb7098f986 (patch)
tree1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /library/cpp/containers/stack_vector/stack_vec_ut.cpp
parent475c0a46f28166e83fd263badc7546377cddcabe (diff)
downloadydb-bd085aee9b4f7a0bee302ce687964ffb7098f986.tar.gz
Restoring authorship annotation for <eeight@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.cpp74
1 files changed, 37 insertions, 37 deletions
diff --git a/library/cpp/containers/stack_vector/stack_vec_ut.cpp b/library/cpp/containers/stack_vector/stack_vec_ut.cpp
index 89821dd4a8..19f9677781 100644
--- a/library/cpp/containers/stack_vector/stack_vec_ut.cpp
+++ b/library/cpp/containers/stack_vector/stack_vec_ut.cpp
@@ -2,13 +2,13 @@
#include <library/cpp/testing/unittest/registar.h>
-namespace {
- struct TNotCopyAssignable {
- const int Value;
- };
-
- static_assert(std::is_copy_constructible_v<TNotCopyAssignable>);
- static_assert(!std::is_copy_assignable_v<TNotCopyAssignable>);
+namespace {
+ struct TNotCopyAssignable {
+ const int Value;
+ };
+
+ 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> {
@@ -41,8 +41,8 @@ namespace {
return TBase::allocate(n);
}
};
-}
-
+}
+
Y_UNIT_TEST_SUITE(TStackBasedVectorTest) {
Y_UNIT_TEST(TestCreateEmpty) {
TStackVec<int> ints;
@@ -98,34 +98,34 @@ Y_UNIT_TEST_SUITE(TStackBasedVectorTest) {
UNIT_ASSERT_EQUAL(ints3[i], (int)i);
}
}
-
- Y_UNIT_TEST(TestCappedSize) {
- TStackVec<int, 8, false> ints;
- ints.push_back(1);
- ints.push_back(2);
-
- auto intsCopy = ints;
- UNIT_ASSERT_VALUES_EQUAL(intsCopy.capacity(), 8);
-
- for (int i = 2; i != 8; ++i) {
- intsCopy.push_back(i);
- }
- // Just verify that the program did not crash.
- }
-
- Y_UNIT_TEST(TestCappedSizeWithNotCopyAssignable) {
- TStackVec<TNotCopyAssignable, 8, false> values;
- values.push_back({1});
- values.push_back({2});
-
- auto valuesCopy = values;
- UNIT_ASSERT_VALUES_EQUAL(valuesCopy.capacity(), 8);
-
- for (int i = 2; i != 8; ++i) {
- valuesCopy.push_back({i});
- }
- // Just verify that the program did not crash.
- }
+
+ Y_UNIT_TEST(TestCappedSize) {
+ TStackVec<int, 8, false> ints;
+ ints.push_back(1);
+ ints.push_back(2);
+
+ auto intsCopy = ints;
+ UNIT_ASSERT_VALUES_EQUAL(intsCopy.capacity(), 8);
+
+ for (int i = 2; i != 8; ++i) {
+ intsCopy.push_back(i);
+ }
+ // Just verify that the program did not crash.
+ }
+
+ Y_UNIT_TEST(TestCappedSizeWithNotCopyAssignable) {
+ TStackVec<TNotCopyAssignable, 8, false> values;
+ values.push_back({1});
+ values.push_back({2});
+
+ auto valuesCopy = values;
+ UNIT_ASSERT_VALUES_EQUAL(valuesCopy.capacity(), 8);
+
+ for (int i = 2; i != 8; ++i) {
+ valuesCopy.push_back({i});
+ }
+ // Just verify that the program did not crash.
+ }
Y_UNIT_TEST(TestCustomAllocSize) {
constexpr size_t n = 16384;