20namespace sequoia::testing
27 template<test_mode Mode>
31 constexpr static test_mode mode{Mode};
35 template<
class Self, moveonly T,
class U, std::invocable<T&> Mutator, alloc_getter<T>... Getters>
36 requires checkable_against_for_semantics<Mode, T, U> && (!std::totally_ordered<T>) && (
sizeof...(Getters) > 0)
37 void check_semantics(
this Self& self,
43 const U& movedFromPostConstruction,
44 const U& movedFromPostAssignment,
48 testing::check_semantics(move_only_message(self.report(description)),
54 optional_ref<const U>{movedFromPostConstruction},
55 optional_ref<const U>{movedFromPostAssignment},
60 template<
class Self, moveonly T,
class U, std::invocable<T&> Mutator, alloc_getter<T>... Getters>
61 requires checkable_against_for_semantics<Mode, T, U> && (!std::totally_ordered<T>) && (
sizeof...(Getters) > 0)
62 void check_semantics(
this Self& self,
71 testing::check_semantics(move_only_message(self.report(description)),
77 optional_ref<const U>{},
78 optional_ref<const U>{},
89 std::invocable<T&> Mutator,
92 requires (!std::totally_ordered<T>) && (
sizeof...(Getters) > 0)
93 std::pair<T,T> check_semantics(
this Self& self,
97 const T& movedFromPostConstruction,
98 const T& movedFromPostAssignment,
102 return testing::check_semantics(move_only_message(self.report(description)),
106 optional_ref<const T>{movedFromPostConstruction},
107 optional_ref<const T>{movedFromPostAssignment},
118 std::invocable<T&> Mutator,
121 requires (!std::totally_ordered<T>) && (
sizeof...(Getters) > 0)
124 return testing::check_semantics(move_only_message(self.report(description)),
128 optional_ref<const T>{},
129 optional_ref<const T>{},
134 template<
class Self, moveonly T,
class U, std::invocable<T&> Mutator, alloc_getter<T>... Getters>
135 requires checkable_against_for_semantics<Mode, T, U> && std::totally_ordered<T> && (
sizeof...(Getters) > 0)
136 void check_semantics(
this Self& self,
140 const U& xEquivalent,
141 const U& yEquivalent,
142 const U& movedFromPostConstruction,
143 const U& movedFromPostAssignment,
144 std::weak_ordering order,
148 testing::check_semantics(move_only_message(self.report(description)),
154 optional_ref<const U>{movedFromPostConstruction},
155 optional_ref<const U>{movedFromPostAssignment},
161 template<
class Self, moveonly T,
class U, std::invocable<T&> Mutator, alloc_getter<T>... Getters>
162 requires checkable_against_for_semantics<Mode, T, U> && std::totally_ordered<T> && (
sizeof...(Getters) > 0)
163 void check_semantics(
this Self& self,
167 const U& xEquivalent,
168 const U& yEquivalent,
169 std::weak_ordering order,
173 testing::check_semantics(move_only_message(self.report(description)),
179 optional_ref<const U>{},
180 optional_ref<const U>{},
192 std::invocable<T&> Mutator,
195 requires std::totally_ordered<T> && (
sizeof...(Getters) > 0)
196 std::pair<T, T> check_semantics(
this Self& self,
200 const T& movedFromPostConstruction,
201 const T& movedFromPostAssignment,
202 std::weak_ordering order,
206 return testing::check_semantics(move_only_message(self.report(description)),
210 optional_ref<const T>{movedFromPostConstruction},
211 optional_ref<const T>{movedFromPostAssignment},
223 std::invocable<T&> Mutator,
226 requires std::totally_ordered<T> && (
sizeof...(Getters) > 0)
227 std::pair<T,T> check_semantics(
this Self& self,
231 std::weak_ordering order,
235 return testing::check_semantics(move_only_message(self.report(description)),
239 optional_ref<const T>{},
240 optional_ref<const T>{},
271 template<test_mode Mode>
286 void do_allocation_tests(
this Self& self)
288 self.template test_allocation<false, false>();
289 self.template test_allocation<false, true>();
290 self.template test_allocation<true, false>();
291 self.template test_allocation<true, true>();
Utilities for allocation testing.
Utilities for performing allocation checks of move-only types.
Extension for testing classes exhibiting move-only semantics.
Class for use with a container possessing a (shared counting) allocator.
Definition: AllocationCheckers.hpp:425
Templated on the test_mode, this forms the basis of all allocation tests for move-only types.
Definition: MoveOnlyAllocationTestCore.hpp:273
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: MoveOnlyAllocationTestCore.hpp:29
Definition: Output.hpp:186
The move-only version of sequoia::pseudoregular.
Definition: Concepts.hpp:43
Supplements std::regular_invocable.
Definition: Concepts.hpp:31
Definition: AllocationCheckersTraits.hpp:24