Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
arene::base::InlineDequeTest< Deque > Class Template Reference

Test fixture for all type-parameterized inline_deque tests. More...

Inheritance diagram for arene::base::InlineDequeTest< Deque >:
Inheritance graph

Static Public Attributes

static constexpr bool constexpr_compatible
 Whether the type parameter is constexpr compatible for this test.
 

Static Protected Member Functions

static constexpr auto construct () noexcept(noexcept(Deque())) -> Deque
 Return an empty Deque, allowing to call as this->construct, which becomes useful with the ...STATIC_ASSERT... macros.
 
static constexpr auto full_test_deque () noexcept(noexcept(test_deque(Deque::capacity))) -> Deque
 Return a Deque containing the test values [0,capacity) of T.
 
static constexpr auto full_test_initializer_list () noexcept -> std::initializer_list< T >
 Return a std::initializer_list containing Deque::capacity user-parameterized test_values.
 
static constexpr auto half_test_deque () noexcept(noexcept(test_deque(Deque::capacity))) -> Deque
 Return a Deque containing the test values [0,capacity/2) of T.
 
static constexpr auto test_deque (std::size_t begin, std::size_t end) noexcept(noexcept(::arene::base::testing::test_deque< Deque >(begin, end))) -> Deque
 Return a Deque containing the test values [begin,end) of T.
 
static constexpr auto test_deque (std::size_t size) noexcept(noexcept(test_deque(0, size))) -> Deque
 Return a Deque containing the test values [0,size) of T.
 
template<std::size_t Size>
static constexpr auto test_initializer_list () noexcept -> std::initializer_list< T >
 Return a std::initializer_list containing user-parameterized test_values.
 
template<std::size_t... Indices>
static constexpr auto test_initializer_list (std::index_sequence< Indices... >) noexcept -> std::initializer_list< T >
 Return a std::initializer_list containing user-parameterized test_values.
 
static constexpr auto test_value (std::size_t idx) noexcept(noexcept(::arene::base::testing::test_value< T >(idx))) ->
 Return the idx 'th test value of the current T , parameterized by test suite users.
 
static constexpr auto wrapped_test_deque () noexcept(noexcept(test_deque(Deque::capacity))) -> Deque
 Return a Deque containing the test values [capacity/2, 3*capacity/2) of T.
 

Detailed Description

template<typename Deque>
class arene::base::InlineDequeTest< Deque >

Test fixture for all type-parameterized inline_deque tests.

Template Parameters
DequeThe type parameter currently being used for tests; filled in by Google Test as TypeParam

Member Function Documentation

◆ construct()

template<typename Deque>
static constexpr auto arene::base::InlineDequeTest< Deque >::construct ( ) -> Deque
inlinestaticconstexprprotectednoexcept

Return an empty Deque, allowing to call as this->construct, which becomes useful with the ...STATIC_ASSERT... macros.

◆ full_test_deque()

template<typename Deque>
static constexpr auto arene::base::InlineDequeTest< Deque >::full_test_deque ( ) -> Deque
inlinestaticconstexprprotectednoexcept

Return a Deque containing the test values [0,capacity) of T.

Returns
A test deque holding the test values determined by the capacity

◆ full_test_initializer_list()

template<typename Deque>
static constexpr auto arene::base::InlineDequeTest< Deque >::full_test_initializer_list ( ) -> std::initializer_list<T>
inlinestaticconstexprprotectednoexcept

Return a std::initializer_list containing Deque::capacity user-parameterized test_values.

Returns
A copy of a statically-allocated std::initializer_list<T> containing Deque::capacity entries

◆ half_test_deque()

template<typename Deque>
static constexpr auto arene::base::InlineDequeTest< Deque >::half_test_deque ( ) -> Deque
inlinestaticconstexprprotectednoexcept

Return a Deque containing the test values [0,capacity/2) of T.

Returns
A test deque holding the test values determined by the capacity

◆ test_deque() [1/2]

template<typename Deque>
static constexpr auto arene::base::InlineDequeTest< Deque >::test_deque ( std::size_t begin,
std::size_t end ) -> Deque
inlinestaticconstexprprotectednoexcept

Return a Deque containing the test values [begin,end) of T.

Parameters
beginThe index of the first test value to put into the test deque
endThe index after that of the last test value to put into the test deque
Returns
A test deque holding the test values determined by the indices

◆ test_deque() [2/2]

template<typename Deque>
static constexpr auto arene::base::InlineDequeTest< Deque >::test_deque ( std::size_t size) -> Deque
inlinestaticconstexprprotectednoexcept

Return a Deque containing the test values [0,size) of T.

Parameters
sizeThe number of test values to put into the test deque
Returns
A test deque holding the test values determined by the size

◆ test_initializer_list() [1/2]

template<typename Deque>
template<std::size_t Size>
static constexpr auto arene::base::InlineDequeTest< Deque >::test_initializer_list ( ) -> std::initializer_list<T>
inlinestaticconstexprprotectednoexcept

Return a std::initializer_list containing user-parameterized test_values.

Template Parameters
SizeThe number of values in the std::initializer_list
Returns
A copy of a statically-allocated std::initializer_list<T> containing one test value per index

◆ test_initializer_list() [2/2]

template<typename Deque>
template<std::size_t... Indices>
static constexpr auto arene::base::InlineDequeTest< Deque >::test_initializer_list ( std::index_sequence< Indices... > ) -> std::initializer_list<T>
inlinestaticconstexprprotectednoexcept

Return a std::initializer_list containing user-parameterized test_values.

Template Parameters
IndicesA pack of indices, one for each test value in the initializer list
Returns
A copy of a statically-allocated std::initializer_list<T> containing one test value per index

◆ test_value()

template<typename Deque>
static constexpr auto arene::base::InlineDequeTest< Deque >::test_value ( std::size_t idx) ->
inlinestaticconstexprprotectednoexcept

Return the idx 'th test value of the current T , parameterized by test suite users.

Parameters
idxThe index of the test value to get
Returns
The idx 'th test value of the current T

◆ wrapped_test_deque()

template<typename Deque>
static constexpr auto arene::base::InlineDequeTest< Deque >::wrapped_test_deque ( ) -> Deque
inlinestaticconstexprprotectednoexcept

Return a Deque containing the test values [capacity/2, 3*capacity/2) of T.

Returns
A test deque holding the test values, wrapped around so they start in the middle
Note
This is useful for testing that functions aren't accidentally assuming the data starts at buffer index 0

Member Data Documentation

◆ constexpr_compatible

template<typename Deque>
bool arene::base::InlineDequeTest< Deque >::constexpr_compatible
staticconstexpr
Initial value:

Whether the type parameter is constexpr compatible for this test.


The documentation for this class was generated from the following file: