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

Tests for Tree Node. More...

#include <gtest/gtest.h>
#include <algorithm>
#include <cstring>
#include <map>
#include <new>
#include <random>
#include <stdexcept>
#include <vector>
#include <tpl_binNode.H>
#include <tpl_tree_node.H>
#include <ah-zip.H>
#include <ah-string-utils.H>
#include "tree-node-common.H"
Include dependency graph for tree-node.cc:

Go to the source code of this file.

Functions

 TEST (Tree_Node, default_key_is_value_initialized)
 
 TEST (Tree_Node, on_isolated_node)
 
 TEST (Tree_Node, get_parent_tracks_multi_level_tree)
 
 TEST (Tree_Node, insert_leftmost_child_preserves_existing_subtree_parent_links)
 
 TEST (Tree_Node, insert_left_sibling_before_leftmost_child_updates_spine)
 
 TEST (Tree_Node, bin_to_forest_preserves_each_forest_root_flag)
 
 TEST (Tree_Node, insert_right_sibling_on_root_links_forest_roots)
 
 TEST (Tree_Node, unique_sibling_macro_tracks_sibling_links)
 
 TEST (Tree_Node, destroy_tree_on_non_leftmost_child_regression)
 
 TEST (Tree_Node, destroy_tree_restores_is_rightmost_on_surviving_sibling)
 
 TEST (Tree_Node, destroy_tree_restores_is_leftmost_on_surviving_sibling)
 
 TEST (Tree_Node, destroy_tree_of_a_leftmost_child_whose_sibling_has_children)
 
 TEST (Tree_Node, destroy_tree_of_the_only_child_makes_the_parent_a_leaf)
 
 TEST (Tree_Node, destroy_tree_of_a_child_with_children_that_is_not_leftmost)
 
 TEST (Tree_Node, destroy_tree_of_a_tree_of_a_forest)
 
 TEST (Tree_Node, destroy_tree_of_a_deep_chain)
 
 TEST (Tree_Node, destroy_tree_keeps_the_rest_of_the_tree)
 
 TEST (Tree_Node, simple_tree_construction_and_destruction)
 
 TEST (Tree_Node, Iterator_on_extreme_cases)
 
 TEST_F (Simple_Tree, Iterators)
 
 TEST (Tree_Node, clone_on_extreme_cases)
 
 TEST_F (Simple_Tree, level_traversal)
 
 TEST_F (Simple_Tree, clone)
 
 TEST (Tree_Node, traverse_on_extreme_cases)
 
 TEST (Tree_Node, are_tree_equal_uses_custom_comparator_recursively)
 
 TEST_F (Simple_Tree, traverse)
 
 TEST_F (Simple_Tree, deway)
 
 TEST_F (Three_Trees, insertion_of_trees)
 
 TEST_F (Three_Trees, join)
 
 TEST (Tree_Node, the_functions_on_a_deep_chain_need_no_recursion)
 
 TEST (Tree_Node, the_conversions_of_a_wide_tree_need_no_recursion)
 
 TEST (Tree_Node, the_functional_operations_take_the_nodes)
 
 TEST (Tree_Node, the_copies_of_a_tree_leave_nothing_when_a_key_throws)
 
 TEST (Tree_Node, get_parent_of_every_child)
 

Detailed Description

Tests for Tree Node.

Definition in file tree-node.cc.

Function Documentation

◆ TEST() [1/27]

TEST ( Tree_Node  ,
are_tree_equal_uses_custom_comparator_recursively   
)

Definition at line 818 of file tree-node.cc.

References Aleph::are_tree_equal(), and Aleph::destroy_tree().

◆ TEST() [2/27]

TEST ( Tree_Node  ,
bin_to_forest_preserves_each_forest_root_flag   
)

Definition at line 207 of file tree-node.cc.

References Aleph::count(), Aleph::destroy_forest(), and RLINK.

◆ TEST() [3/27]

TEST ( Tree_Node  ,
clone_on_extreme_cases   
)

Definition at line 766 of file tree-node.cc.

References Aleph::clone_tree(), Aleph::destroy_tree(), and root().

◆ TEST() [4/27]

TEST ( Tree_Node  ,
default_key_is_value_initialized   
)

Definition at line 62 of file tree-node.cc.

◆ TEST() [5/27]

TEST ( Tree_Node  ,
destroy_tree_keeps_the_rest_of_the_tree   
)

Definition at line 521 of file tree-node.cc.

References Aleph::destroy_tree(), nodes, and root().

◆ TEST() [6/27]

TEST ( Tree_Node  ,
destroy_tree_of_a_child_with_children_that_is_not_leftmost   
)

Definition at line 401 of file tree-node.cc.

References Aleph::destroy_tree(), and root().

◆ TEST() [7/27]

TEST ( Tree_Node  ,
destroy_tree_of_a_deep_chain   
)

Definition at line 443 of file tree-node.cc.

References Aleph::destroy_tree(), and root().

◆ TEST() [8/27]

TEST ( Tree_Node  ,
destroy_tree_of_a_leftmost_child_whose_sibling_has_children   
)

Definition at line 353 of file tree-node.cc.

References Aleph::destroy_tree(), and root().

◆ TEST() [9/27]

TEST ( Tree_Node  ,
destroy_tree_of_a_tree_of_a_forest   
)

Definition at line 422 of file tree-node.cc.

References Aleph::destroy_tree().

◆ TEST() [10/27]

TEST ( Tree_Node  ,
destroy_tree_of_the_only_child_makes_the_parent_a_leaf   
)

Definition at line 381 of file tree-node.cc.

References Aleph::destroy_tree(), and root().

◆ TEST() [11/27]

TEST ( Tree_Node  ,
destroy_tree_on_non_leftmost_child_regression   
)

◆ TEST() [12/27]

TEST ( Tree_Node  ,
destroy_tree_restores_is_leftmost_on_surviving_sibling   
)

Definition at line 325 of file tree-node.cc.

References Aleph::count(), Aleph::destroy_tree(), and root().

◆ TEST() [13/27]

TEST ( Tree_Node  ,
destroy_tree_restores_is_rightmost_on_surviving_sibling   
)

Definition at line 297 of file tree-node.cc.

References Aleph::count(), Aleph::destroy_tree(), and root().

◆ TEST() [14/27]

TEST ( Tree_Node  ,
get_parent_of_every_child   
)

◆ TEST() [15/27]

TEST ( Tree_Node  ,
get_parent_tracks_multi_level_tree   
)

◆ TEST() [16/27]

◆ TEST() [17/27]

TEST ( Tree_Node  ,
insert_leftmost_child_preserves_existing_subtree_parent_links   
)

◆ TEST() [18/27]

TEST ( Tree_Node  ,
insert_right_sibling_on_root_links_forest_roots   
)

◆ TEST() [19/27]

◆ TEST() [20/27]

◆ TEST() [21/27]

◆ TEST() [22/27]

TEST ( Tree_Node  ,
the_conversions_of_a_wide_tree_need_no_recursion   
)

◆ TEST() [23/27]

TEST ( Tree_Node  ,
the_copies_of_a_tree_leave_nothing_when_a_key_throws   
)

Definition at line 1112 of file tree-node.cc.

References Aleph::clone_tree(), Aleph::destroy_tree(), k, nodes, and root().

◆ TEST() [24/27]

TEST ( Tree_Node  ,
the_functional_operations_take_the_nodes   
)

◆ TEST() [25/27]

◆ TEST() [26/27]

TEST ( Tree_Node  ,
traverse_on_extreme_cases   
)

Definition at line 804 of file tree-node.cc.

References k, and root().

◆ TEST() [27/27]

TEST ( Tree_Node  ,
unique_sibling_macro_tracks_sibling_links   
)

◆ TEST_F() [1/7]

◆ TEST_F() [2/7]

TEST_F ( Simple_Tree  ,
deway   
)

Definition at line 861 of file tree-node.cc.

References root(), and Aleph::search_deway().

◆ TEST_F() [3/7]

TEST_F ( Simple_Tree  ,
Iterators   
)

Definition at line 757 of file tree-node.cc.

References LocateFunctions< Container, Type >::get_it(), k, l, and root().

◆ TEST_F() [4/7]

TEST_F ( Simple_Tree  ,
level_traversal   
)

Definition at line 781 of file tree-node.cc.

References root().

◆ TEST_F() [5/7]

TEST_F ( Simple_Tree  ,
traverse   
)

◆ TEST_F() [6/7]

TEST_F ( Three_Trees  ,
insertion_of_trees   
)

Definition at line 881 of file tree-node.cc.

References Aleph::clone_tree(), Aleph::destroy_forest(), and Aleph::zip_for_each().

◆ TEST_F() [7/7]

TEST_F ( Three_Trees  ,
join   
)