|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
GoogleTest suite for Prim.H. More...
#include <gtest/gtest.h>#include <functional>#include <limits>#include <new>#include <random>#include <set>#include <stdexcept>#include <vector>#include <Prim.H>#include <Kruskal.H>#include <tpl_graph.H>#include <tpl_graph_utils.H>#include <tpl_sgraph.H>Go to the source code of this file.
Typedefs | |
| using | GT = List_Graph< Graph_Node< int >, Graph_Arc< int > > |
| using | Node = GT::Node |
| using | Arc = GT::Arc |
Functions | |
| TEST (PrimBasic, EmptyGraph) | |
| TEST (PrimBasic, SingleNode) | |
| TEST (PrimBasic, TwoNodesOneArc) | |
| TEST (PrimBasic, TriangleGraph) | |
| TEST (PrimBasic, SquareGraph) | |
| TEST (PrimVsKruskal, SameWeightOnSimpleGraph) | |
| TEST (PrimVsKruskal, RandomGraph) | |
| TEST (PrimEdgeCases, AllEqualWeights) | |
| TEST (PrimEdgeCases, LinearGraph) | |
| TEST (PrimEdgeCases, StarGraph) | |
| TEST (PrimStress, LargeGraph) | |
| TEST (PrimStress, DenseGraph) | |
| TEST (PrimMapping, NodesAreMapped) | |
| TEST (PrimTextbook, ClassicExample) | |
| TEST (PrimDistance, UsesTheDistanceItWasGiven) | |
| TEST (PrimDistance, MatchesKruskalWithTheGivenDistance) | |
| TEST (PrimDistance, TakesADistanceWithoutADefaultConstructor) | |
| TEST (PrimPainting, PaintsTheArcsOfTheTree) | |
| TEST (PrimPainting, LeavesOutALoopOnTheFirstNode) | |
| TEST (PrimPainting, LeavesTheCookiesNullWithALoopOnTheFirstNode) | |
| TEST (PrimMapping, LeavesOutALoopOnTheFirstNode) | |
| TEST (PrimExceptions, DistanceThatThrowsLeavesTheGraphReusable) | |
| TEST (PrimExceptions, ANodeOfTheTreeThatCannotBeCreatedLeaksNothing) | |
| TYPED_TEST_SUITE (PrimMappingTest, Representations) | |
| TYPED_TEST (PrimMappingTest, NodesAndArcsMapBothWays) | |
GoogleTest suite for Prim.H.
This file contains exhaustive tests to verify the correctness of Prim's minimum spanning tree algorithm implementation in Aleph-w.
Tests for Prim
Definition in file prim_test.cc.
Definition at line 34 of file prim_test.cc.
| using GT = List_Graph<Graph_Node<int>, Graph_Arc<int> > |
Definition at line 32 of file prim_test.cc.
Definition at line 33 of file prim_test.cc.
| TEST | ( | PrimBasic | , |
| EmptyGraph | |||
| ) |
Definition at line 94 of file prim_test.cc.
| TEST | ( | PrimBasic | , |
| SingleNode | |||
| ) |
Definition at line 105 of file prim_test.cc.
References GraphCommon< GT, Node, Arc >::get_num_arcs(), GraphCommon< GT, Node, Arc >::get_num_nodes(), and Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node().
| TEST | ( | PrimBasic | , |
| SquareGraph | |||
| ) |
| TEST | ( | PrimBasic | , |
| TriangleGraph | |||
| ) |
| TEST | ( | PrimBasic | , |
| TwoNodesOneArc | |||
| ) |
| TEST | ( | PrimDistance | , |
| MatchesKruskalWithTheGivenDistance | |||
| ) |
Definition at line 552 of file prim_test.cc.
References Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), N, nodes, and rng.
| TEST | ( | PrimDistance | , |
| TakesADistanceWithoutADefaultConstructor | |||
| ) |
Definition at line 592 of file prim_test.cc.
References Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), and Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node().
| TEST | ( | PrimDistance | , |
| UsesTheDistanceItWasGiven | |||
| ) |
Definition at line 530 of file prim_test.cc.
References Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), and Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node().
| TEST | ( | PrimEdgeCases | , |
| AllEqualWeights | |||
| ) |
| TEST | ( | PrimEdgeCases | , |
| LinearGraph | |||
| ) |
| TEST | ( | PrimEdgeCases | , |
| StarGraph | |||
| ) |
| TEST | ( | PrimExceptions | , |
| ANodeOfTheTreeThatCannotBeCreatedLeaksNothing | |||
| ) |
Definition at line 886 of file prim_test.cc.
References Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), k, NODE_COOKIE, and nodes.
| TEST | ( | PrimExceptions | , |
| DistanceThatThrowsLeavesTheGraphReusable | |||
| ) |
Definition at line 795 of file prim_test.cc.
References GraphCommon< GT, Node, Arc >::get_node_it(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), k, m, N, NODE_COOKIE, nodes, and rng.
| TEST | ( | PrimMapping | , |
| LeavesOutALoopOnTheFirstNode | |||
| ) |
Definition at line 728 of file prim_test.cc.
References Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), IS_ARC_VISITED, and Aleph::Spanning_Tree.
| TEST | ( | PrimMapping | , |
| NodesAreMapped | |||
| ) |
Definition at line 410 of file prim_test.cc.
References GraphCommon< GT, Node, Arc >::get_node_it(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), and Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node().
| TEST | ( | PrimPainting | , |
| LeavesOutALoopOnTheFirstNode | |||
| ) |
Definition at line 665 of file prim_test.cc.
References Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), IS_ARC_VISITED, and Aleph::Spanning_Tree.
| TEST | ( | PrimPainting | , |
| LeavesTheCookiesNullWithALoopOnTheFirstNode | |||
| ) |
Definition at line 688 of file prim_test.cc.
References Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), and NODE_COOKIE.
| TEST | ( | PrimPainting | , |
| PaintsTheArcsOfTheTree | |||
| ) |
Definition at line 632 of file prim_test.cc.
References Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), and Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node().
| TEST | ( | PrimStress | , |
| DenseGraph | |||
| ) |
Definition at line 373 of file prim_test.cc.
References GraphCommon< GT, Node, Arc >::get_num_arcs(), GraphCommon< GT, Node, Arc >::get_num_nodes(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), N, nodes, and rng.
| TEST | ( | PrimStress | , |
| LargeGraph | |||
| ) |
Definition at line 332 of file prim_test.cc.
References GraphCommon< GT, Node, Arc >::get_num_arcs(), GraphCommon< GT, Node, Arc >::get_num_nodes(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), N, nodes, and rng.
| TEST | ( | PrimTextbook | , |
| ClassicExample | |||
| ) |
| TEST | ( | PrimVsKruskal | , |
| RandomGraph | |||
| ) |
Definition at line 215 of file prim_test.cc.
References Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), N, nodes, and rng.
| TEST | ( | PrimVsKruskal | , |
| SameWeightOnSimpleGraph | |||
| ) |
Definition at line 185 of file prim_test.cc.
References Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), and Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node().
| TYPED_TEST | ( | PrimMappingTest | , |
| NodesAndArcsMapBothWays | |||
| ) |
Definition at line 942 of file prim_test.cc.
References Aleph::and, GraphCommon< GT, Node, Arc >::get_arc_it(), GraphCommon< GT, Node, Arc >::get_node_it(), GraphCommon< GT, Node, Arc >::get_num_arcs(), GraphCommon< GT, Node, Arc >::get_num_nodes(), GraphCommon< GT, Node, Arc >::get_src_node(), GraphCommon< GT, Node, Arc >::get_tgt_node(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), N, nodes, and rng.
| TYPED_TEST_SUITE | ( | PrimMappingTest | , |
| Representations | |||
| ) |