|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Tests for Aleph::SmallVector (tpl_small_vector.H). More...
#include <memory>#include <stdexcept>#include <string>#include <type_traits>#include <vector>#include <gtest/gtest.h>#include <tpl_small_vector.H>Go to the source code of this file.
Functions | |
| TEST (SmallVector, StaysInlineUpToNThenSpills) | |
| TEST (SmallVector, InlineBufferIsInsideTheObject) | |
| TEST (SmallVector, ElementLifetimesAreBalanced) | |
| TEST (SmallVector, FailedConstructorsCleanPartialElements) | |
| TEST (SmallVector, MoveOnlyElementsAreSupported) | |
| TEST (SmallVector, CopySemanticsInBothModes) | |
| TEST (SmallVector, MoveSemanticsInBothModes) | |
| TEST (SmallVector, InsertAndEraseAtPosition) | |
| TEST (SmallVector, CheckedAndUncheckedAccess) | |
| TEST (SmallVector, IterationAndRangeFor) | |
| TEST (SmallVector, AlephConventionsEmptyClearTraverse) | |
| TEST (SmallVector, ReserveGrowsAndKeepsElements) | |
| TEST (SmallVector, ReserveDetectsCapacityOverflow) | |
| TEST (SmallVector, RangeConstructorAndFillConstructor) | |
| TEST (SmallVector, EqualityAcrossDifferentInlineCapacities) | |
| TEST (SmallVector, SwapInAllModeCombinations) | |
| TEST (SmallVector, AppendRangeTrivialTypeStaysInlineThenSpillsCorrectly) | |
| TEST (SmallVector, AppendRangeOfZeroIsANoOp) | |
| TEST (SmallVector, AppendRangeRejectsNullSourceWhenCountIsPositive) | |
| TEST (SmallVector, AppendRangeSingleCallGrowsAtMostOnce) | |
| TEST (SmallVector, AppendRangeNonTrivialTypeKeepsLifetimesBalanced) | |
| TEST (SmallVector, AppendRangeFailedCopyLeavesSizeUnchangedAndNoLeak) | |
Tests for Aleph::SmallVector (tpl_small_vector.H).
Covers the inline/heap storage transition (is_small), element lifetime (constructor/destructor balance via an instrumented type), move-only element support, copy/move semantics in both storage modes, positional insert/erase, checked access, and Aleph conventions.
Definition in file small_vector_test.cc.
| TEST | ( | SmallVector | , |
| AlephConventionsEmptyClearTraverse | |||
| ) |
Definition at line 341 of file small_vector_test.cc.
References Aleph::SmallVector< T, N >::empty(), Aleph::SmallVector< T, N >::is_empty(), Aleph::SmallVector< T, N >::size(), and Aleph::SmallVector< T, N >::traverse().
| TEST | ( | SmallVector | , |
| AppendRangeFailedCopyLeavesSizeUnchangedAndNoLeak | |||
| ) |
Definition at line 508 of file small_vector_test.cc.
References Aleph::SmallVector< T, N >::append_range(), and Aleph::SmallVector< T, N >::size().
| TEST | ( | SmallVector | , |
| AppendRangeNonTrivialTypeKeepsLifetimesBalanced | |||
| ) |
Definition at line 490 of file small_vector_test.cc.
References Aleph::SmallVector< T, N >::append_range(), Aleph::SmallVector< T, N >::size(), and value.
| TEST | ( | SmallVector | , |
| AppendRangeOfZeroIsANoOp | |||
| ) |
Definition at line 455 of file small_vector_test.cc.
References Aleph::SmallVector< T, N >::append_range(), Aleph::SmallVector< T, N >::is_small(), and Aleph::SmallVector< T, N >::size().
| TEST | ( | SmallVector | , |
| AppendRangeRejectsNullSourceWhenCountIsPositive | |||
| ) |
Definition at line 463 of file small_vector_test.cc.
References Aleph::SmallVector< T, N >::append_range(), and Aleph::SmallVector< T, N >::size().
| TEST | ( | SmallVector | , |
| AppendRangeSingleCallGrowsAtMostOnce | |||
| ) |
Definition at line 474 of file small_vector_test.cc.
References Aleph::SmallVector< T, N >::append_range(), Aleph::SmallVector< T, N >::capacity(), and Aleph::SmallVector< T, N >::size().
| TEST | ( | SmallVector | , |
| AppendRangeTrivialTypeStaysInlineThenSpillsCorrectly | |||
| ) |
Definition at line 432 of file small_vector_test.cc.
References Aleph::SmallVector< T, N >::append_range(), Aleph::SmallVector< T, N >::is_small(), and Aleph::SmallVector< T, N >::size().
| TEST | ( | SmallVector | , |
| CheckedAndUncheckedAccess | |||
| ) |
Definition at line 308 of file small_vector_test.cc.
References Aleph::SmallVector< T, N >::get_first(), Aleph::SmallVector< T, N >::get_last(), Aleph::SmallVector< T, N >::pop_back(), and Aleph::SmallVector< T, N >::remove_last().
| TEST | ( | SmallVector | , |
| CopySemanticsInBothModes | |||
| ) |
Definition at line 243 of file small_vector_test.cc.
References Aleph::SmallVector< T, N >::is_small(), and Aleph::SmallVector< T, N >::size().
| TEST | ( | SmallVector | , |
| ElementLifetimesAreBalanced | |||
| ) |
Definition at line 159 of file small_vector_test.cc.
References Aleph::SmallVector< T, N >::clear(), Aleph::SmallVector< T, N >::emplace_back(), and Aleph::SmallVector< T, N >::pop_back().
| TEST | ( | SmallVector | , |
| EqualityAcrossDifferentInlineCapacities | |||
| ) |
Definition at line 400 of file small_vector_test.cc.
References Aleph::SmallVector< T, N >::append().
| TEST | ( | SmallVector | , |
| FailedConstructorsCleanPartialElements | |||
| ) |
Definition at line 179 of file small_vector_test.cc.
References Aleph::SmallVector< T, N >::emplace_back(), and value.
| TEST | ( | SmallVector | , |
| InlineBufferIsInsideTheObject | |||
| ) |
Definition at line 144 of file small_vector_test.cc.
References Aleph::SmallVector< T, N >::append(), and Aleph::SmallVector< T, N >::data().
| TEST | ( | SmallVector | , |
| InsertAndEraseAtPosition | |||
| ) |
| TEST | ( | SmallVector | , |
| IterationAndRangeFor | |||
| ) |
Definition at line 326 of file small_vector_test.cc.
References Aleph::SmallVector< T, N >::begin(), Aleph::SmallVector< T, N >::end(), and Aleph::SmallVector< T, N >::size().
| TEST | ( | SmallVector | , |
| MoveOnlyElementsAreSupported | |||
| ) |
Definition at line 224 of file small_vector_test.cc.
References Aleph::SmallVector< T, N >::append(), Aleph::SmallVector< T, N >::remove_last(), and Aleph::SmallVector< T, N >::size().
| TEST | ( | SmallVector | , |
| MoveSemanticsInBothModes | |||
| ) |
Definition at line 262 of file small_vector_test.cc.
References Aleph::SmallVector< T, N >::append(), Aleph::SmallVector< T, N >::data(), Aleph::SmallVector< T, N >::is_empty(), Aleph::SmallVector< T, N >::is_small(), and Aleph::SmallVector< T, N >::size().
| TEST | ( | SmallVector | , |
| RangeConstructorAndFillConstructor | |||
| ) |
Definition at line 387 of file small_vector_test.cc.
References Aleph::SmallVector< T, N >::is_small(), and Aleph::SmallVector< T, N >::size().
| TEST | ( | SmallVector | , |
| ReserveDetectsCapacityOverflow | |||
| ) |
Definition at line 379 of file small_vector_test.cc.
References Aleph::SmallVector< T, N >::is_empty(), Aleph::SmallVector< T, N >::is_small(), and Aleph::SmallVector< T, N >::reserve().
| TEST | ( | SmallVector | , |
| ReserveGrowsAndKeepsElements | |||
| ) |
Definition at line 363 of file small_vector_test.cc.
References Aleph::SmallVector< T, N >::append(), Aleph::SmallVector< T, N >::capacity(), Aleph::SmallVector< T, N >::data(), Aleph::SmallVector< T, N >::is_small(), and Aleph::SmallVector< T, N >::reserve().
| TEST | ( | SmallVector | , |
| StaysInlineUpToNThenSpills | |||
| ) |
Definition at line 124 of file small_vector_test.cc.
References Aleph::SmallVector< T, N >::append(), Aleph::SmallVector< T, N >::capacity(), Aleph::SmallVector< T, N >::is_empty(), Aleph::SmallVector< T, N >::is_small(), and Aleph::SmallVector< T, N >::size().
| TEST | ( | SmallVector | , |
| SwapInAllModeCombinations | |||
| ) |
Definition at line 409 of file small_vector_test.cc.
References Aleph::SmallVector< T, N >::data(), Aleph::SmallVector< T, N >::size(), and Aleph::SmallVector< T, N >::swap().