diff options
author | dvorkanton <dvorkanton@yandex-team.ru> | 2022-02-10 16:46:04 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:04 +0300 |
commit | ce1ca0f8ad5b8231d32b35629f85bb09beea1bfb (patch) | |
tree | 19b21fdcf9ef01e0c94a15434fb08a4a555a79e9 /util/generic | |
parent | fc361854fd6ee8d747229b090f0b8018e260d1fb (diff) | |
download | ydb-ce1ca0f8ad5b8231d32b35629f85bb09beea1bfb.tar.gz |
Restoring authorship annotation for <dvorkanton@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/generic')
-rw-r--r-- | util/generic/vector.h | 2 | ||||
-rw-r--r-- | util/generic/vector_ut.cpp | 34 |
2 files changed, 18 insertions, 18 deletions
diff --git a/util/generic/vector.h b/util/generic/vector.h index a5b258955a..3426252d3a 100644 --- a/util/generic/vector.h +++ b/util/generic/vector.h @@ -126,7 +126,7 @@ public: inline void crop(size_type size) { if (this->size() > size) { - this->erase(this->begin() + size, this->end()); + this->erase(this->begin() + size, this->end()); } } }; diff --git a/util/generic/vector_ut.cpp b/util/generic/vector_ut.cpp index 0f6b4037a0..c23f719621 100644 --- a/util/generic/vector_ut.cpp +++ b/util/generic/vector_ut.cpp @@ -28,7 +28,7 @@ class TYVectorTest: public TTestBase { //UNIT_TEST(TestEbo) UNIT_TEST(TestFillInConstructor) UNIT_TEST(TestYResize) - UNIT_TEST(TestCrop) + UNIT_TEST(TestCrop) UNIT_TEST(TestInitializeList) UNIT_TEST_SUITE_END(); @@ -535,29 +535,29 @@ private: } } - struct TNoDefaultConstructor { - TNoDefaultConstructor() = delete; + struct TNoDefaultConstructor { + TNoDefaultConstructor() = delete; explicit TNoDefaultConstructor(int val) : Val(val) { } - - int Val; - }; - - void TestCrop() { - TVector<TNoDefaultConstructor> vec; - vec.emplace_back(42); - vec.emplace_back(1337); - vec.emplace_back(8888); - vec.crop(1); // Should not require default constructor - UNIT_ASSERT(vec.size() == 1); - UNIT_ASSERT(vec[0].Val == 42); + + int Val; + }; + + void TestCrop() { + TVector<TNoDefaultConstructor> vec; + vec.emplace_back(42); + vec.emplace_back(1337); + vec.emplace_back(8888); + vec.crop(1); // Should not require default constructor + UNIT_ASSERT(vec.size() == 1); + UNIT_ASSERT(vec[0].Val == 42); vec.crop(50); // Does nothing if new size is greater than the current size() UNIT_ASSERT(vec.size() == 1); UNIT_ASSERT(vec[0].Val == 42); - } - + } + void TestYResize() { TestYResize<int>(); TestYResize<TPod>(); |