Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
rand-tree.cc File Reference

Tests for Rand Tree. More...

#include <gtest/gtest.h>
#include <tpl_rand_tree.H>
#include <tpl_binNodeUtils.H>
#include <random>
#include <set>
#include <vector>
#include <algorithm>
Include dependency graph for rand-tree.cc:

Go to the source code of this file.

Classes

class  NodePool
 

Typedefs

using Tree = Rand_Tree< int >
 
using Node = Tree::Node
 

Functions

template<typename NodeT >
std::vector< int > inorder_keys (NodeT *root)
 
 TEST (RandTree, EmptyTreeProperties)
 
 TEST (RandTree, SearchOnEmptyTreeReturnsNull)
 
 TEST (RandTree, RemoveFromEmptyTreeReturnsNull)
 
 TEST (RandTree, InsertSingleElement)
 
 TEST (RandTree, InsertMultipleElements)
 
 TEST (RandTree, InsertRejectsDuplicates)
 
 TEST (RandTree, InsertDupAllowsDuplicates)
 
 TEST (RandTree, InsertInAscendingOrder)
 
 TEST (RandTree, InsertInDescendingOrder)
 
 TEST (RandTree, SearchFindsExistingKey)
 
 TEST (RandTree, SearchReturnsNullForMissingKey)
 
 TEST (RandTree, SearchOrInsertReturnsExisting)
 
 TEST (RandTree, SearchOrInsertInsertsNew)
 
 TEST (RandTree, RemoveExistingKey)
 
 TEST (RandTree, RemoveReturnsNullForMissingKey)
 
 TEST (RandTree, RemoveRoot)
 
 TEST (RandTree, RemoveAllElements)
 
 TEST (RandTree, RemoveInOrder)
 
 TEST (RandTree, RemoveInReverseOrder)
 
 TEST (RandTree, SelectReturnsCorrectNode)
 
 TEST (RandTree, SelectOutOfRangeThrows)
 
 TEST (RandTree, PositionOfExistingKey)
 
 TEST (RandTree, PositionOfMissingKey)
 
 TEST (RandTree, FindPositionOfExistingKey)
 
 TEST (RandTree, FindPositionOfMissingKeyInMiddle)
 
 TEST (RandTree, FindPositionLessThanMin)
 
 TEST (RandTree, FindPositionGreaterThanMax)
 
 TEST (RandTree, RemovePosValidPosition)
 
 TEST (RandTree, RemovePosFirst)
 
 TEST (RandTree, RemovePosLast)
 
 TEST (RandTree, SplitKeyNotInTree)
 
 TEST (RandTree, SplitKeyInTree)
 
 TEST (RandTree, SplitKeyDup)
 
 TEST (RandTree, SplitPos)
 
 TEST (RandTree, JoinWithNoDuplicates)
 
 TEST (RandTree, JoinWithDuplicates)
 
 TEST (RandTree, JoinDup)
 
 TEST (RandTree, JoinExclusive)
 
 TEST (RandTree, IteratorTraversesInOrder)
 
 TEST (RandTree, IteratorOnEmptyTree)
 
 TEST (RandTree, IteratorAfterRemoval)
 
 TEST (RandTree, SwapTrees)
 
 TEST (RandTree, SeedAffectsStructure)
 
 TEST (RandTree, CustomComparatorGreater)
 
 TEST (RandTree, NegativeKeys)
 
 TEST (RandTree, SingleElementOperations)
 
 TEST (RandTree, RandomInsertSearchRemove)
 
 TEST (RandTree, LargeTreeOperations)
 
 TEST (RandTreeVtl, BasicOperations)
 
 TEST (RandTree, VerifyDetectsValidTree)
 
 TEST (RandTree, GetRootReturnsReference)
 
 TEST (RandTree, KeyCompAndGetCompare)
 
 TEST (RandTree, GslRngObjectNotNull)
 
 TEST (RandTree, SetSeedChangesSequence)
 

Detailed Description

Tests for Rand Tree.

Definition in file rand-tree.cc.

Typedef Documentation

◆ Node

using Node = Tree::Node

Definition at line 55 of file rand-tree.cc.

◆ Tree

using Tree = Rand_Tree<int>

Definition at line 54 of file rand-tree.cc.

Function Documentation

◆ inorder_keys()

template<typename NodeT >
std::vector< int > inorder_keys ( NodeT *  root)

◆ TEST() [1/54]

TEST ( RandTree  ,
CustomComparatorGreater   
)

Definition at line 875 of file rand-tree.cc.

References KEY, Aleph::maps(), and nodes.

◆ TEST() [2/54]

◆ TEST() [3/54]

◆ TEST() [4/54]

◆ TEST() [5/54]

◆ TEST() [6/54]

TEST ( RandTree  ,
FindPositionOfMissingKeyInMiddle   
)

◆ TEST() [7/54]

◆ TEST() [8/54]

TEST ( RandTree  ,
GslRngObjectNotNull   
)

◆ TEST() [9/54]

◆ TEST() [10/54]

◆ TEST() [11/54]

◆ TEST() [12/54]

◆ TEST() [13/54]

◆ TEST() [14/54]

◆ TEST() [15/54]

◆ TEST() [16/54]

TEST ( RandTree  ,
IteratorOnEmptyTree   
)

Definition at line 792 of file rand-tree.cc.

References Aleph::BinNodeInfixIterator< Node >::has_curr(), and Aleph::maps().

◆ TEST() [17/54]

TEST ( RandTree  ,
IteratorTraversesInOrder   
)

◆ TEST() [18/54]

TEST ( RandTree  ,
JoinDup   
)

Definition at line 732 of file rand-tree.cc.

References Aleph::DynList< T >::insert(), Aleph::maps(), and Aleph::HTList::size().

◆ TEST() [19/54]

TEST ( RandTree  ,
JoinExclusive   
)

Definition at line 750 of file rand-tree.cc.

References Aleph::DynList< T >::insert(), Aleph::maps(), and Aleph::HTList::size().

◆ TEST() [20/54]

◆ TEST() [21/54]

TEST ( RandTree  ,
JoinWithNoDuplicates   
)

◆ TEST() [22/54]

◆ TEST() [23/54]

◆ TEST() [24/54]

◆ TEST() [25/54]

◆ TEST() [26/54]

◆ TEST() [27/54]

◆ TEST() [28/54]

◆ TEST() [29/54]

◆ TEST() [30/54]

TEST ( RandTree  ,
RemoveFromEmptyTreeReturnsNull   
)

◆ TEST() [31/54]

◆ TEST() [32/54]

◆ TEST() [33/54]

◆ TEST() [34/54]

◆ TEST() [35/54]

◆ TEST() [36/54]

◆ TEST() [37/54]

◆ TEST() [38/54]

◆ TEST() [39/54]

TEST ( RandTree  ,
SearchOnEmptyTreeReturnsNull   
)

◆ TEST() [40/54]

◆ TEST() [41/54]

◆ TEST() [42/54]

TEST ( RandTree  ,
SearchReturnsNullForMissingKey   
)

◆ TEST() [43/54]

TEST ( RandTree  ,
SeedAffectsStructure   
)

Definition at line 846 of file rand-tree.cc.

References Aleph::DynList< T >::insert(), Aleph::maps(), and Aleph::HTList::size().

◆ TEST() [44/54]

◆ TEST() [45/54]

◆ TEST() [46/54]

TEST ( RandTree  ,
SetSeedChangesSequence   
)

◆ TEST() [47/54]

◆ TEST() [48/54]

◆ TEST() [49/54]

◆ TEST() [50/54]

◆ TEST() [51/54]

◆ TEST() [52/54]

TEST ( RandTree  ,
SwapTrees   
)

◆ TEST() [53/54]

◆ TEST() [54/54]

TEST ( RandTreeVtl  ,
BasicOperations   
)

Definition at line 1055 of file rand-tree.cc.

References Aleph::maps().