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

Tests for Tpl Components. More...

#include <gtest/gtest.h>
#include <tpl_components.H>
#include <tpl_graph.H>
#include <tpl_sgraph.H>
#include <tpl_agraph.H>
Include dependency graph for tpl_components_test.cc:

Go to the source code of this file.

Classes

class  BuildSubgraphTest
 
class  InconnectedComponentsTest
 
class  ComponentsAllGraphs< GraphType >
 
class  ComponentsUndirectedGraphs< GraphType >
 

Typedefs

using ListGraph = List_Graph< Graph_Node< int >, Graph_Arc< int > >
 
using ListDigraph = List_Digraph< Graph_Node< int >, Graph_Arc< int > >
 
using SparseGraph = List_SGraph< Graph_Snode< int >, Graph_Sarc< int > >
 
using SparseDigraph = List_SDigraph< Graph_Snode< int >, Graph_Sarc< int > >
 
using ArrayGraph = Array_Graph< Graph_Anode< int >, Graph_Aarc< int > >
 
using ArrayDigraph = Array_Digraph< Graph_Anode< int >, Graph_Aarc< int > >
 
using GraphTypes = ::testing::Types< ListGraph, ListDigraph, SparseGraph, SparseDigraph, ArrayGraph, ArrayDigraph >
 
using UndirectedGraphTypes = ::testing::Types< ListGraph, SparseGraph, ArrayGraph >
 

Functions

 TEST_F (BuildSubgraphTest, SingleNode)
 
 TEST_F (BuildSubgraphTest, TwoNodesConnected)
 
 TEST_F (BuildSubgraphTest, TriangleGraph)
 
 TEST_F (BuildSubgraphTest, DisconnectedGraph_BuildsOneComponent)
 
 TEST_F (BuildSubgraphTest, NodeMapping)
 
 TEST_F (BuildSubgraphTest, ReturnSubgraph)
 
 TEST_F (BuildSubgraphTest, BuildNodeList)
 
 TEST_F (BuildSubgraphTest, NullptrThrows)
 
 TEST_F (InconnectedComponentsTest, SingleComponent)
 
 TEST_F (InconnectedComponentsTest, TwoComponents)
 
 TEST_F (InconnectedComponentsTest, ThreeComponents)
 
 TEST_F (InconnectedComponentsTest, EmptyGraph)
 
 TEST_F (InconnectedComponentsTest, ComputeAsNodeLists)
 
 TEST_F (InconnectedComponentsTest, CountComponents)
 
 TEST_F (InconnectedComponentsTest, IsConnected_True)
 
 TEST_F (InconnectedComponentsTest, IsConnected_False)
 
 TEST_F (InconnectedComponentsTest, IsConnected_EmptyGraph)
 
 TEST_F (InconnectedComponentsTest, IsConnected_SingleNode)
 
 TEST_F (InconnectedComponentsTest, ManyComponents)
 
 TEST_F (InconnectedComponentsTest, LargeConnectedGraph)
 
 TYPED_TEST_SUITE (ComponentsAllGraphs, GraphTypes)
 
 TYPED_TEST_SUITE (ComponentsUndirectedGraphs, UndirectedGraphTypes)
 
 TYPED_TEST (ComponentsAllGraphs, BuildSubgraphSingleNode)
 
 TYPED_TEST (ComponentsAllGraphs, BuildSubgraphTriangle)
 
 TYPED_TEST (ComponentsAllGraphs, BuildSubgraphNullptrThrows)
 
 TYPED_TEST (ComponentsUndirectedGraphs, SingleComponent)
 
 TYPED_TEST (ComponentsUndirectedGraphs, TwoComponents)
 
 TYPED_TEST (ComponentsUndirectedGraphs, CountComponents)
 
 TYPED_TEST (ComponentsUndirectedGraphs, IsConnectedTrue)
 
 TYPED_TEST (ComponentsUndirectedGraphs, IsConnectedFalse)
 
 TYPED_TEST (ComponentsUndirectedGraphs, EmptyGraphIsConnected)
 
int main (int argc, char **argv)
 

Detailed Description

Tests for Tpl Components.

Definition in file tpl_components_test.cc.

Typedef Documentation

◆ ArrayDigraph

Definition at line 72 of file tpl_components_test.cc.

◆ ArrayGraph

Definition at line 71 of file tpl_components_test.cc.

◆ GraphTypes

Definition at line 413 of file tpl_components_test.cc.

◆ ListDigraph

Definition at line 64 of file tpl_components_test.cc.

◆ ListGraph

using ListGraph = List_Graph<Graph_Node<int>, Graph_Arc<int> >

Definition at line 63 of file tpl_components_test.cc.

◆ SparseDigraph

Definition at line 68 of file tpl_components_test.cc.

◆ SparseGraph

Definition at line 67 of file tpl_components_test.cc.

◆ UndirectedGraphTypes

using UndirectedGraphTypes = ::testing::Types< ListGraph, SparseGraph, ArrayGraph >

Definition at line 433 of file tpl_components_test.cc.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 586 of file tpl_components_test.cc.

References Aleph::maps().

◆ TEST_F() [1/20]

TEST_F ( BuildSubgraphTest  ,
BuildNodeList   
)

Definition at line 203 of file tpl_components_test.cc.

References Aleph::maps(), and Aleph::HTList::size().

◆ TEST_F() [2/20]

TEST_F ( BuildSubgraphTest  ,
DisconnectedGraph_BuildsOneComponent   
)

Definition at line 143 of file tpl_components_test.cc.

References Aleph::maps().

◆ TEST_F() [3/20]

TEST_F ( BuildSubgraphTest  ,
NodeMapping   
)

Definition at line 165 of file tpl_components_test.cc.

References Aleph::maps().

◆ TEST_F() [4/20]

TEST_F ( BuildSubgraphTest  ,
NullptrThrows   
)

Definition at line 220 of file tpl_components_test.cc.

References Aleph::maps().

◆ TEST_F() [5/20]

TEST_F ( BuildSubgraphTest  ,
ReturnSubgraph   
)

Definition at line 186 of file tpl_components_test.cc.

References Aleph::maps().

◆ TEST_F() [6/20]

TEST_F ( BuildSubgraphTest  ,
SingleNode   
)

◆ TEST_F() [7/20]

TEST_F ( BuildSubgraphTest  ,
TriangleGraph   
)

Definition at line 125 of file tpl_components_test.cc.

References Aleph::maps().

◆ TEST_F() [8/20]

TEST_F ( BuildSubgraphTest  ,
TwoNodesConnected   
)

Definition at line 110 of file tpl_components_test.cc.

References Aleph::maps().

◆ TEST_F() [9/20]

TEST_F ( InconnectedComponentsTest  ,
ComputeAsNodeLists   
)

Definition at line 297 of file tpl_components_test.cc.

References Aleph::maps(), and Aleph::HTList::size().

◆ TEST_F() [10/20]

TEST_F ( InconnectedComponentsTest  ,
CountComponents   
)

Definition at line 313 of file tpl_components_test.cc.

References Aleph::maps().

◆ TEST_F() [11/20]

TEST_F ( InconnectedComponentsTest  ,
EmptyGraph   
)

Definition at line 288 of file tpl_components_test.cc.

References Aleph::maps(), and Aleph::HTList::size().

◆ TEST_F() [12/20]

TEST_F ( InconnectedComponentsTest  ,
IsConnected_EmptyGraph   
)

Definition at line 353 of file tpl_components_test.cc.

References Aleph::maps().

◆ TEST_F() [13/20]

TEST_F ( InconnectedComponentsTest  ,
IsConnected_False   
)

Definition at line 340 of file tpl_components_test.cc.

References Aleph::maps().

◆ TEST_F() [14/20]

TEST_F ( InconnectedComponentsTest  ,
IsConnected_SingleNode   
)

Definition at line 360 of file tpl_components_test.cc.

References Aleph::maps().

◆ TEST_F() [15/20]

TEST_F ( InconnectedComponentsTest  ,
IsConnected_True   
)

Definition at line 327 of file tpl_components_test.cc.

References Aleph::maps().

◆ TEST_F() [16/20]

TEST_F ( InconnectedComponentsTest  ,
LargeConnectedGraph   
)

Definition at line 384 of file tpl_components_test.cc.

References Aleph::DynArray< T >::append(), Aleph::maps(), N, and nodes.

◆ TEST_F() [17/20]

TEST_F ( InconnectedComponentsTest  ,
ManyComponents   
)

Definition at line 373 of file tpl_components_test.cc.

References Aleph::maps().

◆ TEST_F() [18/20]

TEST_F ( InconnectedComponentsTest  ,
SingleComponent   
)

◆ TEST_F() [19/20]

TEST_F ( InconnectedComponentsTest  ,
ThreeComponents   
)

Definition at line 274 of file tpl_components_test.cc.

References Aleph::maps(), and Aleph::HTList::size().

◆ TEST_F() [20/20]

TEST_F ( InconnectedComponentsTest  ,
TwoComponents   
)

Definition at line 249 of file tpl_components_test.cc.

References Aleph::maps(), and Aleph::HTList::size().

◆ TYPED_TEST() [1/9]

TYPED_TEST ( ComponentsAllGraphs  ,
BuildSubgraphNullptrThrows   
)

◆ TYPED_TEST() [2/9]

◆ TYPED_TEST() [3/9]

◆ TYPED_TEST() [4/9]

TYPED_TEST ( ComponentsUndirectedGraphs  ,
CountComponents   
)

◆ TYPED_TEST() [5/9]

TYPED_TEST ( ComponentsUndirectedGraphs  ,
EmptyGraphIsConnected   
)

Definition at line 575 of file tpl_components_test.cc.

References Aleph::maps().

◆ TYPED_TEST() [6/9]

◆ TYPED_TEST() [7/9]

◆ TYPED_TEST() [8/9]

◆ TYPED_TEST() [9/9]

◆ TYPED_TEST_SUITE() [1/2]

TYPED_TEST_SUITE ( ComponentsAllGraphs  ,
GraphTypes   
)

◆ TYPED_TEST_SUITE() [2/2]

TYPED_TEST_SUITE ( ComponentsUndirectedGraphs  ,
UndirectedGraphTypes   
)