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

The graph algorithms when an allocation fails, and on a graph that other algorithms left dirty. More...

#include <gtest/gtest.h>
#include "allocation_failure.H"
#include <algorithm>
#include <cstdlib>
#include <functional>
#include <iostream>
#include <memory>
#include <new>
#include <set>
#include <stdexcept>
#include <string>
#include <utility>
#include <vector>
#include <tpl_graph.H>
#include <tpl_components.H>
#include <tpl_graph_utils.H>
#include <tpl_cut_nodes.H>
#include <tpl_test_acyclique.H>
#include <tpl_bipartite.H>
#include <tpl_spanning_tree.H>
#include <tpl_find_path.H>
#include <tpl_test_path.H>
#include <Blossom.H>
#include <eulerian.H>
#include <Tarjan.H>
#include <kosaraju.H>
#include <topological_sort.H>
#include <Bidirectional_BFS.H>
#include <warshall.H>
#include <Dominators.H>
#include <Kruskal.H>
#include <Prim.H>
#include <graph_to_tree.H>
#include <generate_df_tree.H>
#include "graph_filter_catalog.H"
#include "graph_harness.H"
Include dependency graph for graph_exhaustive_robustness_test.cc:

Go to the source code of this file.

Classes

class  GraphFailAt< GT >
 
class  GraphDirtyState< GT >
 

Functions

 TYPED_TEST_SUITE (GraphFailAt, All_Kinds)
 
 TYPED_TEST (GraphFailAt, EveryAllocationOfEveryAlgorithmMayFail)
 
 TYPED_TEST_SUITE (GraphDirtyState, All_Kinds)
 
 TYPED_TEST (GraphDirtyState, EveryAlgorithmIgnoresWhatOthersLeft)
 

Detailed Description

The graph algorithms when an allocation fails, and on a graph that other algorithms left dirty.

This program replaces the global operator new, so that a test can make one allocation fail. Each algorithm runs, on a few small graphs of each kind, with the allocation number k failing, for every k until it runs without reaching it. Each run must either end with the answer that the algorithm gives with memory, or throw std::bad_alloc; then the graph must have its nodes and arcs, and the algorithm, run again with memory, must give its answer. An algorithm that catches the bad_alloc and goes on must still give it. Under ThreadSanitizer nothing is replaced and the tests are skipped; under LeakSanitizer what a failure leaks is reported.

Each algorithm must also give its answer on a graph whose nodes and arcs carry what another algorithm could have left in them: every control bit set, a counter, and a cookie.

Definition in file graph_exhaustive_robustness_test.cc.

Function Documentation

◆ TYPED_TEST() [1/2]

TYPED_TEST ( GraphDirtyState  ,
EveryAlgorithmIgnoresWhatOthersLeft   
)

◆ TYPED_TEST() [2/2]

TYPED_TEST ( GraphFailAt  ,
EveryAllocationOfEveryAlgorithmMayFail   
)

Definition at line 574 of file graph_exhaustive_robustness_test.cc.

◆ TYPED_TEST_SUITE() [1/2]

TYPED_TEST_SUITE ( GraphDirtyState  ,
All_Kinds   
)

◆ TYPED_TEST_SUITE() [2/2]

TYPED_TEST_SUITE ( GraphFailAt  ,
All_Kinds   
)