Sequoia
Loading...
Searching...
No Matches
GraphInitializationTestingUtilities.hpp
Go to the documentation of this file.
1
2// Copyright Oliver J. Rosten 2019. //
3// Distributed under the GNU GENERAL PUBLIC LICENSE, Version 3.0. //
4// (See accompanying file LICENSE.md or copy at //
5// https://www.gnu.org/licenses/gpl-3.0.en.html) //
7
8#pragma once
9
13
14namespace sequoia::testing
15{
16 template<test_mode Mode>
18 {
19 public:
20 constexpr static test_mode mode{Mode};
21
22 graph_init_extender() = default;
23
24 template<class G, class... NodeWeights, class E=typename G::edge_init_type, class Self>
25 void check_graph(this Self&& self, const reporter& description, const G& graph, std::initializer_list<std::initializer_list<E>> edges, const std::tuple<NodeWeights...>& nodeWeights)
26 {
27 testing::check(weak_equivalence, self.report(description), self.m_Logger, graph, std::pair{edges, nodeWeights});
28 }
29
30 template<class G, class E=typename G::edge_init_typ, class Self>
31 requires (!std::is_empty_v<typename G::node_weight_type>)
32 void check_graph(this Self&& self, const reporter& description, const G& graph, std::initializer_list<std::initializer_list<E>> edges, std::initializer_list<typename G::node_weight_type> nodeWeights)
33 {
34 testing::check(weak_equivalence, self.report(description), self.m_Logger, graph, std::pair{edges, nodeWeights});
35 }
36
37 template<class G, class E=typename G::edge_init_type, class Self>
38 requires std::is_empty_v<typename G::node_weight_type>
39 void check_graph(this Self&& self, const reporter& description, const G& graph, std::initializer_list<std::initializer_list<E>> edges)
40 {
41 testing::check(weak_equivalence, self.report(description), self.m_Logger, graph, edges);
42 }
43 protected:
44 ~graph_init_extender() = default;
45
46 graph_init_extender(graph_init_extender&&) noexcept = default;
47 graph_init_extender& operator=(graph_init_extender&&) noexcept = default;
48 };
49
50 template<test_mode Mode>
52
55}
class template from which all concrete tests should derive.
Definition: FreeTestCore.hpp:144
Definition: GraphInitializationTestingUtilities.hpp:18
Definition: Output.hpp:186