Graphle 1.0.0
A C++20 header-only graph library
Loading...
Searching...
No Matches
Classes | Typedefs | Functions
graphle::test Namespace Reference

Classes

struct  assertion_failure
 
struct  in_out_edge_graph
 
struct  out_edge_graph
 
struct  subtest_scope_handler
 
class  test_registry
 
struct  v_list_in_out_edge_graph
 
struct  v_list_out_edge_graph
 
struct  ve_list_graph
 
struct  ve_map_graph
 

Typedefs

using vertex_list = std::vector< std::size_t >
 
using vertex_order = std::vector< vertex_list >
 
using datastructure_list = meta::type_list< ve_list_graph, ve_map_graph, out_edge_graph, v_list_out_edge_graph, in_out_edge_graph, v_list_in_out_edge_graph >
 
template<typename R , typename... A>
using fn = R(*)(A...)
 

Functions

template<graphle::meta::list_of_types DataStructures, typename Algorithm >
void test_visit_order (const graphle::test::ve_list_graph &src, std::size_t root, const vertex_order &vertex_ordering, Algorithm &&algorithm)
 
constexpr ve_list_graph make_tree_graph (void)
 
constexpr ve_list_graph make_dag_graph (void)
 
constexpr ve_list_graph make_cyclic_graph (void)
 
constexpr ve_list_graph make_linear_graph (void)
 
constexpr ve_list_graph make_bidirectional_edge_graph (void)
 
constexpr ve_list_graph make_size_one_graph (void)
 
constexpr ve_list_graph make_empty_graph (void)
 
constexpr auto make_graphs (void)
 
template<typename T >
requires requires (T v) { v.vertex_id; }
constexpr bool operator== (const T &a, const T &b)
 
 GRAPHLE_MAKE_NIEBLOID (to_vertex, [](const auto &v) { return V { v.vertex_id };}, typename V)
 
 GRAPHLE_MAKE_NIEBLOID (to_edge,([](const auto &e) { return std::pair { to_vertex< V >(e.first), to_vertex< V >(e.second) };}), typename V)
 
template<typename M , typename K >
constexpr auto range_at_map_key (M &&map, const K &key)
 
void emit_test_success (std::string_view name)
 
void emit_test_failure (std::string_view name, const auto &failure)
 

Typedef Documentation

◆ fn

template<typename R , typename... A>
using graphle::test::fn = typedef R(*)(A...)

Definition at line 79 of file test_framework.hpp.

◆ vertex_list

using graphle::test::vertex_list = typedef std::vector<std::size_t>

Definition at line 15 of file test_visit_order.hpp.

◆ vertex_order

using graphle::test::vertex_order = typedef std::vector<vertex_list>

Definition at line 16 of file test_visit_order.hpp.

Function Documentation

◆ emit_test_failure()

void graphle::test::emit_test_failure ( std::string_view  name,
const auto &  failure 
)
inline

Print error message for the test with the given name using the given exception.

Definition at line 113 of file test_framework.hpp.

◆ emit_test_success()

void graphle::test::emit_test_success ( std::string_view  name)
inline

Print success message for the test with the given name.

Definition at line 105 of file test_framework.hpp.

◆ range_at_map_key()

template<typename M , typename K >
constexpr auto graphle::test::range_at_map_key ( M &&  map,
const K &  key 
)
constexpr

Return a view of the range contained in the provided map at the given key, or an empty view of the same type if the map contains no such key.

Definition at line 58 of file test_datastructures.hpp.

◆ test_visit_order()

template<graphle::meta::list_of_types DataStructures, typename Algorithm >
void graphle::test::test_visit_order ( const graphle::test::ve_list_graph &  src,
std::size_t  root,
const vertex_order &  vertex_ordering,
Algorithm &&  algorithm 
)
inline

Tests that the order the given search algorithm visits the vertices of the given graph in is the same as the provided order.

Template Parameters
DataStructuresA type_list of datastructures that work with the given algorithm.
Parameters
srcGraph data to construct the given datastructures from.
rootThe root vertex to start the search from.
orderingThe expected order vertices are visited in.
algorithmThe search algorithm to test.

Definition at line 28 of file test_visit_order.hpp.