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

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

Inheritance diagram for arene::base::testing::InlineVectorTest< Vector >:
Inheritance graph

Public Types

using T = typename Vector::value_type
 

Static Public Attributes

static constexpr std::size_t capacity = Vector::capacity
 The base capacity to use for most inline_vector instantiations in the parameterized tests.
 
static constexpr bool constexpr_compatible
 Whether or not the current type parameter is constexpr compatible for this test.
 

Protected Types

template<typename U>
using non_throwing_input_iterator = input_iterator_with_configurable_noexcept<U, true>
 An input iterator pointing to any type which declares that it can not throw, used in some noexcept tests.
 
template<typename ValueType>
using standard_capacity_vector = inline_vector<ValueType, capacity>
 An inline_vector with capacity using any given type; useful in tests making vectors of wrapper types.
 
template<typename U>
using throwing_input_iterator = input_iterator_with_configurable_noexcept<U, false>
 An input iterator pointing to any type which declares that it could throw, used in some noexcept tests.
 
template<std::size_t OtherCapacity>
using vector_with_capacity = inline_vector<T, OtherCapacity>
 An inline_vector with value_type=T using any given capacity; useful in tests doing assignment.
 

Static Protected Member Functions

template<typename... U>
static constexpr auto construct (U &&... params) noexcept(noexcept(Vector(std::forward< U >(params)...))) -> Vector
 Construct a Vector from the passed parameters; allows calling as this->construct, which can be shorter.
 
static constexpr auto full_test_initializer_list () noexcept -> std::initializer_list< T >
 Return a std::initializer_list containing capacity user-parameterized test_value s.
 
static constexpr auto full_test_vector () noexcept(noexcept(test_vector(capacity))) -> Vector
 Return a Vector containing the test values [0,capacity) of T , parameterized by test suite users.
 
static void SetUpTestSuite ()
 
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_value s.
 
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_value s.
 
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 test_vector (std::size_t begin, std::size_t end) noexcept(noexcept(::arene::base::testing::test_vector< T, capacity >(begin, end))) -> Vector
 Return a Vector containing the test values [begin,end) of T , parameterized by test suite users.
 
static constexpr auto test_vector (std::size_t size) noexcept(noexcept(test_vector(0, size))) -> Vector
 Return a Vector containing the test values [0,size) of T , parameterized by test suite users.
 
template<std::size_t N>
static constexpr auto unique_test_value () noexcept(noexcept(::arene::base::testing::unique_test_value< T, N >())) -> N >())
 Return the N 'th test value of the current T , parameterized by test suite users.
 

Protected Attributes

template<typename Vec, typename... Args>
using try_construct_result
 A helper template to get the type resulting from a try_construct call.
 

Detailed Description

template<typename Vector>
class arene::base::testing::InlineVectorTest< Vector >

Test fixture for all type-parameterized inline_vector tests.

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

Member Typedef Documentation

◆ non_throwing_input_iterator

template<typename Vector>
template<typename U>
using arene::base::testing::InlineVectorTest< Vector >::non_throwing_input_iterator = input_iterator_with_configurable_noexcept<U, true>
protected

An input iterator pointing to any type which declares that it can not throw, used in some noexcept tests.

Template Parameters
UThe value type of the iterator

◆ standard_capacity_vector

template<typename Vector>
template<typename ValueType>
using arene::base::testing::InlineVectorTest< Vector >::standard_capacity_vector = inline_vector<ValueType, capacity>
protected

An inline_vector with capacity using any given type; useful in tests making vectors of wrapper types.

Template Parameters
ValueTypeThe element type of this particular vector

◆ T

template<typename Vector>
using arene::base::testing::InlineVectorTest< Vector >::T = typename Vector::value_type

◆ throwing_input_iterator

template<typename Vector>
template<typename U>
using arene::base::testing::InlineVectorTest< Vector >::throwing_input_iterator = input_iterator_with_configurable_noexcept<U, false>
protected

An input iterator pointing to any type which declares that it could throw, used in some noexcept tests.

Template Parameters
UThe value type of the iterator

◆ vector_with_capacity

template<typename Vector>
template<std::size_t OtherCapacity>
using arene::base::testing::InlineVectorTest< Vector >::vector_with_capacity = inline_vector<T, OtherCapacity>
protected

An inline_vector with value_type=T using any given capacity; useful in tests doing assignment.

Template Parameters
OtherCapacityThe capacity of this particular vector

Member Function Documentation

◆ construct()

template<typename Vector>
template<typename... U>
static constexpr auto arene::base::testing::InlineVectorTest< Vector >::construct ( U &&... params) -> Vector
inlinestaticconstexprprotectednoexcept

Construct a Vector from the passed parameters; allows calling as this->construct, which can be shorter.

Template Parameters
UThe types of the arguments to the constructor
Parameters
paramsThe parameters to the constructor

◆ full_test_initializer_list()

template<typename Vector>
static constexpr auto arene::base::testing::InlineVectorTest< Vector >::full_test_initializer_list ( ) -> std::initializer_list<T>
inlinestaticconstexprprotectednoexcept

Return a std::initializer_list containing capacity user-parameterized test_value s.

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

◆ full_test_vector()

template<typename Vector>
static constexpr auto arene::base::testing::InlineVectorTest< Vector >::full_test_vector ( ) -> Vector
inlinestaticconstexprprotectednoexcept

Return a Vector containing the test values [0,capacity) of T , parameterized by test suite users.

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

◆ SetUpTestSuite()

template<typename Vector>
static void arene::base::testing::InlineVectorTest< Vector >::SetUpTestSuite ( )
inlinestaticprotected

◆ test_initializer_list() [1/2]

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

Return a std::initializer_list containing user-parameterized test_value s.

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 Vector>
template<std::size_t... Indices>
static constexpr auto arene::base::testing::InlineVectorTest< Vector >::test_initializer_list ( std::index_sequence< Indices... > ) -> std::initializer_list<T>
inlinestaticconstexprprotectednoexcept

Return a std::initializer_list containing user-parameterized test_value s.

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 Vector>
static constexpr auto arene::base::testing::InlineVectorTest< Vector >::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

◆ test_vector() [1/2]

template<typename Vector>
static constexpr auto arene::base::testing::InlineVectorTest< Vector >::test_vector ( std::size_t begin,
std::size_t end ) -> Vector
inlinestaticconstexprprotectednoexcept

Return a Vector containing the test values [begin,end) of T , parameterized by test suite users.

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

◆ test_vector() [2/2]

template<typename Vector>
static constexpr auto arene::base::testing::InlineVectorTest< Vector >::test_vector ( std::size_t size) -> Vector
inlinestaticconstexprprotectednoexcept

Return a Vector containing the test values [0,size) of T , parameterized by test suite users.

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

◆ unique_test_value()

template<typename Vector>
template<std::size_t N>
static constexpr auto arene::base::testing::InlineVectorTest< Vector >::unique_test_value ( ) -> N>())
inlinestaticconstexprprotectednoexcept

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

Template Parameters
NThe index of the test value to get
Returns
The N 'th test value of the current T
Note
This requires test_value(0), ..., test_value(N) are unique values

Member Data Documentation

◆ capacity

template<typename Vector>
std::size_t arene::base::testing::InlineVectorTest< Vector >::capacity = Vector::capacity
staticconstexpr

The base capacity to use for most inline_vector instantiations in the parameterized tests.

◆ constexpr_compatible

template<typename Vector>
bool arene::base::testing::InlineVectorTest< Vector >::constexpr_compatible
staticconstexpr
Initial value:

Whether or not the current type parameter is constexpr compatible for this test.

◆ try_construct_result

template<typename Vector>
template<typename Vec, typename... Args>
using arene::base::testing::InlineVectorTest< Vector >::try_construct_result
protected

A helper template to get the type resulting from a try_construct call.

Template Parameters
VecAn inline_vector type which we will try to construct
ArgsThe arguments with which we will try to construct Vec

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