Sequoia
Loading...
Searching...
No Matches
Classes | Namespaces | Functions
AllocationCheckersDetails.hpp File Reference

Implementation details for allocation checks. More...

#include "sequoia/TestFramework/AllocationCheckersCore.hpp"
#include "sequoia/TestFramework/SemanticsCheckersDetails.hpp"
#include "sequoia/TestFramework/FreeCheckers.hpp"

Go to the source code of this file.

Classes

struct  sequoia::testing::impl::allocation_advice
 
class  sequoia::testing::impl::dual_allocation_checker< T, Getter >
 Wraps allocation_info, together with two prior allocation counts. More...
 
class  sequoia::testing::impl::allocation_checker< T, Getter >
 Wraps allocation_info, together with the prior allocation count. More...
 
struct  sequoia::testing::impl::do_swap< dual_allocation_checker< T, Getters >... >
 
struct  sequoia::testing::impl::do_swap< allocation_checker< T, Getters >... >
 
struct  sequoia::testing::impl::allocation_actions< T >
 actions common to both move-only and regular types. More...
 

Namespaces

namespace  sequoia::testing::impl
 Condition for applying a container check.
 

Functions

template<test_mode Mode, movable_comparable T, alloc_getter< T > Getter, auto Event>
bool sequoia::testing::impl::check_allocation (std::string_view detail, test_logger< Mode > &logger, const T &container, const allocation_info< T, Getter > &info, const int previous, const alloc_prediction< Event > prediction)
 
template<movable_comparable T, alloc_getter< T > Getter>
 sequoia::testing::impl::dual_allocation_checker (allocation_info< T, Getter >, const T &, const T &) -> dual_allocation_checker< T, Getter >
 
template<movable_comparable T, alloc_getter< T > Getter>
 sequoia::testing::impl::allocation_checker (allocation_info< T, Getter >, const T &) -> allocation_checker< T, Getter >
 
template<movable_comparable T, alloc_getter< T > Getter>
 sequoia::testing::impl::allocation_checker (allocation_info< T, Getter >, int) -> allocation_checker< T, Getter >
 
template<template< class, class > class Checker, movable_comparable T, alloc_getter< T > Getter, class... Args, std::size_t... I>
auto sequoia::testing::impl::make_scoped_allocation_checkers (const allocation_info< T, Getter > &info, std::index_sequence< I... >, Args &&... args)
 
template<template< class, class > class Checker, movable_comparable T, alloc_getter< T > Getter, class... Args>
auto sequoia::testing::impl::make_scoped_allocation_checkers (const allocation_info< T, Getter > &info, Args &&... args)
 
template<movable_comparable T, alloc_getter< T > Getter, class... Args>
std::tuple< dual_allocation_checker< T, Getter > > sequoia::testing::impl::make_dual_allocation_checkers (const allocation_info< T, Getter > &info, Args &&... args)
 
template<movable_comparable T, alloc_getter< T > Getter, class... Args>
requires scoped_alloc<std::invoke_result_t<Getter, T>>
auto sequoia::testing::impl::make_dual_allocation_checkers (const allocation_info< T, Getter > &info, Args &&... args)
 
template<movable_comparable T, alloc_getter< T > Getter, class... Args>
std::tuple< allocation_checker< T, Getter > > sequoia::testing::impl::make_allocation_checkers (const allocation_info< T, Getter > &info, Args &&... args)
 
template<movable_comparable T, alloc_getter< T > Getter, class... Args>
requires scoped_alloc<std::invoke_result_t<Getter, T>>
auto sequoia::testing::impl::make_allocation_checkers (const allocation_info< T, Getter > &info, Args &&... args)
 
template<auto AllocEvent, test_mode Mode, movable_comparable T, alloc_getter< T >... Getters>
requires (sizeof...(Getters) > 0)
void sequoia::testing::impl::check_no_allocation (std::string_view detail, test_logger< Mode > &logger, const T &x, const T &y, const dual_allocation_checker< T, Getters > &... checkers)
 
template<test_mode Mode, movable_comparable T, alloc_getter< T >... Getters>
requires (sizeof...(Getters) > 0)
void sequoia::testing::impl::check_copy_assign_allocation (test_logger< Mode > &logger, const T &x, const T &y, const dual_allocation_checker< T, Getters > &... checkers)
 
template<test_mode Mode, movable_comparable T, alloc_getter< T >... Getters>
requires (sizeof...(Getters) > 0)
void sequoia::testing::impl::check_move_assign_allocation (test_logger< Mode > &logger, const T &x, const dual_allocation_checker< T, Getters > &... checkers)
 
template<test_mode Mode, movable_comparable T, alloc_getter< T >... Getters>
requires (sizeof...(Getters) > 0)
void sequoia::testing::impl::check_mutation_after_swap (test_logger< Mode > &logger, const T &x, const T &y, const dual_allocation_checker< T, Getters > &... checkers)
 
template<test_mode Mode, movable_comparable T, std::invocable< T & > Mutator, alloc_getter< T >... Getters>
requires (sizeof...(Getters) > 0)
void sequoia::testing::impl::check_mutation_after_swap (test_logger< Mode > &logger, T &lhs, const T &rhs, const T &y, Mutator yMutator, dual_allocation_checker< T, Getters >... checkers)
 
template<auto AllocEvent, test_mode Mode, movable_comparable T, alloc_getter< T >... Getters>
requires (sizeof...(Getters) > 0)
void sequoia::testing::impl::check_no_allocation (test_logger< Mode > &logger, const T &container, std::string_view tag, const allocation_checker< T, Getters > &... checkers)
 
template<test_mode Mode, movable_comparable T, alloc_getter< T >... Getters>
requires (sizeof...(Getters) > 0)
void sequoia::testing::impl::check_copy_x_allocation (test_logger< Mode > &logger, const T &container, const allocation_checker< T, Getters > &... checkers)
 
template<test_mode Mode, movable_comparable T, alloc_getter< T >... Getters>
requires (sizeof...(Getters) > 0)
void sequoia::testing::impl::check_copy_y_allocation (test_logger< Mode > &logger, const T &container, const allocation_checker< T, Getters > &... checkers)
 
template<test_mode Mode, movable_comparable T, alloc_getter< T >... Getters>
requires (sizeof...(Getters) > 0)
void sequoia::testing::impl::check_move_y_allocation (test_logger< Mode > &logger, const T &container, const allocation_checker< T, Getters > &... checkers)
 
template<test_mode Mode, movable_comparable T, alloc_getter< T >... Getters>
requires (sizeof...(Getters) > 0)
void sequoia::testing::impl::check_mutation_allocation (std::string_view priorOp, test_logger< Mode > &logger, const T &y, const allocation_checker< T, Getters > &... checkers)
 
template<test_mode Mode, movable_comparable T, alloc_getter< T >... Getters>
requires (sizeof...(Getters) > 0)
void sequoia::testing::impl::check_para_copy_y_allocation (test_logger< Mode > &logger, const T &container, const allocation_checker< T, Getters > &... checkers)
 
template<test_mode Mode, movable_comparable T, alloc_getter< T >... Getters>
requires (sizeof...(Getters) > 0)
void sequoia::testing::impl::check_para_copy_y_allocation (test_logger< Mode > &logger, const T &container, std::tuple< allocation_checker< T, Getters >... > checkers)
 
template<test_mode Mode, container_tag tag, movable_comparable T, alloc_getter< T >... Getters>
requires (sizeof...(Getters) > 0)
void sequoia::testing::impl::check_para_move_allocation (test_logger< Mode > &logger, container_tag_constant< tag >, const T &container, const allocation_checker< T, Getters > &... checkers)
 
template<test_mode Mode, container_tag tag, movable_comparable T, alloc_getter< T >... Getters>
void sequoia::testing::impl::check_para_move_allocation (test_logger< Mode > &logger, container_tag_constant< tag >, const T &container, std::tuple< allocation_checker< T, Getters >... > checkers)
 
template<test_mode Mode, movable_comparable T, alloc_getter< T >... Getters>
requires (sizeof...(Getters) > 0)
void sequoia::testing::impl::check_initialization_allocations (test_logger< Mode > &logger, const T &x, const T &y, const allocation_info< T, Getters > &... info)
 
template<test_mode Mode, movable_comparable T, alloc_getter< T >... Getters>
requires (sizeof...(Getters) > 0)
void sequoia::testing::impl::check_init_allocations (test_logger< Mode > &logger, const T &x, const T &y, const allocation_checker< T, Getters > &... checkers)
 
template<test_mode Mode, movable_comparable T, alloc_getter< T >... Getters>
void sequoia::testing::impl::check_init_allocations (test_logger< Mode > &logger, const T &x, const T &y, std::tuple< allocation_checker< T, Getters >... > checkers)
 
template<test_mode Mode, movable_comparable T, alloc_getter< T >... Getters>
requires (sizeof...(Getters) > 0)
void sequoia::testing::impl::check_serialization_allocation (test_logger< Mode > &logger, const T &container, const allocation_checker< T, Getters > &... checkers)
 
OverloadSet

Functions for performing allocation checks which are common to types with both regular and move-only semantics. These functions provide an extra level of indirection in order that the current number of allocations may be acquired before proceeding

template<test_mode Mode, comparison_flavour C, class Actions , movable_comparable T, invocable_r< bool, T > Fn, class... Getters>
bool sequoia::testing::impl::check_comparison_consistency (test_logger< Mode > &logger, comparison_constant< C > comparison, const Actions &actions, const T &x, const T &y, Fn fn, const dual_allocation_checker< T, Getters > &... checkers)
 
template<test_mode Mode, class Actions , movable_comparable T, class U , alloc_getter< T >... Getters>
requires checkable_against_for_semantics<Mode, T, U> && (sizeof...(Getters) > 0)
std::optional< T > sequoia::testing::impl::check_move_construction (test_logger< Mode > &logger, const Actions &actions, T &&z, const U &y, optional_ref< const U > movedFrom, const dual_allocation_checker< T, Getters > &... checkers)
 
template<test_mode Mode, class Actions , movable_comparable T, class U , std::invocable< T & > Mutator, alloc_getter< T >... Getters>
requires checkable_against_for_semantics<Mode, T, U> && (sizeof...(Getters) > 0)
void sequoia::testing::impl::check_move_assign (test_logger< Mode > &logger, const Actions &actions, T &u, T &&v, const U &y, optional_ref< const U > movedFrom, Mutator yMutator, const dual_allocation_checker< T, Getters > &... checkers)
 
template<test_mode Mode, movable_comparable T, std::invocable< T & > Mutator, class... Checkers>
void sequoia::testing::impl::check_mutation_after_move (std::string_view moveType, test_logger< Mode > &logger, T &t, Mutator yMutator, Checkers... checkers)
 
template<test_mode Mode, movable_comparable T, std::invocable< T & > Mutator, class... Checkers, std::size_t... I>
void sequoia::testing::impl::check_mutation_after_move (std::string_view moveType, test_logger< Mode > &logger, T &t, Mutator yMutator, std::tuple< Checkers... > checkers, std::index_sequence< I... >)
 
template<test_mode Mode, movable_comparable T, std::invocable< T & > Mutator, class... Checkers>
void sequoia::testing::impl::check_mutation_after_move (std::string_view moveType, test_logger< Mode > &logger, T &t, Mutator yMutator, std::tuple< Checkers... > checkers)
 
template<test_mode Mode, class Actions , movable_comparable T, alloc_getter< T >... Getters>
bool sequoia::testing::impl::check_serialization (test_logger< Mode > &logger, const Actions &actions, T &&u, const T &y, const dual_allocation_checker< T, Getters > &... checkers)
 

Detailed Description

Implementation details for allocation checks.

For more information see AllocationCheckersCore.hpp