|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
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"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) | |
Tests for Tree Node.
Definition in file tree-node.cc.
| 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 | ( | 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 | ( | 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 | ( | Tree_Node | , |
| default_key_is_value_initialized | |||
| ) |
Definition at line 62 of file tree-node.cc.
| 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 | ( | 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 | ( | Tree_Node | , |
| destroy_tree_of_a_deep_chain | |||
| ) |
Definition at line 443 of file tree-node.cc.
References Aleph::destroy_tree(), and root().
| 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 | ( | Tree_Node | , |
| destroy_tree_of_a_tree_of_a_forest | |||
| ) |
Definition at line 422 of file tree-node.cc.
References Aleph::destroy_tree().
| 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 | ( | Tree_Node | , |
| destroy_tree_on_non_leftmost_child_regression | |||
| ) |
Definition at line 275 of file tree-node.cc.
References Aleph::destroy_tree(), Aleph::Tree_Node< T >::get_right_sibling(), Aleph::Tree_Node< T >::is_rightmost(), IS_UNIQUE_SIBLING, and root().
| 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 | ( | 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 | ( | Tree_Node | , |
| get_parent_of_every_child | |||
| ) |
Definition at line 1157 of file tree-node.cc.
References Aleph::destroy_tree(), Aleph::Tree_Node< T >::insert_leftmost_child(), Aleph::Tree_Node< T >::insert_rightmost_child(), and nodes.
| TEST | ( | Tree_Node | , |
| get_parent_tracks_multi_level_tree | |||
| ) |
Definition at line 122 of file tree-node.cc.
References Aleph::Tree_Node< T >::get_parent(), Aleph::Tree_Node< T >::insert_rightmost_child(), and root().
| TEST | ( | Tree_Node | , |
| insert_left_sibling_before_leftmost_child_updates_spine | |||
| ) |
Definition at line 176 of file tree-node.cc.
References Aleph::Tree_Node< T >::get_parent(), Aleph::Tree_Node< T >::insert_left_sibling(), Aleph::Tree_Node< T >::insert_rightmost_child(), Aleph::Tree_Node< T >::is_leftmost(), Aleph::Tree_Node< T >::is_rightmost(), and root().
| TEST | ( | Tree_Node | , |
| insert_leftmost_child_preserves_existing_subtree_parent_links | |||
| ) |
Definition at line 145 of file tree-node.cc.
References Aleph::Tree_Node< T >::get_parent(), Aleph::Tree_Node< T >::insert_rightmost_child(), Aleph::Tree_Node< T >::is_leftmost(), Aleph::Tree_Node< T >::is_rightmost(), and root().
| TEST | ( | Tree_Node | , |
| insert_right_sibling_on_root_links_forest_roots | |||
| ) |
Definition at line 231 of file tree-node.cc.
References Aleph::Tree_Node< T >::get_parent(), Aleph::Tree_Node< T >::get_right_tree(), Aleph::Tree_Node< T >::insert_right_sibling(), and Aleph::Tree_Node< T >::is_root().
| TEST | ( | Tree_Node | , |
| Iterator_on_extreme_cases | |||
| ) |
| TEST | ( | Tree_Node | , |
| on_isolated_node | |||
| ) |
Definition at line 76 of file tree-node.cc.
References Aleph::Tree_Node< T >::children(), Aleph::Tree_Node< T >::get_child(), Aleph::Tree_Node< T >::get_child_list(), Aleph::Tree_Node< T >::Children_Iterator::get_curr(), Aleph::Tree_Node< T >::Iterator::get_curr(), Aleph::Tree_Node< T >::get_it(), Aleph::Tree_Node< T >::get_left_child(), Aleph::Tree_Node< T >::get_left_tree(), Aleph::Tree_Node< T >::get_parent(), Aleph::Tree_Node< T >::get_right_child(), Aleph::Tree_Node< T >::get_right_tree(), Aleph::Tree_Node< T >::get_sibling_list(), Aleph::Tree_Node< T >::Children_Iterator::has_curr(), Aleph::Tree_Node< T >::Iterator::has_curr(), Aleph::Dlink::is_empty(), Aleph::Tree_Node< T >::is_leaf(), Aleph::Tree_Node< T >::is_leftmost(), Aleph::Tree_Node< T >::is_rightmost(), Aleph::Tree_Node< T >::is_root(), Aleph::Tree_Node< T >::Children_Iterator::next(), Aleph::Tree_Node< T >::Iterator::next(), Aleph::Tree_Node< T >::Iterator::reset_first(), and Aleph::Tree_Node< T >::traverse().
| TEST | ( | Tree_Node | , |
| simple_tree_construction_and_destruction | |||
| ) |
Definition at line 586 of file tree-node.cc.
References Aleph::Tree_Node< T >::children(), Aleph::Tree_Node< T >::children_nodes(), Aleph::Tree_Node< T >::get_child(), Aleph::Tree_Node< T >::get_left_child(), Aleph::Tree_Node< T >::get_left_sibling(), Aleph::Tree_Node< T >::get_right_child(), Aleph::Tree_Node< T >::get_right_sibling(), Aleph::Tree_Node< T >::insert_left_sibling(), Aleph::Tree_Node< T >::insert_leftmost_child(), Aleph::Tree_Node< T >::insert_right_sibling(), Aleph::Tree_Node< T >::insert_rightmost_child(), Aleph::Tree_Node< T >::is_leaf(), Aleph::Tree_Node< T >::is_leftmost(), Aleph::Tree_Node< T >::is_rightmost(), Aleph::Tree_Node< T >::is_root(), k, and Aleph::Tree_Node< T >::traverse().
| TEST | ( | Tree_Node | , |
| the_conversions_of_a_wide_tree_need_no_recursion | |||
| ) |
Definition at line 1037 of file tree-node.cc.
References Aleph::are_tree_equal(), Aleph::compute_height(), Aleph::destroy_tree(), root(), and Aleph::tree_preorder_traversal().
| 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 | ( | Tree_Node | , |
| the_functional_operations_take_the_nodes | |||
| ) |
Definition at line 1059 of file tree-node.cc.
References Aleph::destroy_tree(), Aleph::Tree_Node< T >::get_key(), root(), Aleph::sum(), and Aleph::Tree_Node< T >::traverse().
| TEST | ( | Tree_Node | , |
| the_functions_on_a_deep_chain_need_no_recursion | |||
| ) |
Definition at line 987 of file tree-node.cc.
References Aleph::are_tree_equal(), Aleph::clone_tree(), Aleph::compute_height(), Aleph::copy(), Aleph::count(), Aleph::destroy_forest(), Aleph::destroy_tree(), Aleph::deway_search(), root(), Aleph::search_deway(), Aleph::sum(), Aleph::tree_postorder_traversal(), and Aleph::tree_preorder_traversal().
| TEST | ( | Tree_Node | , |
| traverse_on_extreme_cases | |||
| ) |
Definition at line 804 of file tree-node.cc.
| TEST | ( | Tree_Node | , |
| unique_sibling_macro_tracks_sibling_links | |||
| ) |
Definition at line 253 of file tree-node.cc.
References Aleph::Tree_Node< T >::insert_tree_to_right(), IS_UNIQUE_SIBLING, and root().
| TEST_F | ( | Simple_Tree | , |
| clone | |||
| ) |
Definition at line 791 of file tree-node.cc.
References Aleph::clone_tree(), Aleph::destroy_tree(), Aleph::Pair_Iterator< Itor1, Itor2 >::get_curr(), Aleph::HTList::Iterator::has_curr(), and root().
| TEST_F | ( | Simple_Tree | , |
| deway | |||
| ) |
Definition at line 861 of file tree-node.cc.
References root(), and Aleph::search_deway().
| 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 | ( | Simple_Tree | , |
| level_traversal | |||
| ) |
Definition at line 781 of file tree-node.cc.
References root().
| TEST_F | ( | Simple_Tree | , |
| traverse | |||
| ) |
Definition at line 847 of file tree-node.cc.
References LocateFunctions< Container, Type >::get_it(), k, l, r, root(), and Aleph::DynList< T >::size().
| 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 | ( | Three_Trees | , |
| join | |||
| ) |
Definition at line 898 of file tree-node.cc.
References Aleph::DynList< T >::append(), Aleph::clone_tree(), Aleph::destroy_forest(), Aleph::eq(), and l.