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

Tests for Netcapgraph. More...

#include <gtest/gtest.h>
#include <random>
#include <set>
#include <map>
#include <string>
#include <sstream>
#include <cmath>
#include <tpl_netcapgraph.H>
#include <tpl_net.H>
Include dependency graph for netcapgraph_test.cc:

Go to the source code of this file.

Classes

class  NetCapGraphEdgeCases
 
class  NetCapGraphStructure
 
class  NetCapGraphRealistic
 
class  NetCapGraphStress
 
class  NetCapGraphValidation
 
class  NetCapGraphIntegerFlow
 
class  NetCapGraphStringInfo
 
class  NetCapGraphCookies
 
class  NetCapGraphFuzz
 

Typedefs

using DefaultNode = Net_Cap_Node< Empty_Class, double >
 
using DefaultArc = Net_Arc< Empty_Class, double >
 
using DefaultNet = Net_Cap_Graph< DefaultNode, DefaultArc >
 
using IntNode = Net_Cap_Node< int, long >
 
using IntArc = Net_Arc< int, long >
 
using IntNet = Net_Cap_Graph< IntNode, IntArc >
 
using StringNode = Net_Cap_Node< string, double >
 
using StringArc = Net_Arc< string, double >
 
using StringNet = Net_Cap_Graph< StringNode, StringArc >
 

Functions

 TEST_F (NetCapGraphEdgeCases, EmptyNetwork_NoNodes)
 
 TEST_F (NetCapGraphEdgeCases, EmptyNetwork_ComputeAuxNetFails)
 
 TEST_F (NetCapGraphEdgeCases, SingleNode_UnlimitedCapacity)
 
 TEST_F (NetCapGraphEdgeCases, SingleNode_SpecificCapacity)
 
 TEST_F (NetCapGraphEdgeCases, SingleNode_ZeroCapacity)
 
 TEST_F (NetCapGraphEdgeCases, SingleNode_NegativeCapacityThrows)
 
 TEST_F (NetCapGraphEdgeCases, CapacityBoundary_MaxDouble)
 
 TEST_F (NetCapGraphEdgeCases, CapacityBoundary_SmallPositive)
 
 TEST_F (NetCapGraphEdgeCases, CapacityBoundary_Epsilon)
 
 TEST_F (NetCapGraphEdgeCases, Arc_ZeroCapacity)
 
 TEST_F (NetCapGraphEdgeCases, Arc_FlowEqualsCapacity)
 
 TEST_F (NetCapGraphEdgeCases, Arc_FlowExceedsCapacityThrows)
 
 TEST_F (NetCapGraphEdgeCases, AuxNet_DoubleComputeThrows)
 
 TEST_F (NetCapGraphEdgeCases, AuxNet_FreeWithoutComputeThrows)
 
 TEST_F (NetCapGraphEdgeCases, AuxNet_UpdateWithoutComputeThrows)
 
 TEST_F (NetCapGraphEdgeCases, AuxNet_ComputeFreeCycle)
 
 TEST_F (NetCapGraphEdgeCases, CopyConstruction)
 
 TEST_F (NetCapGraphEdgeCases, MoveConstruction)
 
 TEST_F (NetCapGraphStructure, LinearNetwork_ThreeNodes)
 
 TEST_F (NetCapGraphStructure, LinearNetwork_TenNodes)
 
 TEST_F (NetCapGraphStructure, StarNetwork_FiveSpokes)
 
 TEST_F (NetCapGraphStructure, DiamondNetwork)
 
 TEST_F (NetCapGraphStructure, CompleteNetwork_FiveNodes)
 
 TEST_F (NetCapGraphStructure, BipartiteNetwork)
 
 TEST_F (NetCapGraphRealistic, DataCenterNetwork)
 
 TEST_F (NetCapGraphRealistic, WaterDistributionNetwork)
 
 TEST_F (NetCapGraphRealistic, TrafficNetwork)
 
 TEST_F (NetCapGraphStress, LargeRandomNetwork)
 
 TEST_F (NetCapGraphStress, DeepChainNetwork)
 
 TEST_F (NetCapGraphStress, WideNetwork)
 
 TEST_F (NetCapGraphValidation, ResetFlows)
 
 TEST_F (NetCapGraphValidation, CheckNodeCapacities_Valid)
 
 TEST_F (NetCapGraphValidation, CheckNodeCapacities_Invalid)
 
 TEST_F (NetCapGraphValidation, SetNodeCapacity_Valid)
 
 TEST_F (NetCapGraphValidation, SetNodeCapacity_Invalid)
 
 TEST_F (NetCapGraphValidation, SetNodeCapacity_Negative)
 
 TEST_F (NetCapGraphIntegerFlow, BasicOperations)
 
 TEST_F (NetCapGraphIntegerFlow, AuxNetWithIntegers)
 
 TEST_F (NetCapGraphStringInfo, BasicOperations)
 
 TEST_F (NetCapGraphStringInfo, AuxNetWithStrings)
 
 TEST_F (NetCapGraphCookies, NodeToCookieMapping)
 
 TEST_F (NetCapGraphCookies, ArcToCookieMapping)
 
 TEST_F (NetCapGraphFuzz, RandomOperations)
 
 TEST_F (NetCapGraphFuzz, ExtremeCapacityValues)
 
 TEST (NetCapGraphChangedNetwork, UpdateTakesAnUnchangedNetwork)
 
 TEST (NetCapGraphChangedNetwork, UpdateTakesTheNetworkInAnotherOrder)
 
 TEST (NetCapGraphChangedNetwork, UpdateRefusesItAfterACopyOverTheNetwork)
 
 TEST (NetCapGraphChangedNetwork, UpdateRefusesItAfterARemoval)
 
 TEST (NetCapGraphChangedNetwork, UpdateRefusesItAfterADisconnection)
 
 TEST (NetCapGraphChangedNetwork, UpdateRefusesItAfterASwapThroughTheBase)
 
 TEST (NetCapGraphChangedNetwork, UpdateTakesItAfterASwapWithItself)
 
 TEST (NetCapGraphChangedNetwork, UpdateRefusesItAfterAnInsertion)
 
 TEST (NetCapGraphChangedNetwork, TheMarkGoesWithTheAuxiliaryNetwork)
 
int main (int argc, char **argv)
 

Detailed Description

Tests for Netcapgraph.

Definition in file netcapgraph_test.cc.

Typedef Documentation

◆ DefaultArc

using DefaultArc = Net_Arc<Empty_Class, double>

Definition at line 56 of file netcapgraph_test.cc.

◆ DefaultNet

Definition at line 57 of file netcapgraph_test.cc.

◆ DefaultNode

Definition at line 55 of file netcapgraph_test.cc.

◆ IntArc

using IntArc = Net_Arc<int, long>

Definition at line 60 of file netcapgraph_test.cc.

◆ IntNet

Definition at line 61 of file netcapgraph_test.cc.

◆ IntNode

using IntNode = Net_Cap_Node<int, long>

Definition at line 59 of file netcapgraph_test.cc.

◆ StringArc

using StringArc = Net_Arc<string, double>

Definition at line 64 of file netcapgraph_test.cc.

◆ StringNet

Definition at line 65 of file netcapgraph_test.cc.

◆ StringNode

using StringNode = Net_Cap_Node<string, double>

Definition at line 63 of file netcapgraph_test.cc.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 1282 of file netcapgraph_test.cc.

◆ TEST() [1/9]

TEST ( NetCapGraphChangedNetwork  ,
TheMarkGoesWithTheAuxiliaryNetwork   
)

◆ TEST() [2/9]

TEST ( NetCapGraphChangedNetwork  ,
UpdateRefusesItAfterACopyOverTheNetwork   
)

◆ TEST() [3/9]

TEST ( NetCapGraphChangedNetwork  ,
UpdateRefusesItAfterADisconnection   
)

◆ TEST() [4/9]

TEST ( NetCapGraphChangedNetwork  ,
UpdateRefusesItAfterAnInsertion   
)

Definition at line 1227 of file netcapgraph_test.cc.

◆ TEST() [5/9]

TEST ( NetCapGraphChangedNetwork  ,
UpdateRefusesItAfterARemoval   
)

◆ TEST() [6/9]

TEST ( NetCapGraphChangedNetwork  ,
UpdateRefusesItAfterASwapThroughTheBase   
)

Definition at line 1167 of file netcapgraph_test.cc.

References Aleph::Net_Graph< NodeT, ArcT >::swap().

◆ TEST() [7/9]

TEST ( NetCapGraphChangedNetwork  ,
UpdateTakesAnUnchangedNetwork   
)

Definition at line 1056 of file netcapgraph_test.cc.

◆ TEST() [8/9]

TEST ( NetCapGraphChangedNetwork  ,
UpdateTakesItAfterASwapWithItself   
)

Definition at line 1216 of file netcapgraph_test.cc.

References Aleph::Net_Graph< NodeT, ArcT >::swap().

◆ TEST() [9/9]

TEST ( NetCapGraphChangedNetwork  ,
UpdateTakesTheNetworkInAnotherOrder   
)

◆ TEST_F() [1/44]

TEST_F ( NetCapGraphCookies  ,
ArcToCookieMapping   
)

Definition at line 892 of file netcapgraph_test.cc.

References ARC_COOKIE.

◆ TEST_F() [2/44]

◆ TEST_F() [3/44]

TEST_F ( NetCapGraphEdgeCases  ,
Arc_FlowEqualsCapacity   
)

Definition at line 171 of file netcapgraph_test.cc.

◆ TEST_F() [4/44]

TEST_F ( NetCapGraphEdgeCases  ,
Arc_FlowExceedsCapacityThrows   
)

Definition at line 181 of file netcapgraph_test.cc.

◆ TEST_F() [5/44]

TEST_F ( NetCapGraphEdgeCases  ,
Arc_ZeroCapacity   
)

Definition at line 161 of file netcapgraph_test.cc.

◆ TEST_F() [6/44]

TEST_F ( NetCapGraphEdgeCases  ,
AuxNet_ComputeFreeCycle   
)

Definition at line 215 of file netcapgraph_test.cc.

◆ TEST_F() [7/44]

TEST_F ( NetCapGraphEdgeCases  ,
AuxNet_DoubleComputeThrows   
)

Definition at line 193 of file netcapgraph_test.cc.

◆ TEST_F() [8/44]

TEST_F ( NetCapGraphEdgeCases  ,
AuxNet_FreeWithoutComputeThrows   
)

Definition at line 205 of file netcapgraph_test.cc.

◆ TEST_F() [9/44]

TEST_F ( NetCapGraphEdgeCases  ,
AuxNet_UpdateWithoutComputeThrows   
)

Definition at line 210 of file netcapgraph_test.cc.

◆ TEST_F() [10/44]

TEST_F ( NetCapGraphEdgeCases  ,
CapacityBoundary_Epsilon   
)

Definition at line 151 of file netcapgraph_test.cc.

◆ TEST_F() [11/44]

TEST_F ( NetCapGraphEdgeCases  ,
CapacityBoundary_MaxDouble   
)

Definition at line 139 of file netcapgraph_test.cc.

◆ TEST_F() [12/44]

TEST_F ( NetCapGraphEdgeCases  ,
CapacityBoundary_SmallPositive   
)

Definition at line 145 of file netcapgraph_test.cc.

◆ TEST_F() [13/44]

TEST_F ( NetCapGraphEdgeCases  ,
CopyConstruction   
)

Definition at line 235 of file netcapgraph_test.cc.

References Aleph::copy().

◆ TEST_F() [14/44]

TEST_F ( NetCapGraphEdgeCases  ,
EmptyNetwork_ComputeAuxNetFails   
)

Definition at line 89 of file netcapgraph_test.cc.

◆ TEST_F() [15/44]

TEST_F ( NetCapGraphEdgeCases  ,
EmptyNetwork_NoNodes   
)

Definition at line 81 of file netcapgraph_test.cc.

◆ TEST_F() [16/44]

◆ TEST_F() [17/44]

TEST_F ( NetCapGraphEdgeCases  ,
SingleNode_NegativeCapacityThrows   
)

Definition at line 130 of file netcapgraph_test.cc.

◆ TEST_F() [18/44]

TEST_F ( NetCapGraphEdgeCases  ,
SingleNode_SpecificCapacity   
)

Definition at line 116 of file netcapgraph_test.cc.

◆ TEST_F() [19/44]

TEST_F ( NetCapGraphEdgeCases  ,
SingleNode_UnlimitedCapacity   
)

Definition at line 106 of file netcapgraph_test.cc.

◆ TEST_F() [20/44]

TEST_F ( NetCapGraphEdgeCases  ,
SingleNode_ZeroCapacity   
)

Definition at line 123 of file netcapgraph_test.cc.

◆ TEST_F() [21/44]

◆ TEST_F() [22/44]

◆ TEST_F() [23/44]

TEST_F ( NetCapGraphIntegerFlow  ,
AuxNetWithIntegers   
)

Definition at line 814 of file netcapgraph_test.cc.

◆ TEST_F() [24/44]

TEST_F ( NetCapGraphIntegerFlow  ,
BasicOperations   
)

◆ TEST_F() [25/44]

◆ TEST_F() [26/44]

◆ TEST_F() [27/44]

◆ TEST_F() [28/44]

◆ TEST_F() [29/44]

◆ TEST_F() [30/44]

◆ TEST_F() [31/44]

TEST_F ( NetCapGraphStringInfo  ,
AuxNetWithStrings   
)

Definition at line 847 of file netcapgraph_test.cc.

◆ TEST_F() [32/44]

TEST_F ( NetCapGraphStringInfo  ,
BasicOperations   
)

◆ TEST_F() [33/44]

TEST_F ( NetCapGraphStructure  ,
BipartiteNetwork   
)

Definition at line 412 of file netcapgraph_test.cc.

References l, and r.

◆ TEST_F() [34/44]

TEST_F ( NetCapGraphStructure  ,
CompleteNetwork_FiveNodes   
)

Definition at line 387 of file netcapgraph_test.cc.

References nodes.

◆ TEST_F() [35/44]

TEST_F ( NetCapGraphStructure  ,
DiamondNetwork   
)

Definition at line 353 of file netcapgraph_test.cc.

◆ TEST_F() [36/44]

TEST_F ( NetCapGraphStructure  ,
LinearNetwork_TenNodes   
)

Definition at line 305 of file netcapgraph_test.cc.

References nodes.

◆ TEST_F() [37/44]

TEST_F ( NetCapGraphStructure  ,
LinearNetwork_ThreeNodes   
)

◆ TEST_F() [38/44]

TEST_F ( NetCapGraphStructure  ,
StarNetwork_FiveSpokes   
)

Definition at line 328 of file netcapgraph_test.cc.

◆ TEST_F() [39/44]

TEST_F ( NetCapGraphValidation  ,
CheckNodeCapacities_Invalid   
)

Definition at line 750 of file netcapgraph_test.cc.

◆ TEST_F() [40/44]

TEST_F ( NetCapGraphValidation  ,
CheckNodeCapacities_Valid   
)

Definition at line 735 of file netcapgraph_test.cc.

◆ TEST_F() [41/44]

◆ TEST_F() [42/44]

TEST_F ( NetCapGraphValidation  ,
SetNodeCapacity_Invalid   
)

◆ TEST_F() [43/44]

TEST_F ( NetCapGraphValidation  ,
SetNodeCapacity_Negative   
)

◆ TEST_F() [44/44]

TEST_F ( NetCapGraphValidation  ,
SetNodeCapacity_Valid   
)