|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
Insertions and removals in graphs when memory runs out. More...
#include <gtest/gtest.h>#include "allocation_failure.H"#include <algorithm>#include <new>#include <vector>#include <tpl_agraph.H>#include <tpl_cut_nodes.H>#include <tpl_graph.H>#include <tpl_graph_utils.H>#include <tpl_net.H>#include <tpl_sgraph.H>Go to the source code of this file.
Functions | |
| TYPED_TEST_SUITE (GraphWithoutMemory, Graph_Kinds) | |
| TYPED_TEST (GraphWithoutMemory, InsertArcLeavesTheGraphAsItWas) | |
| TYPED_TEST (GraphWithoutMemory, RemoveNodeLeavesTheGraphAsItWasOrRemovesIt) | |
| TEST_F (NetWithoutMemory, ArcsGoOnlyIfTheSetsOfSourcesAndSinksTakeTheirEnds) | |
| TEST_F (NetWithoutMemory, ClearGraphThrowsAndLeavesTheNetworkRight) | |
| TYPED_TEST (GraphWithoutMemory, CopyAssignmentLeavesTheGraphAsItWas) | |
| TYPED_TEST (GraphWithoutMemory, InsertNodeLeavesTheGraphAsItWas) | |
| TYPED_TEST_SUITE (CopiesWithoutMemory, Undirected_Kinds) | |
| TYPED_TEST (CopiesWithoutMemory, EachNodeIsDeletedOnce) | |
Insertions and removals in graphs when memory runs out.
This program replaces the global operator new, so that a test can make one allocation fail. If insert_arc(), remove_node() or, in a network, remove_arc() or disconnect_arc() throws std::bad_alloc, the graph must be as it was: no node may keep an arc that the graph freed.
Definition in file graph_allocation_failure_test.cc.
| TEST_F | ( | NetWithoutMemory | , |
| ArcsGoOnlyIfTheSetsOfSourcesAndSinksTakeTheirEnds | |||
| ) |
Definition at line 233 of file graph_allocation_failure_test.cc.
References Aleph::and, Aleph::Net_Graph< NodeT, ArcT >::connect_arc(), Aleph::Net_Graph< NodeT, ArcT >::disconnect_arc(), GraphCommon< GT, Node, Arc >::get_num_arcs(), GraphCommon< GT, Node, Arc >::get_num_nodes(), Aleph::Net_Graph< NodeT, ArcT >::insert_arc(), Aleph::Net_Graph< NodeT, ArcT >::insert_node(), k, Aleph::Net_Graph< NodeT, ArcT >::remove_arc(), and Aleph::Net_Graph< NodeT, ArcT >::remove_node().
| TEST_F | ( | NetWithoutMemory | , |
| ClearGraphThrowsAndLeavesTheNetworkRight | |||
| ) |
| TYPED_TEST | ( | CopiesWithoutMemory | , |
| EachNodeIsDeletedOnce | |||
| ) |
Definition at line 473 of file graph_allocation_failure_test.cc.
References Aleph::color(), Aleph::compute_cut_nodes(), Aleph::find_breadth_first_spanning_tree(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), Aleph::map_cut_graph(), Aleph::map_subgraph(), NODE_COUNTER, and Aleph::paint_subgraphs().
| TYPED_TEST | ( | GraphWithoutMemory | , |
| CopyAssignmentLeavesTheGraphAsItWas | |||
| ) |
Definition at line 317 of file graph_allocation_failure_test.cc.
References arcs, GraphCommon< GT, Node, Arc >::get_cookie(), GraphCommon< GT, Node, Arc >::get_num_arcs(), GraphCommon< GT, Node, Arc >::get_num_nodes(), Aleph::Dlink::Iterator::has_curr(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), GraphCommon< GT, Node, Arc >::is_digraph(), k, Aleph::sum(), and y.
| TYPED_TEST | ( | GraphWithoutMemory | , |
| InsertArcLeavesTheGraphAsItWas | |||
| ) |
Definition at line 118 of file graph_allocation_failure_test.cc.
References arcs, Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), and k.
| TYPED_TEST | ( | GraphWithoutMemory | , |
| InsertNodeLeavesTheGraphAsItWas | |||
| ) |
Definition at line 371 of file graph_allocation_failure_test.cc.
References GraphCommon< GT, Node, Arc >::get_num_nodes(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), k, and nodes.
| TYPED_TEST | ( | GraphWithoutMemory | , |
| RemoveNodeLeavesTheGraphAsItWasOrRemovesIt | |||
| ) |
Definition at line 164 of file graph_allocation_failure_test.cc.
References 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(), k, and Aleph::List_Graph< _Graph_Node, _Graph_Arc >::remove_node().
| TYPED_TEST_SUITE | ( | CopiesWithoutMemory | , |
| Undirected_Kinds | |||
| ) |
| TYPED_TEST_SUITE | ( | GraphWithoutMemory | , |
| Graph_Kinds | |||
| ) |