mimic++ v4
Loading...
Searching...
No Matches
ExpectationPolicies.hpp File Reference
#include "mimic++/Expectation.hpp"
#include "mimic++/Matcher.hpp"
#include "mimic++/Printer.hpp"
#include "mimic++/Utility.hpp"
#include <cassert>
#include <functional>
Include dependency graph for ExpectationPolicies.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  mimicpp::expectation_policies::InitFinalize
 
class  mimicpp::expectation_policies::Category< expected >
 
class  mimicpp::expectation_policies::Constness< constness >
 
class  mimicpp::expectation_policies::ReturnsResultOf< Action >
 
class  mimicpp::expectation_policies::Throws< Exception >
 
class  mimicpp::expectation_policies::Requirement< Matcher, Projection, Describer >
 
class  mimicpp::expectation_policies::SideEffectAction< Action >
 
class  mimicpp::expectation_policies::ApplyAllArgsAction< Action, Projection >
 
class  mimicpp::expectation_policies::ApplyArgsAction< Action, Projection, indices >
 

Namespaces

namespace  mimicpp
 
namespace  mimicpp::expectation_policies
 
namespace  mimicpp::expect
 
namespace  mimicpp::finally
 
namespace  mimicpp::then
 

Functions

template<std::size_t index, typename Matcher , typename Projection = std::identity>
constexpr auto mimicpp::expect::arg (Matcher &&matcher, Projection projection={}) noexcept(std::is_nothrow_constructible_v< std::remove_cvref_t< Matcher >, Matcher > &&std::is_nothrow_move_constructible_v< Projection >)
 Checks, whether the selected argument matches the given matcher.
 
template<typename Fun >
requires std::invocable<std::remove_cvref_t<Fun>&> && (!std::is_void_v<std::invoke_result_t<std::remove_cvref_t<Fun>&>>)
constexpr auto mimicpp::finally::returns_result_of (Fun &&fun) noexcept(std::is_nothrow_constructible_v< std::remove_cvref_t< Fun >, Fun >)
 During the finalization step, the invocation result of the given function is returned.
 
template<typename T >
requires std::copyable<std::remove_cvref_t<T>>
constexpr auto mimicpp::finally::returns (T &&value) noexcept(std::is_nothrow_constructible_v< std::remove_cvref_t< T >, T >)
 During the finalization step, the stored value is returned.
 
template<std::size_t index, std::size_t... otherIndices, typename Action >
constexpr auto mimicpp::finally::returns_apply_result_of (Action &&action) noexcept(std::is_nothrow_constructible_v< std::remove_cvref_t< Action >, Action >)
 During the finalization step, the selected call arguments are applied on the given action.
 
template<typename Action >
constexpr auto mimicpp::finally::returns_apply_all_result_of (Action &&action) noexcept(std::is_nothrow_constructible_v< std::remove_cvref_t< Action >, Action >)
 During the finalization step, all call arguments are applied on the given action.
 
template<std::size_t index>
constexpr auto mimicpp::finally::returns_arg () noexcept
 During the finalization step, the selected call argument is returned.
 
template<typename T >
requires std::copyable<std::remove_cvref_t<T>>
constexpr expectation_policies::Throws< std::remove_cvref_t< T > > mimicpp::finally::throws (T &&exception) noexcept(std::is_nothrow_constructible_v< std::remove_cvref_t< T >, T >)
 During the finalization step, the given exception is thrown.
 
template<std::size_t index, typename Action >
constexpr auto mimicpp::then::apply_arg (Action &&action) noexcept(std::is_nothrow_constructible_v< std::remove_cvref_t< Action >, Action >)
 Applies the argument at the specified index on the given action.
 
template<std::size_t index, std::size_t... additionalIndices, typename Action >
constexpr auto mimicpp::then::apply_args (Action &&action) noexcept(std::is_nothrow_constructible_v< std::remove_cvref_t< Action >, Action >)
 Applies the arguments at the specified index and in that order on the given action.
 
template<typename Action >
constexpr auto mimicpp::then::apply_all (Action &&action) noexcept(std::is_nothrow_constructible_v< std::remove_cvref_t< Action >, Action >)
 Applies all arguments on the given action.
 
template<std::invocable Action>
constexpr auto mimicpp::then::invoke (Action &&action) noexcept(std::is_nothrow_constructible_v< std::remove_cvref_t< Action >, Action >)
 Invokes the given function.