|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Tests for Avl Rb Rk. More...
#include <gtest/gtest.h>#include <random>#include <vector>#include <algorithm>#include <tpl_avlRk.H>#include <tpl_rbRk.H>Go to the source code of this file.
Classes | |
| class | RankTreeTest< Tree > |
Typedefs | |
| using | AvlRkTest = RankTreeTest< Avl_Tree_Rk< int > > |
| using | RbRkTest = RankTreeTest< Rb_Tree_Rk< int > > |
Functions | |
| static mt19937 | rng (42) |
| TEST_F (AvlRkTest, InsertAndVerify) | |
| TEST_F (AvlRkTest, SelectOperations) | |
| TEST_F (AvlRkTest, PositionOperations) | |
| TEST_F (AvlRkTest, PositionNotFound) | |
| TEST_F (AvlRkTest, RemoveAndVerify) | |
| TEST_F (AvlRkTest, SelectAfterRemoval) | |
| TEST_F (RbRkTest, InsertAndVerify) | |
| TEST_F (RbRkTest, SelectOperations) | |
| TEST_F (RbRkTest, PositionOperations) | |
| TEST_F (RbRkTest, PositionNotFound) | |
| TEST_F (RbRkTest, RemoveAndVerify) | |
| TEST_F (RbRkTest, SelectAfterRemoval) | |
| TEST (StressTest, MixedOperationsAvl) | |
| TEST (StressTest, MixedOperationsRb) | |
| TEST (EdgeCases, EmptyAvlTree) | |
| TEST (EdgeCases, EmptyRbTree) | |
| TEST (EdgeCases, SingleElementAvl) | |
| TEST (EdgeCases, SingleElementRb) | |
| TEST (SearchOrInsert, AvlTree) | |
| TEST (SearchOrInsert, RbTree) | |
| TEST (InsertDup, AvlTree) | |
| TEST (InsertDup, RbTree) | |
| template<typename Tree > | |
| void | destroy_tree (Tree &tree) |
| TEST (JoinSplitAvl, JoinExclusiveBasic) | |
| TEST (JoinSplitAvl, JoinExclusiveEmptyLeft) | |
| TEST (JoinSplitAvl, JoinExclusiveEmptyRight) | |
| TEST (JoinSplitAvl, SplitKeyBasic) | |
| TEST (JoinSplitAvl, SplitKeyNotFound) | |
| TEST (JoinSplitAvl, SplitPosBasic) | |
| TEST (JoinSplitAvl, SplitPosZero) | |
| TEST (JoinSplitAvl, SplitPosEnd) | |
| TEST (JoinSplitAvl, JoinThenSplit) | |
| TEST (JoinSplitRb, JoinExclusiveBasic) | |
| TEST (JoinSplitRb, JoinExclusiveEmptyLeft) | |
| TEST (JoinSplitRb, JoinExclusiveEmptyRight) | |
| TEST (JoinSplitRb, SplitKeyBasic) | |
| TEST (JoinSplitRb, SplitKeyNotFound) | |
| TEST (JoinSplitRb, SplitPosBasic) | |
| TEST (JoinSplitRb, SplitPosZero) | |
| TEST (JoinSplitRb, SplitPosEnd) | |
| TEST (JoinSplitRb, JoinThenSplit) | |
| TEST (JoinSplitStress, AvlLargeJoinSplit) | |
| TEST (JoinSplitStress, RbLargeJoinSplit) | |
| TEST (SplitDup, AvlSplitKeyDup) | |
| TEST (SplitDup, RbSplitKeyDup) | |
| int | main (int argc, char **argv) |
Tests for Avl Rb Rk.
Definition in file avl-rb-rk.cc.
| using AvlRkTest = RankTreeTest<Avl_Tree_Rk<int> > |
Definition at line 89 of file avl-rb-rk.cc.
| using RbRkTest = RankTreeTest<Rb_Tree_Rk<int> > |
Definition at line 90 of file avl-rb-rk.cc.
Definition at line 520 of file avl-rb-rk.cc.
References Aleph::Gen_Rand_Tree< NodeType, Key, Compare >::getRoot(), Aleph::Gen_Rand_Tree< NodeType, Key, Compare >::is_empty(), Aleph::maps(), and Aleph::Gen_Rand_Tree< NodeType, Key, Compare >::remove().
Referenced by TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
| int main | ( | int | argc, |
| char ** | argv | ||
| ) |
Definition at line 1068 of file avl-rb-rk.cc.
References Aleph::maps().
|
static |
| TEST | ( | EdgeCases | , |
| EmptyAvlTree | |||
| ) |
Definition at line 356 of file avl-rb-rk.cc.
References Aleph::Gen_Avl_Tree_Rk< NodeType, Key, Compare >::is_empty(), Aleph::maps(), Aleph::Gen_Avl_Tree_Rk< NodeType, Key, Compare >::position(), Aleph::Gen_Avl_Tree_Rk< NodeType, Key, Compare >::remove(), Aleph::Gen_Avl_Tree_Rk< NodeType, Key, Compare >::search(), and Aleph::Gen_Avl_Tree_Rk< NodeType, Key, Compare >::size().
| TEST | ( | EdgeCases | , |
| EmptyRbTree | |||
| ) |
Definition at line 369 of file avl-rb-rk.cc.
References Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::is_empty(), Aleph::maps(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::position(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::remove(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::search(), and Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::size().
| TEST | ( | EdgeCases | , |
| SingleElementAvl | |||
| ) |
Definition at line 384 of file avl-rb-rk.cc.
References Aleph::Gen_Avl_Tree_Rk< NodeType, Key, Compare >::insert(), Aleph::Gen_Avl_Tree_Rk< NodeType, Key, Compare >::is_empty(), Aleph::maps(), Aleph::Gen_Avl_Tree_Rk< NodeType, Key, Compare >::position(), Aleph::Gen_Avl_Tree_Rk< NodeType, Key, Compare >::remove(), Aleph::Gen_Avl_Tree_Rk< NodeType, Key, Compare >::select(), Aleph::Gen_Avl_Tree_Rk< NodeType, Key, Compare >::size(), and Aleph::Gen_Avl_Tree_Rk< NodeType, Key, Compare >::verify().
| TEST | ( | EdgeCases | , |
| SingleElementRb | |||
| ) |
Definition at line 406 of file avl-rb-rk.cc.
References Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::insert(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::is_empty(), Aleph::maps(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::position(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::remove(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::select(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::size(), and Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::verify().
| TEST | ( | InsertDup | , |
| AvlTree | |||
| ) |
Definition at line 470 of file avl-rb-rk.cc.
References Aleph::Gen_Avl_Tree_Rk< NodeType, Key, Compare >::insert_dup(), Aleph::Gen_Avl_Tree_Rk< NodeType, Key, Compare >::is_empty(), Aleph::maps(), Aleph::Gen_Avl_Tree_Rk< NodeType, Key, Compare >::remove(), Aleph::Gen_Avl_Tree_Rk< NodeType, Key, Compare >::select(), Aleph::Gen_Avl_Tree_Rk< NodeType, Key, Compare >::size(), and Aleph::Gen_Avl_Tree_Rk< NodeType, Key, Compare >::verify().
| TEST | ( | InsertDup | , |
| RbTree | |||
| ) |
Definition at line 492 of file avl-rb-rk.cc.
References Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::insert_dup(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::is_empty(), Aleph::maps(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::remove(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::select(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::size(), and Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::verify().
| TEST | ( | JoinSplitAvl | , |
| JoinExclusiveBasic | |||
| ) |
Definition at line 528 of file avl-rb-rk.cc.
References destroy_tree(), Aleph::DynList< T >::insert(), Aleph::HTList::is_empty(), Aleph::maps(), and Aleph::HTList::size().
| TEST | ( | JoinSplitAvl | , |
| JoinExclusiveEmptyLeft | |||
| ) |
Definition at line 560 of file avl-rb-rk.cc.
References destroy_tree(), Aleph::DynList< T >::insert(), Aleph::HTList::is_empty(), Aleph::maps(), and Aleph::HTList::size().
| TEST | ( | JoinSplitAvl | , |
| JoinExclusiveEmptyRight | |||
| ) |
Definition at line 577 of file avl-rb-rk.cc.
References destroy_tree(), Aleph::DynList< T >::insert(), Aleph::HTList::is_empty(), Aleph::maps(), and Aleph::HTList::size().
| TEST | ( | JoinSplitAvl | , |
| JoinThenSplit | |||
| ) |
Definition at line 717 of file avl-rb-rk.cc.
References destroy_tree(), Aleph::DynList< T >::insert(), Aleph::maps(), and Aleph::HTList::size().
| TEST | ( | JoinSplitAvl | , |
| SplitKeyBasic | |||
| ) |
| TEST | ( | JoinSplitAvl | , |
| SplitKeyNotFound | |||
| ) |
| TEST | ( | JoinSplitAvl | , |
| SplitPosBasic | |||
| ) |
| TEST | ( | JoinSplitAvl | , |
| SplitPosEnd | |||
| ) |
Definition at line 699 of file avl-rb-rk.cc.
References destroy_tree(), Aleph::Gen_Avl_Tree_Rk< NodeType, Key, Compare >::insert(), Aleph::HTList::is_empty(), Aleph::Gen_Avl_Tree_Rk< NodeType, Key, Compare >::is_empty(), Aleph::maps(), Aleph::HTList::size(), and Aleph::Gen_Avl_Tree_Rk< NodeType, Key, Compare >::split_pos().
| TEST | ( | JoinSplitAvl | , |
| SplitPosZero | |||
| ) |
Definition at line 681 of file avl-rb-rk.cc.
References destroy_tree(), Aleph::Gen_Avl_Tree_Rk< NodeType, Key, Compare >::insert(), Aleph::HTList::is_empty(), Aleph::Gen_Avl_Tree_Rk< NodeType, Key, Compare >::is_empty(), Aleph::maps(), Aleph::HTList::size(), and Aleph::Gen_Avl_Tree_Rk< NodeType, Key, Compare >::split_pos().
| TEST | ( | JoinSplitRb | , |
| JoinExclusiveBasic | |||
| ) |
Definition at line 745 of file avl-rb-rk.cc.
References destroy_tree(), Aleph::DynList< T >::insert(), Aleph::HTList::is_empty(), Aleph::maps(), and Aleph::HTList::size().
| TEST | ( | JoinSplitRb | , |
| JoinExclusiveEmptyLeft | |||
| ) |
Definition at line 775 of file avl-rb-rk.cc.
References destroy_tree(), Aleph::DynList< T >::insert(), Aleph::HTList::is_empty(), Aleph::maps(), and Aleph::HTList::size().
| TEST | ( | JoinSplitRb | , |
| JoinExclusiveEmptyRight | |||
| ) |
Definition at line 792 of file avl-rb-rk.cc.
References destroy_tree(), Aleph::DynList< T >::insert(), Aleph::HTList::is_empty(), Aleph::maps(), and Aleph::HTList::size().
| TEST | ( | JoinSplitRb | , |
| JoinThenSplit | |||
| ) |
Definition at line 924 of file avl-rb-rk.cc.
References destroy_tree(), Aleph::DynList< T >::insert(), Aleph::maps(), and Aleph::HTList::size().
| TEST | ( | JoinSplitRb | , |
| SplitKeyBasic | |||
| ) |
| TEST | ( | JoinSplitRb | , |
| SplitKeyNotFound | |||
| ) |
| TEST | ( | JoinSplitRb | , |
| SplitPosBasic | |||
| ) |
| TEST | ( | JoinSplitRb | , |
| SplitPosEnd | |||
| ) |
Definition at line 906 of file avl-rb-rk.cc.
References destroy_tree(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::insert(), Aleph::HTList::is_empty(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::is_empty(), Aleph::maps(), Aleph::HTList::size(), and Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::split_pos().
| TEST | ( | JoinSplitRb | , |
| SplitPosZero | |||
| ) |
Definition at line 888 of file avl-rb-rk.cc.
References destroy_tree(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::insert(), Aleph::HTList::is_empty(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::is_empty(), Aleph::maps(), Aleph::HTList::size(), and Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::split_pos().
| TEST | ( | JoinSplitStress | , |
| AvlLargeJoinSplit | |||
| ) |
Definition at line 952 of file avl-rb-rk.cc.
References destroy_tree(), Aleph::DynList< T >::insert(), Aleph::maps(), N, and Aleph::HTList::size().
| TEST | ( | JoinSplitStress | , |
| RbLargeJoinSplit | |||
| ) |
Definition at line 980 of file avl-rb-rk.cc.
References destroy_tree(), Aleph::DynList< T >::insert(), Aleph::maps(), N, and Aleph::HTList::size().
| TEST | ( | SearchOrInsert | , |
| AvlTree | |||
| ) |
| TEST | ( | SearchOrInsert | , |
| RbTree | |||
| ) |
Definition at line 449 of file avl-rb-rk.cc.
References Aleph::maps(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::remove(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::search_or_insert(), and Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::size().
| TEST | ( | SplitDup | , |
| AvlSplitKeyDup | |||
| ) |
Definition at line 1010 of file avl-rb-rk.cc.
References destroy_tree(), Aleph::Gen_Avl_Tree_Rk< NodeType, Key, Compare >::insert_dup(), Aleph::Gen_Avl_Tree_Rk< NodeType, Key, Compare >::is_empty(), Aleph::maps(), Aleph::HTList::size(), Aleph::Gen_Avl_Tree_Rk< NodeType, Key, Compare >::size(), and Aleph::Gen_Avl_Tree_Rk< NodeType, Key, Compare >::split_key_dup().
| TEST | ( | SplitDup | , |
| RbSplitKeyDup | |||
| ) |
Definition at line 1040 of file avl-rb-rk.cc.
References destroy_tree(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::insert_dup(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::is_empty(), Aleph::maps(), Aleph::HTList::size(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::size(), and Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::split_key_dup().
| TEST | ( | StressTest | , |
| MixedOperationsAvl | |||
| ) |
Definition at line 264 of file avl-rb-rk.cc.
References Aleph::Gen_Avl_Tree_Rk< NodeType, Key, Compare >::getRoot(), Aleph::Gen_Avl_Tree_Rk< NodeType, Key, Compare >::insert(), Aleph::Gen_Avl_Tree_Rk< NodeType, Key, Compare >::is_empty(), Aleph::maps(), N, Aleph::Gen_Avl_Tree_Rk< NodeType, Key, Compare >::position(), Aleph::Gen_Avl_Tree_Rk< NodeType, Key, Compare >::remove(), rng, Aleph::Gen_Avl_Tree_Rk< NodeType, Key, Compare >::select(), Aleph::Gen_Avl_Tree_Rk< NodeType, Key, Compare >::size(), and Aleph::Gen_Avl_Tree_Rk< NodeType, Key, Compare >::verify().
| TEST | ( | StressTest | , |
| MixedOperationsRb | |||
| ) |
Definition at line 309 of file avl-rb-rk.cc.
References Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::getRoot(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::insert(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::is_empty(), Aleph::maps(), N, Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::position(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::remove(), rng, Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::select(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::size(), and Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::verify().
| TEST_F | ( | AvlRkTest | , |
| InsertAndVerify | |||
| ) |
Definition at line 94 of file avl-rb-rk.cc.
References Aleph::maps(), and N.
| TEST_F | ( | AvlRkTest | , |
| PositionNotFound | |||
| ) |
Definition at line 129 of file avl-rb-rk.cc.
References Aleph::maps(), and N.
| TEST_F | ( | AvlRkTest | , |
| PositionOperations | |||
| ) |
Definition at line 115 of file avl-rb-rk.cc.
References Aleph::maps(), and N.
| TEST_F | ( | AvlRkTest | , |
| RemoveAndVerify | |||
| ) |
Definition at line 138 of file avl-rb-rk.cc.
References Aleph::maps(), N, rng, and Aleph::shuffle().
| TEST_F | ( | AvlRkTest | , |
| SelectAfterRemoval | |||
| ) |
Definition at line 155 of file avl-rb-rk.cc.
References Aleph::maps(), and N.
| TEST_F | ( | AvlRkTest | , |
| SelectOperations | |||
| ) |
Definition at line 102 of file avl-rb-rk.cc.
References Aleph::maps(), and N.
| TEST_F | ( | RbRkTest | , |
| InsertAndVerify | |||
| ) |
Definition at line 179 of file avl-rb-rk.cc.
References Aleph::maps(), and N.
| TEST_F | ( | RbRkTest | , |
| PositionNotFound | |||
| ) |
Definition at line 214 of file avl-rb-rk.cc.
References Aleph::maps(), and N.
| TEST_F | ( | RbRkTest | , |
| PositionOperations | |||
| ) |
Definition at line 200 of file avl-rb-rk.cc.
References Aleph::maps(), and N.
| TEST_F | ( | RbRkTest | , |
| RemoveAndVerify | |||
| ) |
Definition at line 223 of file avl-rb-rk.cc.
References Aleph::maps(), N, rng, and Aleph::shuffle().
| TEST_F | ( | RbRkTest | , |
| SelectAfterRemoval | |||
| ) |
Definition at line 240 of file avl-rb-rk.cc.
References Aleph::maps(), and N.
| TEST_F | ( | RbRkTest | , |
| SelectOperations | |||
| ) |
Definition at line 187 of file avl-rb-rk.cc.
References Aleph::maps(), and N.