|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
Tests for Aleph::FlatSet (tpl_flat_set.H). More...
#include <limits>#include <new>#include <random>#include <set>#include <stdexcept>#include <string>#include <vector>#include <gtest/gtest.h>#include <tpl_flat_set.H>Go to the source code of this file.
Functions | |
| TEST (FlatSet, EmptySetBasics) | |
| TEST (FlatSet, InsertKeepsSortedOrderAndRejectsDuplicates) | |
| TEST (FlatSet, InitializerListDropsDuplicates) | |
| TEST (FlatSet, RangeConstructor) | |
| TEST (FlatSet, LookupBoundsAndEqualRange) | |
| TEST (FlatSet, EraseByKeyAndIterator) | |
| TEST (FlatSet, MinMaxAndCheckedAccess) | |
| TEST (FlatSet, AlephConventionsEmptyClearTraverse) | |
| TEST (FlatSet, CopyMoveAndEquality) | |
| TEST (FlatSet, CustomComparatorDescendingOrder) | |
| TEST (FlatSet, ReserveAndCapacity) | |
| TEST (FlatSet, DataIsSortedContiguousStorage) | |
| TEST (FlatSet, SwapExchangesContents) | |
| TEST (FlatSet, RandomizedParityWithStdSet) | |
| TEST (FlatSet, CopyThatThrowsLeavesTheSetUntouched) | |
| TEST (FlatSet, MoveThatThrowsAtAnyPointLeavesAValidSet) | |
| TEST (FlatSet, FailureBeforeAnyKeyMovesKeepsTheSet) | |
| TEST (FlatSet, MoveThatThrowsWhileAnInsertionGrowsLeavesAValidSet) | |
Tests for Aleph::FlatSet (tpl_flat_set.H).
Covers construction (empty, range, initializer list with duplicates), lookup (find/contains/bounds), mutation (insert/emplace/erase), iteration order, Aleph conventions (is_empty/empty/traverse) and a randomized parity check against std::set as the reference implementation.
Definition in file flat_set_test.cc.
| TEST | ( | FlatSet | , |
| AlephConventionsEmptyClearTraverse | |||
| ) |
Definition at line 260 of file flat_set_test.cc.
References Aleph::FlatSet< Key, Compare >::clear(), Aleph::FlatSet< Key, Compare >::empty(), Aleph::FlatSet< Key, Compare >::is_empty(), Aleph::sum(), and Aleph::FlatSet< Key, Compare >::traverse().
| TEST | ( | FlatSet | , |
| CopyMoveAndEquality | |||
| ) |
Definition at line 287 of file flat_set_test.cc.
References Aleph::copy(), and Aleph::FlatSet< Key, Compare >::insert().
| TEST | ( | FlatSet | , |
| CopyThatThrowsLeavesTheSetUntouched | |||
| ) |
Definition at line 386 of file flat_set_test.cc.
References Aleph::FlatSet< Key, Compare >::contains(), Aleph::FlatSet< Key, Compare >::insert(), k, and Aleph::FlatSet< Key, Compare >::size().
| TEST | ( | FlatSet | , |
| CustomComparatorDescendingOrder | |||
| ) |
Definition at line 308 of file flat_set_test.cc.
References Aleph::FlatSet< Key, Compare >::contains(), Aleph::FlatSet< Key, Compare >::insert(), and Aleph::FlatSet< Key, Compare >::nth().
| TEST | ( | FlatSet | , |
| DataIsSortedContiguousStorage | |||
| ) |
Definition at line 330 of file flat_set_test.cc.
References Aleph::FlatSet< Key, Compare >::begin(), Aleph::FlatSet< Key, Compare >::data(), Aleph::FlatSet< Key, Compare >::end(), and Aleph::FlatSet< Key, Compare >::size().
| TEST | ( | FlatSet | , |
| EmptySetBasics | |||
| ) |
Definition at line 157 of file flat_set_test.cc.
References Aleph::FlatSet< Key, Compare >::begin(), Aleph::FlatSet< Key, Compare >::contains(), Aleph::FlatSet< Key, Compare >::count(), Aleph::FlatSet< Key, Compare >::end(), Aleph::FlatSet< Key, Compare >::find(), Aleph::FlatSet< Key, Compare >::is_empty(), and Aleph::FlatSet< Key, Compare >::size().
| TEST | ( | FlatSet | , |
| EraseByKeyAndIterator | |||
| ) |
Definition at line 227 of file flat_set_test.cc.
References Aleph::FlatSet< Key, Compare >::contains(), Aleph::FlatSet< Key, Compare >::end(), Aleph::FlatSet< Key, Compare >::erase(), Aleph::FlatSet< Key, Compare >::find(), and Aleph::FlatSet< Key, Compare >::size().
| TEST | ( | FlatSet | , |
| FailureBeforeAnyKeyMovesKeepsTheSet | |||
| ) |
Definition at line 470 of file flat_set_test.cc.
References Aleph::FlatSet< Key, Compare >::capacity(), Aleph::FlatSet< Key, Compare >::contains(), Aleph::FlatSet< Key, Compare >::insert(), k, Aleph::FlatSet< Key, Compare >::nth(), Aleph::FlatSet< Key, Compare >::reserve(), and Aleph::FlatSet< Key, Compare >::size().
| TEST | ( | FlatSet | , |
| InitializerListDropsDuplicates | |||
| ) |
Definition at line 188 of file flat_set_test.cc.
References Aleph::FlatSet< Key, Compare >::nth(), and Aleph::FlatSet< Key, Compare >::size().
| TEST | ( | FlatSet | , |
| InsertKeepsSortedOrderAndRejectsDuplicates | |||
| ) |
Definition at line 168 of file flat_set_test.cc.
References Aleph::FlatSet< Key, Compare >::begin(), Aleph::FlatSet< Key, Compare >::insert(), Aleph::FlatSet< Key, Compare >::nth(), and Aleph::FlatSet< Key, Compare >::size().
| TEST | ( | FlatSet | , |
| LookupBoundsAndEqualRange | |||
| ) |
Definition at line 208 of file flat_set_test.cc.
References Aleph::FlatSet< Key, Compare >::end(), Aleph::FlatSet< Key, Compare >::equal_range(), Aleph::FlatSet< Key, Compare >::lower_bound(), and Aleph::FlatSet< Key, Compare >::upper_bound().
| TEST | ( | FlatSet | , |
| MinMaxAndCheckedAccess | |||
| ) |
Definition at line 246 of file flat_set_test.cc.
References Aleph::FlatSet< Key, Compare >::get_first(), Aleph::FlatSet< Key, Compare >::get_last(), Aleph::FlatSet< Key, Compare >::max(), Aleph::FlatSet< Key, Compare >::min(), and Aleph::FlatSet< Key, Compare >::nth().
| TEST | ( | FlatSet | , |
| MoveThatThrowsAtAnyPointLeavesAValidSet | |||
| ) |
Definition at line 408 of file flat_set_test.cc.
References Aleph::FlatSet< Key, Compare >::insert(), and k.
| TEST | ( | FlatSet | , |
| MoveThatThrowsWhileAnInsertionGrowsLeavesAValidSet | |||
| ) |
Definition at line 512 of file flat_set_test.cc.
References Aleph::FlatSet< Key, Compare >::capacity(), Aleph::completed(), Aleph::FlatSet< Key, Compare >::contains(), Aleph::FlatSet< Key, Compare >::insert(), Aleph::FlatSet< Key, Compare >::is_empty(), k, and Aleph::FlatSet< Key, Compare >::size().
| TEST | ( | FlatSet | , |
| RandomizedParityWithStdSet | |||
| ) |
Definition at line 354 of file flat_set_test.cc.
References Aleph::FlatSet< Key, Compare >::contains(), Aleph::FlatSet< Key, Compare >::erase(), Aleph::FlatSet< Key, Compare >::insert(), k, Aleph::FlatSet< Key, Compare >::nth(), rng, and Aleph::FlatSet< Key, Compare >::size().
| TEST | ( | FlatSet | , |
| RangeConstructor | |||
| ) |
Definition at line 197 of file flat_set_test.cc.
References Aleph::FlatSet< Key, Compare >::begin(), Aleph::FlatSet< Key, Compare >::contains(), Aleph::FlatSet< Key, Compare >::end(), and Aleph::FlatSet< Key, Compare >::size().
| TEST | ( | FlatSet | , |
| ReserveAndCapacity | |||
| ) |
Definition at line 318 of file flat_set_test.cc.
References Aleph::FlatSet< Key, Compare >::capacity(), Aleph::FlatSet< Key, Compare >::insert(), Aleph::FlatSet< Key, Compare >::reserve(), and Aleph::FlatSet< Key, Compare >::size().
| TEST | ( | FlatSet | , |
| SwapExchangesContents | |||
| ) |
Definition at line 341 of file flat_set_test.cc.
References Aleph::and, Aleph::FlatSet< Key, Compare >::contains(), Aleph::FlatSet< Key, Compare >::size(), and Aleph::FlatSet< Key, Compare >::swap().