22namespace sequoia::testing
25 std::string move_only_message(std::string description);
33 template<test_mode Mode>
37 constexpr static test_mode mode{Mode};
46 template<moveonly T,
class U,
class V,
class Self>
47 requires checkable_against_for_semantics<Mode, T, U> && checkable_against_for_semantics<Mode, T, V>
54 const V& movedFromPostConstruction,
55 const V& movedFromPostAssignment)
57 return testing::check_semantics(
58 move_only_message(self.report(description)),
64 optional_ref<const V>{movedFromPostConstruction},
65 optional_ref<const V>{movedFromPostAssignment}
74 template<moveonly T,
class U,
class Self>
75 requires checkable_against_for_semantics<Mode, T, U>
76 bool check_semantics(
this Self& self,
const reporter& description, T&& x, T&& y,
const U& xEquivalent,
const U& yEquivalent)
78 return testing::check_semantics(
79 move_only_message(self.report(description)),
85 optional_ref<const U>{},
86 optional_ref<const U>{}
93 std::regular_invocable xMaker,
94 moveonly T=std::invoke_result_t<xMaker>,
99 requires checkable_against_for_semantics<Mode, T, U>
104 const U& movedFromPostConstruction,
105 const U& movedFromPostAssignment)
107 return self.check_semantics(
113 movedFromPostConstruction,
114 movedFromPostAssignment);
120 std::regular_invocable xMaker,
121 moveonly T=std::invoke_result_t<xMaker>,
127 return self.check_semantics(description, xFn(), yFn(), xFn(), yFn());
135 template<moveonly T,
class U,
class V,
class Self>
136 requires std::totally_ordered<T> && checkable_against_for_semantics<Mode, T, U> && checkable_against_for_semantics<Mode, T, V>
141 const U& xEquivalent,
142 const U& yEquivalent,
143 const V& movedFromPostConstruction,
144 const V& movedFromPostAssignment,
145 std::weak_ordering order)
147 return testing::check_semantics(
148 move_only_message(self.report(description)),
154 optional_ref<const V>{movedFromPostConstruction},
155 optional_ref<const V>{movedFromPostAssignment},
165 template<moveonly T,
class U,
class Self>
166 requires std::totally_ordered<T> && checkable_against_for_semantics<Mode, T, U>
171 const U& xEquivalent,
172 const U& yEquivalent,
173 std::weak_ordering order)
175 return testing::check_semantics(
176 move_only_message(self.report(description)),
182 optional_ref<const U>{},
183 optional_ref<const U>{},
195 std::regular_invocable xMaker,
196 moveonly T=std::invoke_result_t<xMaker>,
201 requires std::totally_ordered<T> && checkable_against_for_semantics<Mode, T, U>
206 const U& movedFromPostConstruction,
207 const U& movedFromPostAssignment,
208 std::weak_ordering order)
210 return self.check_semantics(
216 movedFromPostConstruction,
217 movedFromPostAssignment,
226 std::regular_invocable xMaker,
227 moveonly T=std::invoke_result_t<xMaker>,
230 requires std::totally_ordered<T>
233 return self.check_semantics(description, xFn(), yFn(), xFn(), yFn(), order);
243 template<test_mode mode>
Core functionality for the testing framework.
Functions for checking semantics of types lacking copy semantics but which are otherwise regular.
Meta-programming utilities.
class template from which all concrete tests should derive.
Definition: FreeTestCore.hpp:144
class template for plugging into the checker class template to provide allocation checks for move-onl...
Definition: MoveOnlyTestCore.hpp:35
bool check_semantics(this Self &self, const reporter &description, T &&x, T &&y, const U &xEquivalent, const U &yEquivalent, const V &movedFromPostConstruction, const V &movedFromPostAssignment)
Definition: MoveOnlyTestCore.hpp:48
bool check_semantics(this Self &self, const reporter &description, xMaker xFn, yMaker yFn, std::weak_ordering order)
Prerequisite: xMaker() != yMaker(), with values consistent with order.
Definition: MoveOnlyTestCore.hpp:231
bool check_semantics(this Self &self, const reporter &description, T &&x, T &&y, const U &xEquivalent, const U &yEquivalent, std::weak_ordering order)
Definition: MoveOnlyTestCore.hpp:167
bool check_semantics(this Self &self, const reporter &description, xMaker xFn, yMaker yFn, const U &movedFromPostConstruction, const U &movedFromPostAssignment, std::weak_ordering order)
Definition: MoveOnlyTestCore.hpp:202
bool check_semantics(this Self &self, const reporter &description, T &&x, T &&y, const U &xEquivalent, const U &yEquivalent)
Definition: MoveOnlyTestCore.hpp:76
bool check_semantics(this Self &self, const reporter &description, T &&x, T &&y, const U &xEquivalent, const U &yEquivalent, const V &movedFromPostConstruction, const V &movedFromPostAssignment, std::weak_ordering order)
Definition: MoveOnlyTestCore.hpp:137
bool check_semantics(this Self &self, const reporter &description, xMaker xFn, yMaker yFn)
Prerequisite: xMaker() != yMaker()
Definition: MoveOnlyTestCore.hpp:125
bool check_semantics(this Self &self, const reporter &description, xMaker xFn, yMaker yFn, const U &movedFromPostConstruction, const U &movedFromPostAssignment)
Prerequisite: xMaker() != yMaker()
Definition: MoveOnlyTestCore.hpp:100
Definition: Output.hpp:186
The move-only version of sequoia::pseudoregular.
Definition: Concepts.hpp:43
Supplements std::regular_invocable.
Definition: Concepts.hpp:31