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

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

Inheritance diagram for arene::base::testing::ExternalVectorTest< T >:
Inheritance graph

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.
 
using standard_storage_type = storage_type<capacity>
 The type of the storage array for this type with the default capacity.
 
template<std::size_t Capacity>
using storage_type = arene::base::array<arene::base::byte, Capacity * sizeof(T)>
 The type of the storage array for this type with the specified capacity.
 
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.
 
using vector = external_vector<T>
 A standard vector with the correct type, used in most test cases.
 

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 test_external_vector (arene::base::span< arene::base::byte > storage) noexcept(std::is_nothrow_move_constructible< T >::value) -> vector
 Return a vector containing the test values [0,capacity) of T , parameterized by test suite users.
 
static constexpr auto test_external_vector (arene::base::span< arene::base::byte > storage, std::size_t begin, std::size_t end) noexcept(std::is_nothrow_move_constructible< T >::value) -> vector
 Return a vector containing the test values [begin,end) of T , parameterized by test suite users.
 
static constexpr auto test_external_vector (arene::base::span< arene::base::byte > storage, std::size_t size) noexcept(std::is_nothrow_move_constructible< T >::value) -> vector
 Return a vector containing the test values [0,size) of T , parameterized by test suite users.
 
static constexpr auto test_value (std::size_t idx) noexcept(std::is_nothrow_move_constructible< T >::value) -> T
 Return the idx 'th test value of the current T , parameterized by test suite users.
 

Protected Attributes

standard_storage_type standard_storage {}
 An instance of the default storage type to use as backing for a default capacity vector.
 
template<typename Vector, typename... Args>
using try_construct_result
 A helper template to get the type resulting from a try_construct call.
 

Static Protected Attributes

static constexpr std::size_t capacity = 25
 The base capacity to use for most external_vector instantiations in the parameterized tests.
 

Detailed Description

template<typename T>
class arene::base::testing::ExternalVectorTest< T >

Test fixture for all type-parameterized external_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 T>
template<typename U>
using arene::base::testing::ExternalVectorTest< T >::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_storage_type

template<typename T>
using arene::base::testing::ExternalVectorTest< T >::standard_storage_type = storage_type<capacity>
protected

The type of the storage array for this type with the default capacity.

◆ storage_type

template<typename T>
template<std::size_t Capacity>
using arene::base::testing::ExternalVectorTest< T >::storage_type = arene::base::array<arene::base::byte, Capacity * sizeof(T)>
protected

The type of the storage array for this type with the specified capacity.

Template Parameters
CapacityThe capacity of the expected container

◆ throwing_input_iterator

template<typename T>
template<typename U>
using arene::base::testing::ExternalVectorTest< T >::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

template<typename T>
using arene::base::testing::ExternalVectorTest< T >::vector = external_vector<T>
protected

A standard vector with the correct type, used in most test cases.

Member Function Documentation

◆ construct()

template<typename T>
template<typename... U>
static constexpr auto arene::base::testing::ExternalVectorTest< T >::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

◆ test_external_vector() [1/3]

template<typename T>
static constexpr auto arene::base::testing::ExternalVectorTest< T >::test_external_vector ( arene::base::span< arene::base::byte > storage) -> vector
inlinestaticconstexprprotectednoexcept

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

Parameters
storageThe storage space to use for the values stored in the vector
Returns
A test vector holding the test values determined by the capacity

◆ test_external_vector() [2/3]

template<typename T>
static constexpr auto arene::base::testing::ExternalVectorTest< T >::test_external_vector ( arene::base::span< arene::base::byte > storage,
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
storageThe storage space to use for the values stored in the vector
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_external_vector() [3/3]

template<typename T>
static constexpr auto arene::base::testing::ExternalVectorTest< T >::test_external_vector ( arene::base::span< arene::base::byte > storage,
std::size_t size ) -> vector
inlinestaticconstexprprotectednoexcept

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

Parameters
storageThe storage space to use for the values stored in the vector
sizeThe number of test values to put into the test vector
Returns
A test vector holding the test values determined by the size

◆ test_value()

template<typename T>
static constexpr auto arene::base::testing::ExternalVectorTest< T >::test_value ( std::size_t idx) -> T
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

Member Data Documentation

◆ capacity

template<typename T>
std::size_t arene::base::testing::ExternalVectorTest< T >::capacity = 25
staticconstexprprotected

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

◆ standard_storage

template<typename T>
standard_storage_type arene::base::testing::ExternalVectorTest< T >::standard_storage {}
protected

An instance of the default storage type to use as backing for a default capacity vector.

◆ try_construct_result

template<typename T>
template<typename Vector, typename... Args>
using arene::base::testing::ExternalVectorTest< T >::try_construct_result
protected

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

Template Parameters
VectorAn external_vector type which we will try to construct
ArgsThe arguments with which we will try to construct Vector

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