Merge branch 'hot-fix/#536-undefined-behaviour-and-memory-issues' into development

# Conflicts:
#	test/CMakeLists.txt
This commit is contained in:
John Wellbelove 2022-05-17 11:17:29 +01:00
commit c09a1885b5
56 changed files with 1269 additions and 420 deletions

View File

@ -1,6 +1,6 @@
{
"name": "Embedded Template Library - Arduino",
"version": "20.27.3",
"version": "20.28.0",
"authors": {
"name": "John Wellbelove",
"email": "john.wellbelove@etlcpp.com"

View File

@ -1,5 +1,5 @@
name=Embedded Template Library - Arduino
version=20.27.3
version=20.28.0
author= John Wellbelove <john.wellbelove@etlcpp.com>
maintainer=John Wellbelove <john.wellbelove@etlcpp.com>
license=MIT

View File

@ -32,6 +32,7 @@ SOFTWARE.
#define ETL_ABSOLUTE_INCLUDED
#include "type_traits.h"
#include "integral_limits.h"
namespace etl
{
@ -54,6 +55,33 @@ namespace etl
{
return value;
}
//***************************************************************************
// For signed types.
// Returns the result as the unsigned type.
//***************************************************************************
#if ETL_USING_CPP11
template <typename T, typename TReturn = typename etl::make_unsigned<T>::type>
#else
template <typename T, typename TReturn>
#endif
ETL_CONSTEXPR typename etl::enable_if<etl::is_signed<T>::value, TReturn>::type
absolute_unsigned(T value)
{
return (value == etl::integral_limits<T>::min) ? etl::integral_limits<TReturn>::max / 2U
: (value < T(0)) ? TReturn(-value) : TReturn(value);
}
//***************************************************************************
// For unsigned types.
// Returns the result as the unsigned type.
//***************************************************************************
template <typename T>
ETL_CONSTEXPR typename etl::enable_if<etl::is_unsigned<T>::value, T>::type
absolute_unsigned(T value)
{
return etl::absolute(value);
}
}
#endif

View File

@ -120,7 +120,7 @@ namespace etl
#else
ETL_STATIC_ASSERT(etl::is_integral<T>::value, "Not an integral type");
const size_t SHIFT = etl::integral_limits<typename etl::make_unsigned<T>::type>::bits - 1;
ETL_CONSTANT size_t SHIFT = etl::integral_limits<typename etl::make_unsigned<T>::type>::bits - 1U;
return (value << 1U) | (value >> SHIFT);
#endif
@ -138,11 +138,18 @@ namespace etl
#else
ETL_STATIC_ASSERT(etl::is_integral<T>::value, "Not an integral type");
const size_t BITS = etl::integral_limits<typename etl::make_unsigned<T>::type>::bits;
ETL_CONSTANT size_t BITS = etl::integral_limits<typename etl::make_unsigned<T>::type>::bits;
distance %= BITS;
const size_t SHIFT = BITS - distance;
return (value << distance) | (value >> SHIFT);
if (SHIFT == BITS)
{
return value;
}
else
{
return (value << distance) | (value >> SHIFT);
}
#endif
}
@ -158,7 +165,7 @@ namespace etl
#else
ETL_STATIC_ASSERT(etl::is_integral<T>::value, "Not an integral type");
const size_t SHIFT = etl::integral_limits<typename etl::make_unsigned<T>::type>::bits - 1;
ETL_CONSTANT size_t SHIFT = etl::integral_limits<typename etl::make_unsigned<T>::type>::bits - 1U;
return (value >> 1U) | (value << SHIFT);
#endif
@ -176,11 +183,18 @@ namespace etl
#else
ETL_STATIC_ASSERT(etl::is_integral<T>::value, "Not an integral type");
const size_t BITS = etl::integral_limits<typename etl::make_unsigned<T>::type>::bits;
ETL_CONSTANT size_t BITS = etl::integral_limits<typename etl::make_unsigned<T>::type>::bits;
distance %= BITS;
const size_t SHIFT = BITS - distance;
return (value >> distance) | (value << SHIFT);
if (SHIFT == BITS)
{
return value;
}
else
{
return (value >> distance) | (value << SHIFT);
}
#endif
}
@ -224,13 +238,13 @@ namespace etl
/// Fold a binary number down to a set number of bits using XOR.
///\ingroup binary
//***************************************************************************
template <typename TReturn, const size_t NBITS, typename TValue>
template <typename TReturn, size_t NBITS, typename TValue>
ETL_CONSTEXPR14 TReturn fold_bits(TValue value)
{
ETL_STATIC_ASSERT(integral_limits<TReturn>::bits >= NBITS, "Return type too small to hold result");
const TValue mask = etl::power<2, NBITS>::value - 1U;
const size_t shift = NBITS;
ETL_CONSTANT TValue mask = etl::power<2, NBITS>::value - 1U;
ETL_CONSTANT size_t shift = NBITS;
// Fold the value down to fit the width.
TReturn folded_value = 0;
@ -253,7 +267,7 @@ namespace etl
/// Converts an N bit binary number, where bit N-1 is the sign bit, to a signed integral type.
///\ingroup binary
//***************************************************************************
template <typename TReturn, const size_t NBITS, typename TValue>
template <typename TReturn, size_t NBITS, typename TValue>
ETL_CONSTEXPR14 TReturn sign_extend(TValue value)
{
ETL_STATIC_ASSERT(etl::is_integral<TValue>::value, "TValue not an integral type");
@ -274,7 +288,7 @@ namespace etl
/// is the right shift amount, to a signed integral type.
///\ingroup binary
//***************************************************************************
template <typename TReturn, const size_t NBITS, const size_t SHIFT, typename TValue>
template <typename TReturn, size_t NBITS, size_t SHIFT, typename TValue>
ETL_CONSTEXPR14 TReturn sign_extend(TValue value)
{
ETL_STATIC_ASSERT(etl::is_integral<TValue>::value, "TValue not an integral type");
@ -296,7 +310,7 @@ namespace etl
///\ingroup binary
//***************************************************************************
template <typename TReturn, typename TValue>
ETL_CONSTEXPR14 TReturn sign_extend(TValue value, const size_t NBITS)
ETL_CONSTEXPR14 TReturn sign_extend(TValue value, size_t NBITS)
{
ETL_STATIC_ASSERT(etl::is_integral<TValue>::value, "TValue not an integral type");
ETL_STATIC_ASSERT(etl::is_integral<TReturn>::value, "TReturn not an integral type");
@ -316,7 +330,7 @@ namespace etl
///\ingroup binary
//***************************************************************************
template <typename TReturn, typename TValue>
ETL_CONSTEXPR14 TReturn sign_extend(TValue value, const size_t NBITS, const size_t SHIFT)
ETL_CONSTEXPR14 TReturn sign_extend(TValue value, size_t NBITS, size_t SHIFT)
{
ETL_STATIC_ASSERT(etl::is_integral<TValue>::value, "TValue not an integral type");
ETL_STATIC_ASSERT(etl::is_integral<TReturn>::value, "TReturn not an integral type");
@ -398,7 +412,7 @@ namespace etl
ETL_STATIC_ASSERT(sizeof(TResult) >= sizeof(TValue), "Result must be at least as large as the fill value");
typedef typename etl::make_unsigned<TResult>::type unsigned_r_t;
typedef typename etl::make_unsigned<TValue>::type unsigned_v_t;
typedef typename etl::make_unsigned<TValue>::type unsigned_v_t;
return TResult(unsigned_v_t(value) * (unsigned_r_t(~unsigned_r_t(0U)) / unsigned_v_t(~unsigned_v_t(0U))));
}
@ -407,13 +421,13 @@ namespace etl
/// Fills a value with a bit pattern. Partial compile time.
///\ingroup binary
//***************************************************************************
template <typename TResult, typename TValue, const TValue N>
template <typename TResult, typename TValue, TValue N>
ETL_CONSTEXPR TResult binary_fill()
{
ETL_STATIC_ASSERT(sizeof(TResult) >= sizeof(TValue), "Result must be at least as large as the fill value");
typedef typename etl::make_unsigned<TResult>::type unsigned_r_t;
typedef typename etl::make_unsigned<TValue>::type unsigned_v_t;
typedef typename etl::make_unsigned<TValue>::type unsigned_v_t;
return TResult(unsigned_v_t(N) * (unsigned_r_t(~unsigned_r_t(0U)) / unsigned_v_t(~unsigned_v_t(0U))));
}
@ -424,7 +438,7 @@ namespace etl
///\ingroup binary
//***************************************************************************
template <typename TValue>
ETL_CONSTEXPR14 bool has_zero_byte(const TValue value)
ETL_CONSTEXPR14 bool has_zero_byte(TValue value)
{
typedef typename etl::make_unsigned<TValue>::type unsigned_t;
const unsigned_t mask = etl::binary_fill<unsigned_t, uint8_t>(0x7FU);
@ -437,7 +451,7 @@ namespace etl
/// Detects the presence of zero bytes. Partial compile time.
///\ingroup binary
//***************************************************************************
template <typename TValue, const TValue N>
template <typename TValue, TValue N>
ETL_CONSTEXPR14 bool has_zero_byte()
{
typedef typename etl::make_unsigned<TValue>::type unsigned_t;
@ -461,7 +475,7 @@ namespace etl
/// Detects the presence of a byte of value N. Partial compile time.
///\ingroup binary
//***************************************************************************
template <typename TValue, const TValue N>
template <typename TValue, TValue N>
ETL_CONSTEXPR14 bool has_byte_n(TValue value)
{
return etl::has_zero_byte(TValue(value ^ etl::binary_fill<TValue, uint8_t>(N)));
@ -475,7 +489,7 @@ namespace etl
///\ingroup binary
//***************************************************************************
template <typename T>
ETL_CONSTEXPR T binary_merge(const T first, const T second, const T mask)
ETL_CONSTEXPR T binary_merge(T first, T second, T mask)
{
return second ^ ((second ^ first) & mask);
}
@ -486,8 +500,8 @@ namespace etl
/// Mask is a template parameter.
///\ingroup binary
//***************************************************************************
template <typename T, const T MASK>
ETL_CONSTEXPR T binary_merge(const T first, const T second)
template <typename T, T MASK>
ETL_CONSTEXPR T binary_merge(T first, T second)
{
return second ^ ((second ^ first) & MASK);
}
@ -2151,7 +2165,7 @@ namespace etl
//***************************************************************************
template <typename T>
ETL_CONSTEXPR typename etl::enable_if<etl::is_integral<T>::value, bool>::type
is_odd(const T value)
is_odd(T value)
{
return ((static_cast<typename etl::make_unsigned<T>::type>(value) & 1U) != 0U);
}
@ -2162,7 +2176,7 @@ namespace etl
//***************************************************************************
template <typename T>
ETL_CONSTEXPR typename etl::enable_if<etl::is_integral<T>::value, bool>::type
is_even(const T value)
is_even(T value)
{
return ((static_cast<typename etl::make_unsigned<T>::type>(value) & 1U) == 0U);
}

View File

@ -231,10 +231,12 @@ namespace etl
while (width != 0)
{
unsigned char mask_width = static_cast<unsigned char>(etl::min(width, bits_in_byte));
unsigned char chunk = get_chunk(mask_width);
typedef typename etl::make_unsigned<T>::type chunk_t;
chunk_t chunk = get_chunk(mask_width);
width -= mask_width;
value |= static_cast<T>(chunk) << width;
value |= static_cast<T>(chunk << width);
}
success = true;

View File

@ -447,12 +447,12 @@ namespace etl
if (OK)
{
T shift = T(0);
uint_least8_t shift = 0U;
for (size_t i = 0UL; i < SIZE; ++i)
{
v |= T(pdata[i]) << shift;
shift += T(BITS_PER_ELEMENT);
v |= T(typename etl::make_unsigned<T>::type(pdata[i]) << shift);
shift += uint_least8_t(BITS_PER_ELEMENT);
}
}

View File

@ -559,7 +559,7 @@ namespace etl
{
T* destination = start;
while (length-- != 0U)
for (size_t i = 0; i < length; ++i)
{
*destination++ = from_bytes<T>();
}

View File

@ -296,9 +296,7 @@ namespace etl
//*************************************************************************
iterator& operator +=(int n)
{
n = picb->BUFFER_SIZE + n;
current += n;
current += size_type(picb->BUFFER_SIZE + n);
current %= picb->BUFFER_SIZE;
return (*this);
@ -569,9 +567,7 @@ namespace etl
//*************************************************************************
const_iterator& operator +=(int n)
{
n = picb->BUFFER_SIZE + n;
current += n;
current += size_type(picb->BUFFER_SIZE + n);
current %= picb->BUFFER_SIZE;
return (*this);

View File

@ -206,7 +206,7 @@ namespace etl
//*************************************************************************
cumulative_moving_average(const T initial_value, const size_t sample_size)
: average(initial_value * SCALE)
, samples(sample_size)
, samples(sample_t(sample_size))
{
}

View File

@ -94,5 +94,6 @@ SOFTWARE.
#define ETL_ARRAY_WRAPPER_FILE_ID "61"
#define ETL_MEM_CAST_FILE_ID "62"
#define ETL_SINGLETON_FILE_ID "63"
#define ETL_SUCCESSOR_FILE_ID "64"
#endif

View File

@ -46,7 +46,6 @@ namespace etl
class fixed_sized_memory_block_allocator : public imemory_block_allocator
{
public:
static ETL_CONSTANT size_t Block_Size = VBlock_Size;
static ETL_CONSTANT size_t Alignment = VAlignment;
static ETL_CONSTANT size_t Size = VSize;
@ -58,17 +57,6 @@ namespace etl
{
}
#if defined(ETL_IN_UNIT_TEST)
//*************************************************************************
/// Returns true if the allocator is the owner of the block.
/// For unit testing purposes.
//*************************************************************************
bool is_owner_of(const void* const pblock) const
{
return pool.is_in_pool(pblock);
}
#endif
private:
/// A structure that has the size Block_Size.
@ -110,6 +98,14 @@ namespace etl
}
}
//*************************************************************************
/// Returns true if the allocator is the owner of the block.
//*************************************************************************
virtual bool is_owner_of_block(const void* const pblock) const ETL_OVERRIDE
{
return pool.is_in_pool(pblock);
}
/// The generic pool from which allocate memory blocks.
etl::generic_pool<Block_Size, Alignment, Size> pool;
};

View File

@ -438,6 +438,6 @@ namespace etl
};
}
#endif ETL_USING_8BIT_TYPES
#endif // ETL_USING_8BIT_TYPES
#endif

View File

@ -66,7 +66,7 @@ namespace etl
/// ...and we have a successor...
if (has_successor())
{
// Try to allocate from the next one in the chain.
// ...try to allocate from the next one in the chain.
return get_successor().allocate(required_size, required_alignment);
}
}
@ -82,13 +82,13 @@ namespace etl
{
bool was_released = release_block(p);
// Call the derived implementation to try to release.
// If that failed...
if (!was_released)
{
// If it failed and we have a successor...
/// ...and we have a successor...
if (has_successor())
{
// Try to release from the next one in the chain.
// ...try to release from the next one in the chain.
was_released = get_successor().release(p);
}
}
@ -96,10 +96,33 @@ namespace etl
return was_released;
}
//*****************************************************************************
/// Check if the memory block is owned by this allocator.
/// If this allocator does not own it, then pass the request on the the successor, if configured.
//*****************************************************************************
bool is_owner_of(const void* const p) const
{
bool is_owner = is_owner_of_block(p);
// If that failed...
if (!is_owner)
{
/// ...and we have a successor...
if (has_successor())
{
// ...check with the next one in the chain.
is_owner = get_successor().is_owner_of(p);
}
}
return is_owner;
}
protected:
virtual void* allocate_block(size_t required_size, size_t required_alignment) = 0;
virtual bool release_block(const void* const) = 0;
virtual bool is_owner_of_block(const void* const) const = 0;
private:

View File

@ -1208,7 +1208,6 @@ namespace etl
#endif
~iindirect_vector()
{
initialise();
}
protected:

View File

@ -533,7 +533,7 @@ namespace etl
const type p = reinterpret_cast<type>(pbuffer);
return 1U << etl::count_trailing_zeros(p);
return size_t(1U) << etl::count_trailing_zeros(p);
}
//***********************************

View File

@ -35,7 +35,7 @@ SOFTWARE.
#include <stddef.h>
#if ETL_CPP11_NOT_SUPPORTED || ETL_NOT_USING_STL
#if ETL_CPP11_NOT_SUPPORTED
// Use the old style C++ NULL definition.
#define ETL_NULLPTR 0
#else

View File

@ -385,7 +385,8 @@ namespace etl
denominator *= 10U;
}
working_t abs_value = etl::absolute(value);
// Get the absolute value, taking care of minimum negative values.
working_t abs_value = etl::absolute_unsigned(value);
// Figure out how many decimal digits we have in the value.
const uint32_t& original_decimal_digits = denominator_exponent;

View File

@ -155,13 +155,18 @@ namespace etl
}
//*************************************************************************
/// Destruct a message and send it back to the pool.
/// Destruct a message and send it back to the allocator.
//*************************************************************************
void release(const etl::ireference_counted_message& rcmessage)
{
rcmessage.~ireference_counted_message();
bool released = false;
lock();
bool released = memory_block_allocator.release(&rcmessage);
if (memory_block_allocator.is_owner_of(&rcmessage))
{
rcmessage.~ireference_counted_message();
released = memory_block_allocator.release(&rcmessage);
}
unlock();
ETL_ASSERT(released, ETL_ERROR(etl::reference_counted_message_pool_release_failure));

View File

@ -33,9 +33,38 @@ SOFTWARE.
#include "platform.h"
#include "nullptr.h"
#include "exception.h"
#include "error_handler.h"
#include "file_error_numbers.h"
namespace etl
{
//***************************************************************************
/// Exception for the successor.
//***************************************************************************
class successor_exception : public etl::exception
{
public:
successor_exception(string_type reason_, string_type file_name_, numeric_type line_number_)
: exception(reason_, file_name_, line_number_)
{
}
};
//***************************************************************************
/// Invalid exception for successor.
//***************************************************************************
class successor_invalid : public etl::successor_exception
{
public:
successor_invalid(string_type file_name_, numeric_type line_number_)
: etl::successor_exception(ETL_ERROR_TEXT("successor:invalid", ETL_SUCCESSOR_FILE_ID"A"), file_name_, line_number_)
{
}
};
//***************************************************************************
/// Adds successor traits to a class.
//***************************************************************************
@ -70,16 +99,75 @@ namespace etl
p_successor = &s;
}
#if ETL_CPP11_SUPPORTED
//*************************************************************************
/// Set a list of successors to this.
//*************************************************************************
template <typename... TSuccessors>
void set_successor(successor_type& s, TSuccessors&... rest)
{
set_successor(s);
s.set_successor(rest...);
}
#endif
//*************************************************************************
/// Append a successor.
//*************************************************************************
template <typename TSuccessor>
void append_successor(TSuccessor& s)
{
if (has_successor())
{
get_successor().append_successor(s);
}
else
{
set_successor(s);
}
}
#if ETL_CPP11_SUPPORTED
//*************************************************************************
/// Append the successor.
//*************************************************************************
template <typename TSuccessor, typename... TSuccessors>
void append_successor(TSuccessor& s, TSuccessors&... rest)
{
if (has_successor())
{
get_successor().append_successor(s);
get_successor().append_successor(rest...);
}
else
{
set_successor(s);
append_successor(rest...);
}
}
#endif
//*************************************************************************
/// Clear the successor.
//*************************************************************************
void clear_successor()
{
p_successor = ETL_NULLPTR;
}
//*************************************************************************
/// Get the successor.
/// Emits an etl::successor_invalid if a successor has not been set.
//*************************************************************************
successor_type& get_successor() const
{
ETL_ASSERT(has_successor(), ETL_ERROR(successor_invalid));
return *p_successor;
}
//*************************************************************************
/// Do we have a successor?
/// Does this have a successor?
//*************************************************************************
bool has_successor() const
{

View File

@ -158,7 +158,7 @@ namespace etl
value_type key_value_pair;
};
private:
protected:
typedef etl::intrusive_forward_list<node_t, link_t> bucket_t;
typedef etl::ipool pool_t;
@ -195,9 +195,9 @@ namespace etl
//*********************************
iterator(const iterator& other)
: pbuckets_end(other.pbuckets_end),
pbucket(other.pbucket),
inode(other.inode)
: pbuckets_end(other.pbuckets_end)
, pbucket(other.pbucket)
, inode(other.inode)
{
}
@ -277,9 +277,9 @@ namespace etl
//*********************************
iterator(bucket_t* pbuckets_end_, bucket_t* pbucket_, local_iterator inode_)
: pbuckets_end(pbuckets_end_),
pbucket(pbucket_),
inode(inode_)
: pbuckets_end(pbuckets_end_)
, pbucket(pbucket_)
, inode(inode_)
{
}
@ -338,17 +338,17 @@ namespace etl
//*********************************
const_iterator(const typename iunordered_map::iterator& other)
: pbuckets_end(other.pbuckets_end),
pbucket(other.pbucket),
inode(other.inode)
: pbuckets_end(other.pbuckets_end)
, pbucket(other.pbucket)
, inode(other.inode)
{
}
//*********************************
const_iterator(const const_iterator& other)
: pbuckets_end(other.pbuckets_end),
pbucket(other.pbucket),
inode(other.inode)
: pbuckets_end(other.pbuckets_end)
, pbucket(other.pbucket)
, inode(other.inode)
{
}
@ -428,9 +428,9 @@ namespace etl
//*********************************
const_iterator(bucket_t* pbuckets_end_, bucket_t* pbucket_, local_iterator inode_)
: pbuckets_end(pbuckets_end_),
pbucket(pbucket_),
inode(inode_)
: pbuckets_end(pbuckets_end_)
, pbucket(pbucket_)
, inode(inode_)
{
}
@ -1305,9 +1305,11 @@ namespace etl
/// Constructor.
//*********************************************************************
iunordered_map(pool_t& node_pool_, bucket_t* pbuckets_, size_t number_of_buckets_)
: pnodepool(&node_pool_),
pbuckets(pbuckets_),
number_of_buckets(number_of_buckets_)
: pnodepool(&node_pool_)
, pbuckets(pbuckets_)
, number_of_buckets(number_of_buckets_)
, first(pbuckets)
, last(pbuckets)
{
}
@ -1347,7 +1349,7 @@ namespace etl
}
first = pbuckets;
last = first;
last = first;
}
#if ETL_USING_CPP11
@ -1438,10 +1440,6 @@ namespace etl
++pcurrent;
}
}
else
{
// Nothing to do.
}
}
}
@ -1533,7 +1531,6 @@ namespace etl
unordered_map()
: base(node_pool, buckets, MAX_BUCKETS_)
{
base::initialise();
}
//*************************************************************************
@ -1628,7 +1625,7 @@ namespace etl
etl::pool<typename base::node_t, MAX_SIZE> node_pool;
/// The buckets of node lists.
etl::intrusive_forward_list<typename base::node_t> buckets[MAX_BUCKETS_];
typename base::bucket_t buckets[MAX_BUCKETS_];
};
//*************************************************************************

View File

@ -156,7 +156,7 @@ namespace etl
value_type key_value_pair;
};
private:
protected:
typedef etl::intrusive_forward_list<node_t, link_t> bucket_t;
typedef etl::ipool pool_t;
@ -193,9 +193,9 @@ namespace etl
//*********************************
iterator(const iterator& other)
: pbuckets_end(other.pbuckets_end),
pbucket(other.pbucket),
inode(other.inode)
: pbuckets_end(other.pbuckets_end)
, pbucket(other.pbucket)
, inode(other.inode)
{
}
@ -275,9 +275,9 @@ namespace etl
//*********************************
iterator(bucket_t* pbuckets_end_, bucket_t* pbucket_, local_iterator inode_)
: pbuckets_end(pbuckets_end_),
pbucket(pbucket_),
inode(inode_)
: pbuckets_end(pbuckets_end_)
, pbucket(pbucket_)
, inode(inode_)
{
}
@ -336,17 +336,17 @@ namespace etl
//*********************************
const_iterator(const typename iunordered_multimap::iterator& other)
: pbuckets_end(other.pbuckets_end),
pbucket(other.pbucket),
inode(other.inode)
: pbuckets_end(other.pbuckets_end)
, pbucket(other.pbucket)
, inode(other.inode)
{
}
//*********************************
const_iterator(const const_iterator& other)
: pbuckets_end(other.pbuckets_end),
pbucket(other.pbucket),
inode(other.inode)
: pbuckets_end(other.pbuckets_end)
, pbucket(other.pbucket)
, inode(other.inode)
{
}
@ -427,9 +427,9 @@ namespace etl
//*********************************
const_iterator(bucket_t* pbuckets_end_, bucket_t* pbucket_, local_iterator inode_)
: pbuckets_end(pbuckets_end_),
pbucket(pbucket_),
inode(inode_)
: pbuckets_end(pbuckets_end_)
, pbucket(pbucket_)
, inode(inode_)
{
}
@ -1212,9 +1212,11 @@ namespace etl
/// Constructor.
//*********************************************************************
iunordered_multimap(pool_t& node_pool_, bucket_t* pbuckets_, size_t number_of_buckets_)
: pnodepool(&node_pool_),
pbuckets(pbuckets_),
number_of_buckets(number_of_buckets_)
: pnodepool(&node_pool_)
, pbuckets(pbuckets_)
, number_of_buckets(number_of_buckets_)
, first(pbuckets)
, last(pbuckets)
{
}
@ -1253,7 +1255,7 @@ namespace etl
}
first = pbuckets;
last = first;
last = first;
}
#if ETL_USING_CPP11
@ -1291,7 +1293,7 @@ namespace etl
if (size() == 1)
{
first = pbucket;
last = pbucket;
last = pbucket;
}
else
{
@ -1344,10 +1346,6 @@ namespace etl
++pcurrent;
}
}
else
{
// Nothing to do.
}
}
}
@ -1439,7 +1437,6 @@ namespace etl
unordered_multimap()
: base(node_pool, buckets, MAX_BUCKETS)
{
base::initialise();
}
//*************************************************************************
@ -1539,7 +1536,7 @@ namespace etl
etl::pool<typename base::node_t, MAX_SIZE> node_pool;
/// The buckets of node lists.
etl::intrusive_forward_list<typename base::node_t> buckets[MAX_BUCKETS_];
typename base::bucket_t buckets[MAX_BUCKETS_];
};
//*************************************************************************

View File

@ -154,7 +154,7 @@ namespace etl
value_type key;
};
private:
protected:
typedef etl::intrusive_forward_list<node_t, link_t> bucket_t;
typedef etl::ipool pool_t;
@ -190,9 +190,9 @@ namespace etl
//*********************************
iterator(const iterator& other)
: pbuckets_end(other.pbuckets_end),
pbucket(other.pbucket),
inode(other.inode)
: pbuckets_end(other.pbuckets_end)
, pbucket(other.pbucket)
, inode(other.inode)
{
}
@ -272,9 +272,9 @@ namespace etl
//*********************************
iterator(bucket_t* pbuckets_end_, bucket_t* pbucket_, local_iterator inode_)
: pbuckets_end(pbuckets_end_),
pbucket(pbucket_),
inode(inode_)
: pbuckets_end(pbuckets_end_)
, pbucket(pbucket_)
, inode(inode_)
{
}
@ -332,17 +332,17 @@ namespace etl
//*********************************
const_iterator(const typename iunordered_multiset::iterator& other)
: pbuckets_end(other.pbuckets_end),
pbucket(other.pbucket),
inode(other.inode)
: pbuckets_end(other.pbuckets_end)
, pbucket(other.pbucket)
, inode(other.inode)
{
}
//*********************************
const_iterator(const const_iterator& other)
: pbuckets_end(other.pbuckets_end),
pbucket(other.pbucket),
inode(other.inode)
: pbuckets_end(other.pbuckets_end)
, pbucket(other.pbucket)
, inode(other.inode)
{
}
@ -423,9 +423,9 @@ namespace etl
//*********************************
const_iterator(bucket_t* pbuckets_end_, bucket_t* pbucket_, local_iterator inode_)
: pbuckets_end(pbuckets_end_),
pbucket(pbucket_),
inode(inode_)
: pbuckets_end(pbuckets_end_)
, pbucket(pbucket_)
, inode(inode_)
{
}
@ -726,8 +726,8 @@ namespace etl
::new (&node.key) value_type(etl::move(key));
ETL_INCREMENT_DEBUG_COUNT
// Just add the pointer to the bucket;
bucket.insert_after(bucket.before_begin(), node);
// Just add the pointer to the bucket;
bucket.insert_after(bucket.before_begin(), node);
adjust_first_last_markers_after_insert(&bucket);
result.first = iterator((pbuckets + number_of_buckets), pbucket, pbucket->begin());
@ -1196,9 +1196,11 @@ namespace etl
/// Constructor.
//*********************************************************************
iunordered_multiset(pool_t& node_pool_, bucket_t* pbuckets_, size_t number_of_buckets_)
: pnodepool(&node_pool_),
pbuckets(pbuckets_),
number_of_buckets(number_of_buckets_)
: pnodepool(&node_pool_)
, pbuckets(pbuckets_)
, number_of_buckets(number_of_buckets_)
, first(pbuckets)
, last(pbuckets)
{
}
@ -1237,7 +1239,7 @@ namespace etl
}
first = pbuckets;
last = first;
last = first;
}
#if ETL_USING_CPP11
@ -1275,7 +1277,7 @@ namespace etl
if (size() == 1)
{
first = pbucket;
last = pbucket;
last = pbucket;
}
else
{
@ -1298,7 +1300,7 @@ namespace etl
if (empty())
{
first = pbuckets;
last = pbuckets;
last = pbuckets;
}
else
{
@ -1328,10 +1330,6 @@ namespace etl
++pcurrent;
}
}
else
{
// Nothing to do.
}
}
}
@ -1424,7 +1422,6 @@ namespace etl
unordered_multiset()
: base(node_pool, buckets, MAX_BUCKETS)
{
base::initialise();
}
//*************************************************************************
@ -1525,7 +1522,7 @@ namespace etl
etl::pool<typename base::node_t, MAX_SIZE> node_pool;
/// The buckets of node lists.
etl::intrusive_forward_list<typename base::node_t> buckets[MAX_BUCKETS_];
typename base::bucket_t buckets[MAX_BUCKETS_];
};
//*************************************************************************

View File

@ -155,7 +155,7 @@ namespace etl
value_type key;
};
private:
protected:
typedef etl::intrusive_forward_list<node_t, link_t> bucket_t;
typedef etl::ipool pool_t;
@ -191,9 +191,9 @@ namespace etl
//*********************************
iterator(const iterator& other)
: pbuckets_end(other.pbuckets_end),
pbucket(other.pbucket),
inode(other.inode)
: pbuckets_end(other.pbuckets_end)
, pbucket(other.pbucket)
, inode(other.inode)
{
}
@ -273,9 +273,9 @@ namespace etl
//*********************************
iterator(bucket_t* pbuckets_end_, bucket_t* pbucket_, local_iterator inode_)
: pbuckets_end(pbuckets_end_),
pbucket(pbucket_),
inode(inode_)
: pbuckets_end(pbuckets_end_)
, pbucket(pbucket_)
, inode(inode_)
{
}
@ -333,17 +333,17 @@ namespace etl
//*********************************
const_iterator(const typename iunordered_set::iterator& other)
: pbuckets_end(other.pbuckets_end),
pbucket(other.pbucket),
inode(other.inode)
: pbuckets_end(other.pbuckets_end)
, pbucket(other.pbucket)
, inode(other.inode)
{
}
//*********************************
const_iterator(const const_iterator& other)
: pbuckets_end(other.pbuckets_end),
pbucket(other.pbucket),
inode(other.inode)
: pbuckets_end(other.pbuckets_end)
, pbucket(other.pbucket)
, inode(other.inode)
{
}
@ -424,9 +424,9 @@ namespace etl
//*********************************
const_iterator(bucket_t* pbuckets_end_, bucket_t* pbucket_, local_iterator inode_)
: pbuckets_end(pbuckets_end_),
pbucket(pbucket_),
inode(inode_)
: pbuckets_end(pbuckets_end_)
, pbucket(pbucket_)
, inode(inode_)
{
}
@ -456,7 +456,7 @@ namespace etl
bucket_t* pbuckets_end;
bucket_t* pbucket;
local_iterator inode;
local_iterator inode;
};
typedef typename etl::iterator_traits<iterator>::difference_type difference_type;
@ -1190,9 +1190,11 @@ namespace etl
/// Constructor.
//*********************************************************************
iunordered_set(pool_t& node_pool_, bucket_t* pbuckets_, size_t number_of_buckets_)
: pnodepool(&node_pool_),
pbuckets(pbuckets_),
number_of_buckets(number_of_buckets_)
: pnodepool(&node_pool_)
, pbuckets(pbuckets_)
, number_of_buckets(number_of_buckets_)
, first(pbuckets)
, last(pbuckets)
{
}
@ -1231,7 +1233,7 @@ namespace etl
}
first = pbuckets;
last = first;
last = first;
}
#if ETL_USING_CPP11
@ -1298,7 +1300,7 @@ namespace etl
if (empty())
{
first = pbuckets;
last = pbuckets;
last = pbuckets;
}
else
{
@ -1328,10 +1330,6 @@ namespace etl
++pcurrent;
}
}
else
{
// Nothing to do.
}
}
}
@ -1423,7 +1421,6 @@ namespace etl
unordered_set()
: base(node_pool, buckets, MAX_BUCKETS)
{
base::initialise();
}
//*************************************************************************
@ -1523,7 +1520,7 @@ namespace etl
etl::pool<typename base::node_t, MAX_SIZE> node_pool;
/// The buckets of node lists.
etl::intrusive_forward_list<typename base::node_t> buckets[MAX_BUCKETS_];
typename base::bucket_t buckets[MAX_BUCKETS_];
};
//*************************************************************************

View File

@ -39,8 +39,8 @@ SOFTWARE.
///\ingroup utilities
#define ETL_VERSION_MAJOR 20
#define ETL_VERSION_MINOR 27
#define ETL_VERSION_PATCH 3
#define ETL_VERSION_MINOR 28
#define ETL_VERSION_PATCH 0
#define ETL_VERSION ETL_STRING(ETL_VERSION_MAJOR) "." ETL_STRING(ETL_VERSION_MINOR) "." ETL_STRING(ETL_VERSION_PATCH)
#define ETL_VERSION_W ETL_WIDE_STRING(ETL_VERSION_MAJOR) L"." ETL_WIDE_STRING(ETL_VERSION_MINOR) L"." ETL_WIDE_STRING(ETL_VERSION_PATCH)

View File

@ -1,6 +1,6 @@
{
"name": "Embedded Template Library",
"version": "20.27.3",
"version": "20.28.0",
"authors": {
"name": "John Wellbelove",
"email": "john.wellbelove@etlcpp.com"

View File

@ -1,5 +1,5 @@
name=Embedded Template Library
version=20.27.3
version=20.28.0
author= John Wellbelove <john.wellbelove@etlcpp.com>
maintainer=John Wellbelove <john.wellbelove@etlcpp.com>
license=MIT

View File

@ -1,3 +1,12 @@
===============================================================================
20.28.0
Fixed issues raised by sanitizer.
Added conditional compilation for 8 bit type in hash.h
Fixed warnings for 64bit compilation.
Fixed sanity check includes.
Fixed incorrect returned span length for byte stream read.
Updates to etl::successor and derived classes.
===============================================================================
20.27.3
#531 Fixed: Compilation of etl::reference_counted_message_pool with ETL_LOG_ERROR

View File

@ -42,8 +42,6 @@ set(TEST_SOURCE_FILES
test_array.cpp
test_array_view.cpp
test_array_wrapper.cpp
test_atomic_clang_sync.cpp
test_atomic_gcc_sync.cpp
test_atomic_std.cpp
test_binary.cpp
test_bip_buffer_spsc_atomic.cpp
@ -252,6 +250,7 @@ set(TEST_SOURCE_FILES
test_string_view.cpp
test_string_wchar_t.cpp
test_string_wchar_t_external_buffer.cpp
test_successor.cpp
test_task_scheduler.cpp
test_threshold.cpp
test_to_string.cpp
@ -322,11 +321,20 @@ else ()
endif ()
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
list(APPEND TEST_SOURCE_FILES "test_atomic_gcc_sync.cpp")
message(STATUS "Using GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address,undefined")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions")
message(STATUS "Including test_atomic_gcc_sync")
list(APPEND TEST_SOURCE_FILES "test_atomic_gcc_sync.cpp")
endif()
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address,undefined")
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
message(STATUS "Using Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address,undefined")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions")
message(STATUS "Including test_atomic_clang_sync")
list(APPEND TEST_SOURCE_FILES "test_atomic_clang_sync.cpp")
endif()
add_executable(etl_tests ${TEST_SOURCE_FILES})
add_library(unit_test ${UNITTEST_SOURCE_FILES})

View File

@ -188,16 +188,22 @@ public:
{
}
TestDataM(TestDataM&& other) noexcept
: value(other.value)
explicit TestDataM(T&& value_)
: value(std::move(value_))
, valid(true)
{
}
TestDataM(TestDataM&& other) noexcept
: value(std::move(other.value))
, valid(true)
{
other.value = std::move(T());
other.valid = false;
}
virtual ~TestDataM()
{
valid = false;
}
TestDataM& operator =(TestDataM&& other) noexcept
@ -205,7 +211,6 @@ public:
value = std::move(other.value);
valid = true;
other.value = T();
other.valid = false;
return *this;

View File

@ -6,6 +6,8 @@ cd build-make || exit 1
echo "ETL Tests" > log.txt
export ASAN_OPTIONS=alloc_dealloc_mismatch=0,detect_leaks=0
#******************************************************************************
# GCC
#******************************************************************************
@ -14,7 +16,7 @@ echo "-----------------------------------------------" | tee -a log.txt
echo " GCC - STL" | tee -a log.txt
echo "-----------------------------------------------" | tee -a log.txt
gcc --version | grep gcc | tee -a log.txt
CC=gcc CXX=g++ cmake --cmake-clean-cache -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USE_MEM_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
cmake --cmake-clean-cache -DCMAKE_CXX_COMPILER="g++" -DCMAKE_C_COMPILER="gcc" -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USE_MEM_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
make -j8
if [ $? -eq 0 ]; then
echo "<<<< Passed Compilation >>>>"
@ -34,7 +36,7 @@ echo "-----------------------------------------------" | tee -a log.txt
echo " GCC - STL - Force C++03" | tee -a log.txt
echo "-----------------------------------------------" | tee -a log.txt
gcc --version | grep gcc | tee -a log.txt
CC=gcc CXX=g++ cmake --cmake-clean-cache -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USE_MEM_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=ON ..
cmake --cmake-clean-cache -DCMAKE_CXX_COMPILER="g++" -DCMAKE_C_COMPILER="gcc" -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USE_MEM_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=ON ..
make -j8
if [ $? -eq 0 ]; then
echo "<<<< Passed Compilation >>>>"
@ -54,7 +56,7 @@ echo "-----------------------------------------------" | tee -a log.txt
echo " GCC - No STL" | tee -a log.txt
echo "-----------------------------------------------" | tee -a log.txt
gcc --version | grep gcc | tee -a log.txt
CC=gcc CXX=g++ cmake --cmake-clean-cache -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USE_MEM_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
cmake --cmake-clean-cache -DCMAKE_CXX_COMPILER="g++" -DCMAKE_C_COMPILER="gcc" -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USE_MEM_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
make -j8
if [ $? -eq 0 ]; then
echo "<<<< Passed Compilation >>>>"
@ -74,7 +76,7 @@ echo "-----------------------------------------------" | tee -a log.txt
echo " GCC - No STL - Force Builtins" | tee -a log.txt
echo "-----------------------------------------------" | tee -a log.txt
gcc --version | grep gcc | tee -a log.txt
CC=gcc CXX=g++ cmake --cmake-clean-cache -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=ON -DETL_USE_MEM_BUILTINS=ON -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
cmake --cmake-clean-cache -DCMAKE_CXX_COMPILER="g++" -DCMAKE_C_COMPILER="gcc" -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=ON -DETL_USE_MEM_BUILTINS=ON -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
make -j8
if [ $? -eq 0 ]; then
echo "<<<< Passed Compilation >>>>"
@ -98,7 +100,7 @@ echo "-----------------------------------------------" | tee -a log.txt
echo " Clang - STL" | tee -a log.txt
echo "-----------------------------------------------" | tee -a log.txt
clang --version | grep clang | tee -a log.txt
CC=clang CXX=clang++ cmake --cmake-clean-cache -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USE_MEM_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
cmake --cmake-clean-cache -DCMAKE_CXX_COMPILER="clang++" -DCMAKE_C_COMPILER="clang" -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USE_MEM_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
make -j8
if [ $? -eq 0 ]; then
echo "<<<< Passed Compilation >>>>"
@ -118,7 +120,7 @@ echo "-----------------------------------------------" | tee -a log.txt
echo " Clang - STL - Force C++03" | tee -a log.txt
echo "-----------------------------------------------" | tee -a log.txt
clang --version | grep clang | tee -a log.txt
CC=clang CXX=clang++ cmake --cmake-clean-cache -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USE_MEM_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=ON ..
cmake --cmake-clean-cache -DCMAKE_CXX_COMPILER="clang++" -DCMAKE_C_COMPILER="clang" -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USE_MEM_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=ON ..
make -j8
if [ $? -eq 0 ]; then
echo "<<<< Passed Compilation >>>>"
@ -138,7 +140,7 @@ echo "-----------------------------------------------" | tee -a log.txt
echo " Clang - No STL" | tee -a log.txt
echo "-----------------------------------------------" | tee -a log.txt
clang --version | grep clang | tee -a log.txt
CC=clang CXX=clang++ cmake --cmake-clean-cache -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USE_MEM_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
cmake --cmake-clean-cache -DCMAKE_CXX_COMPILER="clang++" -DCMAKE_C_COMPILER="clang" -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USE_MEM_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
make -j8
if [ $? -eq 0 ]; then
echo "<<<< Passed Compilation >>>>"
@ -158,7 +160,7 @@ echo "-----------------------------------------------" | tee -a log.txt
echo " Clang - No STL - Builtins" | tee -a log.txt
echo "-----------------------------------------------" | tee -a log.txt
clang --version | grep clang | tee -a log.txt
CC=clang CXX=clang++ cmake --cmake-clean-cache -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=ON -DETL_USE_MEM_BUILTINS=ON -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
cmake --cmake-clean-cache -DCMAKE_CXX_COMPILER="clang++" -DCMAKE_C_COMPILER="clang" -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=ON -DETL_USE_MEM_BUILTINS=ON -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
make -j8
if [ $? -eq 0 ]; then
echo "<<<< Passed Compilation >>>>"
@ -182,7 +184,7 @@ cd ../etl_initializer_list/
mkdir -p build-make || exit 1
cd build-make || exit 1
gcc --version | grep gcc | tee -a log.txt
CC=gcc CXX=g++ cmake --cmake-clean-cache ..
cmake --cmake-clean-cache -DCMAKE_CXX_COMPILER="g++" -DCMAKE_C_COMPILER="gcc" ..
make -j8
if [ $? -eq 0 ]; then
echo "<<<< Passed initializer_list Compilation >>>>"
@ -203,7 +205,7 @@ echo "-----------------------------------------------" | tee -a log.txt
echo " Clang - Initializer list test" | tee -a log.txt
echo "-----------------------------------------------" | tee -a log.txt
clang --version | grep clang | tee -a log.txt
CC=clang CXX=clang++ cmake --cmake-clean-cache ..
cmake --cmake-clean-cache -DCMAKE_CXX_COMPILER="clang++" -DCMAKE_C_COMPILER="clang" ..
make -j8
if [ $? -eq 0 ]; then
echo "<<<< Passed initializer_list Compilation >>>>"

View File

@ -26,4 +26,4 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
******************************************************************************/
#include <etl/delegate_cpp03.h>
#include <etl/private/delegate_cpp03.h>

View File

@ -26,4 +26,4 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
******************************************************************************/
#include <etl/private/variant_old.h>
#include <etl/private/variant_legacy.h>

View File

@ -261,7 +261,7 @@ namespace
TEST(test_rend)
{
Data5 aw5;
CHECK_EQUAL(data5 + Data5::REND, std::addressof(*aw5.rend()));
CHECK_EQUAL(Data5::SIZE, std::distance(aw5.rbegin(), aw5.rend()));
}
//*************************************************************************
@ -275,12 +275,12 @@ namespace
TEST(test_crend)
{
const Data5 caw5a;
CHECK_EQUAL(caw5a.data() + Data5::REND, std::addressof(*caw5a.rend()));
CHECK_EQUAL(caw5a.data() + Data5::REND, std::addressof(*caw5a.crend()));
CHECK_EQUAL(Data5::SIZE, std::distance(caw5a.rbegin(), caw5a.rend()));
CHECK_EQUAL(Data5::SIZE, std::distance(caw5a.rbegin(), caw5a.rend()));
CData5 caw5b;
CHECK_EQUAL(caw5b.data() + CData5::REND, std::addressof(*caw5b.rend()));
CHECK_EQUAL(caw5b.data() + CData5::REND, std::addressof(*caw5b.crend()));
CHECK_EQUAL(Data5::SIZE, std::distance(caw5b.rbegin(), caw5b.rend()));
CHECK_EQUAL(Data5::SIZE, std::distance(caw5b.rbegin(), caw5b.rend()));
}
//*************************************************************************
@ -329,7 +329,7 @@ namespace
Data5::reverse_iterator itr = aw5.rbegin();
int* p = data5 + Data5::RBEGIN;
while (p != data5 + Data5::REND)
while (itr != aw5.rend())
{
CHECK_EQUAL(*p, *itr);
--p;
@ -350,7 +350,7 @@ namespace
Data5::const_reverse_iterator itr = aw5.crbegin();
int* p = data5 + Data5::RBEGIN;
while (p != data5 + Data5::REND)
while (itr != aw5.crend())
{
CHECK_EQUAL(*p, *itr);
--p;

View File

@ -920,6 +920,7 @@ namespace
etl::optional<etl::span<const int32_t> > result = reader.read<int32_t>(output);
CHECK(result.has_value());
CHECK_EQUAL(sizeof(const int32_t), result.value().size());
CHECK_EQUAL(put_data[0], get_data[0]);
CHECK_EQUAL(put_data[1], get_data[1]);
CHECK_EQUAL(put_data[2], get_data[2]);
@ -944,6 +945,7 @@ namespace
etl::optional<etl::span<const int32_t> > result = reader.read<int32_t>(get_data.data(), get_data.size());
CHECK(result.has_value());
CHECK_EQUAL(sizeof(const int32_t), result.value().size());
CHECK_EQUAL(put_data[0], get_data[0]);
CHECK_EQUAL(put_data[1], get_data[1]);
CHECK_EQUAL(put_data[2], get_data[2]);

View File

@ -137,8 +137,7 @@ namespace
Allocator16 allocator16;
Allocator32 allocator32;
allocator8.set_successor(allocator16);
allocator16.set_successor(allocator32);
allocator8.set_successor(allocator16, allocator32);
int8_t* p1 = static_cast<int8_t*>(allocator8.allocate(sizeof(int8_t), alignof(uint8_t))); // Take from allocator8
int16_t* p2 = static_cast<int16_t*>(allocator8.allocate(sizeof(int16_t), alignof(uint16_t))); // Take from allocator16
@ -146,10 +145,10 @@ namespace
int64_t* p4 = static_cast<int64_t*>(allocator8.allocate(sizeof(int64_t), alignof(uint64_t))); // Unable to allocate
int8_t* p5 = static_cast<int8_t*>(allocator8.allocate(sizeof(int8_t), alignof(uint8_t))); // Take from allocator8
int8_t* p6 = static_cast<int8_t*>(allocator8.allocate(sizeof(int8_t), alignof(uint8_t))); // Take from allocator8
int8_t* p7 = static_cast<int8_t*>(allocator8.allocate(sizeof(int8_t), alignof(uint8_t))); // Take from allocator8. allocator8 is full.
int8_t* p7 = static_cast<int8_t*>(allocator8.allocate(sizeof(int8_t), alignof(uint8_t))); // Take from allocator8. allocator8 is now full.
int8_t* p8 = static_cast<int8_t*>(allocator8.allocate(sizeof(int8_t), alignof(uint8_t))); // Take from allocator16
int8_t* p9 = static_cast<int8_t*>(allocator8.allocate(sizeof(int8_t), alignof(uint8_t))); // Take from allocator16
int8_t* p10 = static_cast<int8_t*>(allocator8.allocate(sizeof(int8_t), alignof(uint8_t))); // Take from allocator16. allocator16 is full.
int8_t* p10 = static_cast<int8_t*>(allocator8.allocate(sizeof(int8_t), alignof(uint8_t))); // Take from allocator16. allocator16 now is full.
int8_t* p11 = static_cast<int8_t*>(allocator8.allocate(sizeof(int8_t), alignof(uint8_t))); // Take from allocator32
CHECK(p1 != nullptr);
@ -164,48 +163,59 @@ namespace
CHECK(p10 != nullptr);
CHECK(p11 != nullptr);
// Take from allocator8
CHECK(allocator8.is_owner_of(p1));
CHECK(!allocator16.is_owner_of(p1));
CHECK(!allocator32.is_owner_of(p1));
CHECK(!allocator8.is_owner_of(p2));
// Take from allocator16
CHECK(allocator8.is_owner_of(p2));
CHECK(allocator16.is_owner_of(p2));
CHECK(!allocator32.is_owner_of(p2));
CHECK(!allocator8.is_owner_of(p3));
CHECK(!allocator16.is_owner_of(p3));
// Take from allocator32
CHECK(allocator8.is_owner_of(p3));
CHECK(allocator16.is_owner_of(p3));
CHECK(allocator32.is_owner_of(p3));
// Unable to allocate
CHECK(!allocator8.is_owner_of(p4));
CHECK(!allocator16.is_owner_of(p4));
CHECK(!allocator32.is_owner_of(p4));
// Take from allocator8
CHECK(allocator8.is_owner_of(p5));
CHECK(!allocator16.is_owner_of(p5));
CHECK(!allocator32.is_owner_of(p5));
// Take from allocator8
CHECK(allocator8.is_owner_of(p6));
CHECK(!allocator16.is_owner_of(p6));
CHECK(!allocator32.is_owner_of(p6));
// Take from allocator8.
CHECK(allocator8.is_owner_of(p7));
CHECK(!allocator16.is_owner_of(p7));
CHECK(!allocator32.is_owner_of(p7));
CHECK(!allocator8.is_owner_of(p8));
// Take from allocator16
CHECK(allocator8.is_owner_of(p8));
CHECK(allocator16.is_owner_of(p8));
CHECK(!allocator32.is_owner_of(p8));
CHECK(!allocator8.is_owner_of(p9));
// Take from allocator16
CHECK(allocator8.is_owner_of(p9));
CHECK(allocator16.is_owner_of(p9));
CHECK(!allocator32.is_owner_of(p9));
CHECK(!allocator8.is_owner_of(p10));
// Take from allocator16.
CHECK(allocator8.is_owner_of(p10));
CHECK(allocator16.is_owner_of(p10));
CHECK(!allocator32.is_owner_of(p10));
CHECK(!allocator8.is_owner_of(p11));
CHECK(!allocator16.is_owner_of(p11));
// Take from allocator32
CHECK(allocator8.is_owner_of(p11));
CHECK(allocator16.is_owner_of(p11));
CHECK(allocator32.is_owner_of(p11));
CHECK(allocator8.release(p1));

View File

@ -338,7 +338,7 @@ namespace
#if ETL_USING_CPP17 && ETL_HAS_INITIALIZER_LIST && !defined(ETL_TEMPLATE_DEDUCTION_GUIDE_TESTS_DISABLED)
//*************************************************************************
TEST(test_cpp17_deduced_constructor)
TEST_FIXTURE(SetupFixture, test_cpp17_deduced_constructor)
{
etl::flat_map data{ ElementNDC(0, N0), ElementNDC(1, N1), ElementNDC(2, N2), ElementNDC(3, N3), ElementNDC(4, N4),
ElementNDC(5, N5), ElementNDC(6, N6), ElementNDC(7, N7), ElementNDC(8, N8), ElementNDC(9, N9) };
@ -357,7 +357,7 @@ namespace
#endif
//*************************************************************************
TEST(test_destruct_via_iflat_map)
TEST_FIXTURE(SetupFixture, test_destruct_via_iflat_map)
{
int current_count = NDC::get_instance_count();
@ -399,7 +399,7 @@ namespace
#endif
//*************************************************************************
TEST(test_move_constructor)
TEST_FIXTURE(SetupFixture, test_move_constructor)
{
using Item = ETL_OR_STD::pair<int, MC>;
@ -1494,7 +1494,7 @@ namespace
//*************************************************************************
#if ETL_USING_CPP17 && ETL_HAS_INITIALIZER_LIST && !defined(ETL_TEMPLATE_DEDUCTION_GUIDE_TESTS_DISABLED)
TEST(test_flat_map_template_deduction)
TEST_FIXTURE(SetupFixture, test_flat_map_template_deduction)
{
using Pair = ETL_OR_STD::pair<const int, NDC>;
@ -1515,7 +1515,7 @@ namespace
//*************************************************************************
#if ETL_HAS_INITIALIZER_LIST
TEST(test_make_flat_map)
TEST_FIXTURE(SetupFixture, test_make_flat_map)
{
using Pair = ETL_OR_STD::pair<const int, NDC>;

View File

@ -299,7 +299,7 @@ namespace
#if ETL_USING_CPP17 && ETL_HAS_INITIALIZER_LIST && !defined(ETL_TEMPLATE_DEDUCTION_GUIDE_TESTS_DISABLED)
//*************************************************************************
TEST(test_cpp17_deduced_constructor)
TEST_FIXTURE(SetupFixture, test_cpp17_deduced_constructor)
{
etl::flat_multimap data{ ElementNDC(0, N0), ElementNDC(1, N1), ElementNDC(2, N2), ElementNDC(3, N3), ElementNDC(4, N4),
ElementNDC(5, N5), ElementNDC(6, N6), ElementNDC(7, N7), ElementNDC(8, N8), ElementNDC(9, N9) };
@ -318,7 +318,7 @@ namespace
#endif
//*************************************************************************
TEST(test_destruct_via_iflat_multimap)
TEST_FIXTURE(SetupFixture, test_destruct_via_iflat_multimap)
{
int current_count = NDC::get_instance_count();
@ -366,7 +366,7 @@ namespace
#endif
//*************************************************************************
TEST(test_move_constructor)
TEST_FIXTURE(SetupFixture, test_move_constructor)
{
using Item = ETL_OR_STD::pair<int, MC>;
@ -1287,7 +1287,7 @@ namespace
//*************************************************************************
#if ETL_USING_CPP17 && ETL_HAS_INITIALIZER_LIST && !defined(ETL_TEMPLATE_DEDUCTION_GUIDE_TESTS_DISABLED)
TEST(test_flat_multimap_template_deduction)
TEST_FIXTURE(SetupFixture, test_flat_multimap_template_deduction)
{
using Pair = ETL_OR_STD::pair<const int, NDC>;
@ -1316,7 +1316,7 @@ namespace
//*************************************************************************
#if ETL_HAS_INITIALIZER_LIST
TEST(test_make_flat_multimap)
TEST_FIXTURE(SetupFixture, test_make_flat_multimap)
{
using Pair = ETL_OR_STD::pair<const int, NDC>;

View File

@ -267,7 +267,7 @@ namespace
#if ETL_USING_CPP17 && ETL_HAS_INITIALIZER_LIST && !defined(ETL_TEMPLATE_DEDUCTION_GUIDE_TESTS_DISABLED)
//*************************************************************************
TEST(test_cpp17_deduced_constructor)
TEST_FIXTURE(SetupFixture, test_cpp17_deduced_constructor)
{
etl::flat_multiset data{ N0, N1, N2, N3, N4, N5, N6, N7, N8, N9 };
etl::flat_multiset<NDC, 10U> check = { N0, N1, N2, N3, N4, N5, N6, N7, N8, N9 };
@ -284,7 +284,7 @@ namespace
#endif
//*************************************************************************
TEST(test_destruct_via_iflat_multiset)
TEST_FIXTURE(SetupFixture, test_destruct_via_iflat_multiset)
{
int current_count = NDC::get_instance_count();
@ -326,7 +326,7 @@ namespace
#endif
//*************************************************************************
TEST(test_move_constructor)
TEST_FIXTURE(SetupFixture, test_move_constructor)
{
using Item = MC;
@ -1237,7 +1237,7 @@ namespace
//*************************************************************************
#if ETL_USING_CPP17 && ETL_HAS_INITIALIZER_LIST && !defined(ETL_TEMPLATE_DEDUCTION_GUIDE_TESTS_DISABLED)
TEST(test_flat_set_template_deduction)
TEST_FIXTURE(SetupFixture, test_flat_set_template_deduction)
{
using Pair = ETL_OR_STD::pair<const int, NDC>;
@ -1267,7 +1267,7 @@ namespace
//*************************************************************************
#if ETL_HAS_INITIALIZER_LIST
TEST(test_make_flat_multiset)
TEST_FIXTURE(SetupFixture, test_make_flat_multiset)
{
auto data = etl::make_flat_multiset<NDC>(NDC("A"), NDC("B"), NDC("B2"), NDC("C"), NDC("D"), NDC("E"), NDC("F"));

View File

@ -280,7 +280,7 @@ namespace
#if ETL_USING_CPP17 && ETL_HAS_INITIALIZER_LIST && !defined(ETL_TEMPLATE_DEDUCTION_GUIDE_TESTS_DISABLED)
//*************************************************************************
TEST(test_cpp17_deduced_constructor)
TEST_FIXTURE(SetupFixture, test_cpp17_deduced_constructor)
{
etl::flat_set data{ N0, N1, N2, N3, N4, N5, N6, N7, N8, N9 };
etl::flat_set<NDC, 10U> check = { N0, N1, N2, N3, N4, N5, N6, N7, N8, N9 };
@ -297,7 +297,7 @@ namespace
#endif
//*************************************************************************
TEST(test_destruct_via_iflat_set)
TEST_FIXTURE(SetupFixture, test_destruct_via_iflat_set)
{
int current_count = NDC::get_instance_count();
@ -339,7 +339,7 @@ namespace
#endif
//*************************************************************************
TEST(test_move_constructor)
TEST_FIXTURE(SetupFixture, test_move_constructor)
{
using Item = MC;
@ -1162,7 +1162,7 @@ namespace
//*************************************************************************
#if ETL_USING_CPP17 && ETL_HAS_INITIALIZER_LIST && !defined(ETL_TEMPLATE_DEDUCTION_GUIDE_TESTS_DISABLED)
TEST(test_flat_set_template_deduction)
TEST_FIXTURE(SetupFixture, test_flat_set_template_deduction)
{
using Pair = ETL_OR_STD::pair<const int, NDC>;
@ -1190,7 +1190,7 @@ namespace
//*************************************************************************
#if ETL_HAS_INITIALIZER_LIST
TEST(test_make_flat_set)
TEST_FIXTURE(SetupFixture, test_make_flat_set)
{
auto data = etl::make_flat_set<NDC>(NDC("A"), NDC("B"), NDC("C"), NDC("D"), NDC("E"), NDC("F"));

View File

@ -409,17 +409,21 @@ namespace
const DataDC constData(10);
CHECK_EQUAL(&data[0], &(*data.begin()));
CHECK_EQUAL(&data[0], &(*data.cbegin()));
CHECK_EQUAL(&constData[0], &(*constData.begin()));
CHECK_EQUAL(&constData[0], &(*constData.cbegin()));
}
//*************************************************************************
TEST_FIXTURE(SetupFixture, test_end)
{
DataDC data(10);
const DataDC constData(10);
DataDC data(10U);
const DataDC constData(10U);
CHECK_EQUAL(&data[10], &(*data.end()));
CHECK_EQUAL(&constData[10], &(constData.end()));
CHECK(std::distance(data.begin(), data.end()) == 10U);
CHECK(std::distance(data.cbegin(), data.cend()) == 10U);
CHECK(std::distance(constData.begin(), constData.end()) == 10U);
CHECK(std::distance(constData.cbegin(), constData.cend()) == 10U);
}
//*************************************************************************

View File

@ -485,7 +485,9 @@ namespace
const DataDC constData(10, lookup2, pool2);
CHECK_EQUAL(&data[0], &(*data.begin()));
CHECK_EQUAL(&data[0], &(*data.cbegin()));
CHECK_EQUAL(&constData[0], &(*constData.begin()));
CHECK_EQUAL(&constData[0], &(*constData.cbegin()));
}
//*************************************************************************
@ -500,8 +502,10 @@ namespace
DataDC data(10, lookup1, pool1);
const DataDC constData(10, lookup2, pool2);
CHECK_EQUAL(&data[10], &(*data.end()));
CHECK_EQUAL(&constData[10], &(constData.end()));
CHECK(std::distance(data.begin(), data.end()) == 10U);
CHECK(std::distance(data.cbegin(), data.cend()) == 10U);
CHECK(std::distance(constData.begin(), constData.end()) == 10U);
CHECK(std::distance(constData.cbegin(), constData.cend()) == 10U);
}
//*************************************************************************

View File

@ -153,7 +153,7 @@ namespace
j32.value();
CHECK_THROW(j32.add(0), etl::hash_finalised);
CHECK_THROW(j32.add(0), etl::hash_finalized);
}
};
}

View File

@ -215,7 +215,7 @@ namespace
#if ETL_USING_CPP17 && ETL_HAS_INITIALIZER_LIST && !defined(ETL_TEMPLATE_DEDUCTION_GUIDE_TESTS_DISABLED)
//*************************************************************************
TEST(test_cpp17_deduced_constructor)
TEST_FIXTURE(SetupFixture, test_cpp17_deduced_constructor)
{
etl::map data{ std::pair<std::string, int>("0", 0), std::pair<std::string, int>("1", 1), std::pair<std::string, int>("2", 2), std::pair<std::string, int>("3", 3), std::pair<std::string, int>("4", 4),
std::pair<std::string, int>("5", 5), std::pair<std::string, int>("6", 6), std::pair<std::string, int>("7", 7), std::pair<std::string, int>("8", 8), std::pair<std::string, int>("9", 9) };
@ -1568,7 +1568,7 @@ namespace
//*************************************************************************
#if ETL_USING_CPP17 && ETL_HAS_INITIALIZER_LIST && !defined(ETL_TEMPLATE_DEDUCTION_GUIDE_TESTS_DISABLED)
TEST(test_map_template_deduction)
TEST_FIXTURE(SetupFixture, test_map_template_deduction)
{
using Pair = std::pair<const std::string, int>;
@ -1589,7 +1589,7 @@ namespace
//*************************************************************************
#if ETL_HAS_INITIALIZER_LIST
TEST(test_make_map)
TEST_FIXTURE(SetupFixture, test_make_map)
{
using Pair = ETL_OR_STD::pair<const std::string, int>;

View File

@ -69,7 +69,7 @@ namespace
char* Ptr(int i)
{
return reinterpret_cast<char*>(i);
return reinterpret_cast<char*>(uintptr_t(i));
}
std::aligned_storage_t<Size, Alignment> buffer;

View File

@ -217,7 +217,7 @@ namespace
#if ETL_USING_CPP17 && ETL_HAS_INITIALIZER_LIST && !defined(ETL_TEMPLATE_DEDUCTION_GUIDE_TESTS_DISABLED)
//*************************************************************************
TEST(test_cpp17_deduced_constructor)
TEST_FIXTURE(SetupFixture, test_cpp17_deduced_constructor)
{
etl::multimap data{ std::pair<std::string, int>("0", 0), std::pair<std::string, int>("1", 1), std::pair<std::string, int>("2", 2), std::pair<std::string, int>("3", 3), std::pair<std::string, int>("4", 4),
std::pair<std::string, int>("5", 5), std::pair<std::string, int>("6", 6), std::pair<std::string, int>("7", 7), std::pair<std::string, int>("8", 8), std::pair<std::string, int>("9", 9) };
@ -1582,7 +1582,7 @@ namespace
//*************************************************************************
#if ETL_USING_CPP17 && ETL_HAS_INITIALIZER_LIST && !defined(ETL_TEMPLATE_DEDUCTION_GUIDE_TESTS_DISABLED)
TEST(test_multimap_template_deduction)
TEST_FIXTURE(SetupFixture, test_multimap_template_deduction)
{
using Pair = std::pair<const std::string, int>;
@ -1610,7 +1610,7 @@ namespace
//*************************************************************************
#if ETL_HAS_INITIALIZER_LIST
TEST(test_make_multimap)
TEST_FIXTURE(SetupFixture, test_make_multimap)
{
using Pair = ETL_OR_STD::pair<const std::string, int>;

View File

@ -232,7 +232,7 @@ namespace
#if ETL_USING_CPP17 && ETL_HAS_INITIALIZER_LIST && !defined(ETL_TEMPLATE_DEDUCTION_GUIDE_TESTS_DISABLED)
//*************************************************************************
TEST(test_cpp17_deduced_constructor)
TEST_FIXTURE(SetupFixture, test_cpp17_deduced_constructor)
{
etl::multiset data{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
etl::multiset<int, 10U> check = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
@ -288,11 +288,6 @@ namespace
DataM data2(std::move(data1));
CHECK(!data1.empty()); // Move does not clear the source.
CHECK_EQUAL(1, ItemM(1).value);
CHECK_EQUAL(2, ItemM(2).value);
CHECK_EQUAL(3, ItemM(3).value);
CHECK_EQUAL(4, ItemM(4).value);
}
//*************************************************************************
@ -398,11 +393,6 @@ namespace
data2 = std::move(data1);
CHECK(!data1.empty()); // Move does not clear the source.
CHECK_EQUAL(1, ItemM(1).value);
CHECK_EQUAL(2, ItemM(2).value);
CHECK_EQUAL(3, ItemM(3).value);
CHECK_EQUAL(4, ItemM(4).value);
}
//*************************************************************************
@ -1584,7 +1574,7 @@ namespace
//*************************************************************************
#if ETL_USING_CPP17 && ETL_HAS_INITIALIZER_LIST && !defined(ETL_TEMPLATE_DEDUCTION_GUIDE_TESTS_DISABLED)
TEST(test_multiset_template_deduction)
TEST_FIXTURE(SetupFixture, test_multiset_template_deduction)
{
etl::multiset data{ std::string("A"), std::string("B"), std::string("C"), std::string("D"), std::string("E"), std::string("F") };
@ -1610,7 +1600,7 @@ namespace
//*************************************************************************
#if ETL_HAS_INITIALIZER_LIST
TEST(test_make_multiset)
TEST_FIXTURE(SetupFixture, test_make_multiset)
{
auto data = etl::make_multiset< std::string>(std::string("A"), std::string("B"), std::string("C"), std::string("D"), std::string("E"), std::string("F"));
@ -1635,7 +1625,7 @@ namespace
#endif
//*************************************************************************
TEST(test_contains)
TEST_FIXTURE(SetupFixture, test_contains)
{
std::array<int, 6U> initial = { 1, 2, 3, 4, 5, 6 };
etl::multiset<int, 6U, etl::less<>> data(initial.begin(), initial.end());
@ -1645,7 +1635,7 @@ namespace
}
//*************************************************************************
TEST(test_contains_using_transparent_comparator)
TEST_FIXTURE(SetupFixture, test_contains_using_transparent_comparator)
{
std::array<int, 6U> initial = { 1, 2, 3, 4, 5, 6 };
etl::multiset<int, 6U, etl::less<>> data(initial.begin(), initial.end());

View File

@ -189,7 +189,7 @@ namespace
#if ETL_USING_CPP17 && ETL_HAS_INITIALIZER_LIST && !defined(ETL_TEMPLATE_DEDUCTION_GUIDE_TESTS_DISABLED)
//*************************************************************************
TEST(test_cpp17_deduced_constructor)
TEST_FIXTURE(SetupFixture, test_cpp17_deduced_constructor)
{
etl::set data{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
etl::set<int, 10U> check = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
@ -246,11 +246,6 @@ namespace
CHECK(!data1.empty()); // Move does not clear the source.
CHECK_EQUAL(1, ItemM(1).value);
CHECK_EQUAL(2, ItemM(2).value);
CHECK_EQUAL(3, ItemM(3).value);
CHECK_EQUAL(4, ItemM(4).value);
CHECK(data2.find(ItemM(1)) != data2.end());
CHECK(data2.find(ItemM(2)) != data2.end());
CHECK(data2.find(ItemM(3)) != data2.end());
@ -363,11 +358,6 @@ namespace
data2 = std::move(data1);
CHECK(!data1.empty()); // Move does not clear the source.
CHECK_EQUAL(1, ItemM(1).value);
CHECK_EQUAL(2, ItemM(2).value);
CHECK_EQUAL(3, ItemM(3).value);
CHECK_EQUAL(4, ItemM(4).value);
}
//*************************************************************************
@ -1393,7 +1383,7 @@ namespace
//*************************************************************************
#if ETL_USING_CPP17 && ETL_HAS_INITIALIZER_LIST && !defined(ETL_TEMPLATE_DEDUCTION_GUIDE_TESTS_DISABLED)
TEST(test_set_template_deduction)
TEST_FIXTURE(SetupFixture, test_set_template_deduction)
{
etl::set data{ std::string("A"), std::string("B"), std::string("C"), std::string("D"), std::string("E"), std::string("F") };
@ -1419,7 +1409,7 @@ namespace
//*************************************************************************
#if ETL_HAS_INITIALIZER_LIST
TEST(test_make_set)
TEST_FIXTURE(SetupFixture, test_make_set)
{
auto data = etl::make_set< std::string>(std::string("A"), std::string("B"), std::string("C"), std::string("D"), std::string("E"), std::string("F"));
@ -1444,7 +1434,7 @@ namespace
#endif
//*************************************************************************
TEST(test_contains)
TEST_FIXTURE(SetupFixture, test_contains)
{
std::array<int, 6U> initial = { 1, 2, 3, 4, 5, 6 };
etl::set<int, 6U, etl::less<>> data(initial.begin(), initial.end());
@ -1454,7 +1444,7 @@ namespace
}
//*************************************************************************
TEST(test_contains_using_transparent_comparator)
TEST_FIXTURE(SetupFixture, test_contains_using_transparent_comparator)
{
std::array<int, 6U> initial = { 1, 2, 3, 4, 5, 6 };
etl::set<int, 6U, etl::less<>> data(initial.begin(), initial.end());

376
test/test_successor.cpp Normal file
View File

@ -0,0 +1,376 @@
/******************************************************************************
The MIT License(MIT)
Embedded Template Library.
https://github.com/ETLCPP/etl
https://www.etlcpp.com
Copyright(c) 2022 jwellbelove
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files(the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions :
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
******************************************************************************/
#include "unit_test_framework.h"
#include "etl/successor.h"
namespace
{
//*******************************************************
struct SuccessorBase : etl::successor<SuccessorBase>
{
SuccessorBase()
{
}
SuccessorBase(SuccessorBase& successors...)
: successor(successors)
{
}
virtual void Test(int) = 0;
};
//*******************************************************
struct SuccessorSameBase1 : SuccessorBase
{
SuccessorSameBase1()
: value(0)
{
}
SuccessorSameBase1(SuccessorBase& successors...)
: SuccessorBase(successors)
, value(0)
{
}
void Test(int i) override
{
if (i > 1)
{
get_successor().Test(i);
}
else
{
value = i;
}
}
int value;
};
//*******************************************************
struct SuccessorSameBase2 : SuccessorBase
{
SuccessorSameBase2()
: value(0)
{
}
void Test(int i) override
{
if (i > 2)
{
get_successor().Test(i);
}
else
{
value = i;
}
}
int value;
};
//*******************************************************
struct SuccessorSameBase3 : SuccessorBase
{
SuccessorSameBase3()
: value(0)
{
}
void Test(int i) override
{
if (i > 3)
{
get_successor().Test(i);
}
else
{
value = i;
}
}
int value;
};
//*******************************************************
struct SuccessorSameBase4 : SuccessorBase
{
SuccessorSameBase4()
: value(0)
{
}
void Test(int i) override
{
if (i > 4)
{
get_successor().Test(i);
}
else
{
value = i;
}
}
int value;
};
//*******************************************************
struct SuccessorSameBase5 : SuccessorBase
{
SuccessorSameBase5()
: value(0)
{
}
void Test(int i) override
{
value = i;
}
int value;
};
//*******************************************************
struct SuccessorNoBase3
{
SuccessorNoBase3()
: value(0)
{
}
void Test(int i)
{
value = i;
}
int value;
};
//*******************************************************
struct SuccessorNoBase2 : etl::successor<SuccessorNoBase3>
{
SuccessorNoBase2()
: value(0)
{
}
void Test(int i)
{
if (i > 2)
{
get_successor().Test(i);
}
else
{
value = i;
}
}
int value;
};
//*******************************************************
struct SuccessorNoBase1 : etl::successor<SuccessorNoBase2>
{
SuccessorNoBase1()
: value(0)
{
}
void Test(int i)
{
if (i > 1)
{
get_successor().Test(i);
}
else
{
value = i;
}
}
int value;
};
SUITE(test_successor)
{
//*************************************************************************
TEST(test_successors_same_check_append_multiple_to_first)
{
SuccessorSameBase1 successor1;
SuccessorSameBase2 successor2;
SuccessorSameBase3 successor3;
SuccessorSameBase4 successor4;
SuccessorSameBase5 successor5;
successor1.append_successor(successor2, successor3, successor4, successor5);
CHECK(successor1.has_successor());
CHECK(successor2.has_successor());
CHECK(successor3.has_successor());
CHECK(successor4.has_successor());
CHECK(!successor5.has_successor());
CHECK(&successor1.get_successor() == &successor2);
CHECK(&successor2.get_successor() == &successor3);
CHECK(&successor3.get_successor() == &successor4);
CHECK_THROW(successor5.get_successor(), etl::successor_invalid);
}
//*************************************************************************
TEST(test_successors_same_check_append_multiple)
{
SuccessorSameBase1 successor1;
SuccessorSameBase2 successor2;
SuccessorSameBase3 successor3;
SuccessorSameBase4 successor4;
SuccessorSameBase5 successor5;
successor1.set_successor(successor2, successor3);
successor1.append_successor(successor4, successor5);
CHECK(successor1.has_successor());
CHECK(successor2.has_successor());
CHECK(successor3.has_successor());
CHECK(successor4.has_successor());
CHECK(!successor5.has_successor());
CHECK(&successor1.get_successor() == &successor2);
CHECK(&successor2.get_successor() == &successor3);
CHECK(&successor3.get_successor() == &successor4);
CHECK_THROW(successor5.get_successor(), etl::successor_invalid);
}
//*************************************************************************
TEST(test_successors_same_check_append_chain)
{
SuccessorSameBase1 successor1;
SuccessorSameBase2 successor2;
SuccessorSameBase3 successor3;
SuccessorSameBase4 successor4;
SuccessorSameBase5 successor5;
successor1.set_successor(successor2, successor3);
successor4.set_successor(successor5);
successor1.append_successor(successor4);
CHECK(successor1.has_successor());
CHECK(successor2.has_successor());
CHECK(successor3.has_successor());
CHECK(successor4.has_successor());
CHECK(!successor5.has_successor());
CHECK(&successor1.get_successor() == &successor2);
CHECK(&successor2.get_successor() == &successor3);
CHECK(&successor3.get_successor() == &successor4);
CHECK_THROW(successor5.get_successor(), etl::successor_invalid);
}
//*************************************************************************
TEST(test_successors_same_check)
{
SuccessorSameBase1 successor1;
SuccessorSameBase2 successor2;
SuccessorSameBase3 successor3;
successor1.set_successor(successor2, successor3);
CHECK(successor1.has_successor());
CHECK(successor2.has_successor());
CHECK(!successor3.has_successor());
CHECK(&successor1.get_successor() == &successor2);
CHECK(&successor2.get_successor() == &successor3);
CHECK_THROW(successor3.get_successor(), etl::successor_invalid);
}
//*************************************************************************
TEST(test_successors_same_check_calls)
{
SuccessorSameBase1 successor1;
SuccessorSameBase2 successor2;
SuccessorSameBase3 successor3;
successor1.set_successor(successor2, successor3);
successor1.Test(1);
successor1.Test(2);
successor1.Test(3);
CHECK_EQUAL(1, successor1.value);
CHECK_EQUAL(2, successor2.value);
CHECK_EQUAL(3, successor3.value);
}
//*************************************************************************
TEST(test_successors_different_setup)
{
SuccessorNoBase1 successor1;
SuccessorNoBase2 successor2;
SuccessorNoBase3 successor3;
successor1.set_successor(successor2, successor3);
CHECK(successor1.has_successor());
CHECK(successor2.has_successor());
// successor3 does not support a successor.
CHECK(&successor1.get_successor() == &successor2);
CHECK(&successor2.get_successor() == &successor3);
}
//*************************************************************************
TEST(test_successors_different_check_calls)
{
SuccessorNoBase1 successor1;
SuccessorNoBase2 successor2;
SuccessorNoBase3 successor3;
successor1.set_successor(successor2, successor3);
successor1.Test(1);
successor1.Test(2);
successor1.Test(3);
CHECK_EQUAL(1, successor1.value);
CHECK_EQUAL(2, successor2.value);
CHECK_EQUAL(3, successor3.value);
}
}
}

View File

@ -246,7 +246,7 @@ namespace
#if ETL_USING_CPP17 && ETL_HAS_INITIALIZER_LIST && !defined(ETL_TEMPLATE_DEDUCTION_GUIDE_TESTS_DISABLED)
//*************************************************************************
TEST(test_cpp17_deduced_constructor)
TEST_FIXTURE(SetupFixture, test_cpp17_deduced_constructor)
{
etl::unordered_map data{ ElementNDC(K0, N0), ElementNDC(K1, N1), ElementNDC(K2, N2), ElementNDC(K3, N3), ElementNDC(K4, N4),
ElementNDC(K5, N5), ElementNDC(K6, N6), ElementNDC(K7, N7), ElementNDC(K8, N8), ElementNDC(K9, N9) };
@ -299,7 +299,7 @@ namespace
}
//*************************************************************************
TEST(test_destruct_via_iunordered_map)
TEST_FIXTURE(SetupFixture, test_destruct_via_iunordered_map)
{
int current_count = NDC::get_instance_count();

View File

@ -223,7 +223,7 @@ namespace
#if ETL_USING_CPP17 && ETL_HAS_INITIALIZER_LIST && !defined(ETL_TEMPLATE_DEDUCTION_GUIDE_TESTS_DISABLED)
//*************************************************************************
TEST(test_cpp17_deduced_constructor)
TEST_FIXTURE(SetupFixture, test_cpp17_deduced_constructor)
{
etl::unordered_multimap data{ ElementNDC(K0, N0), ElementNDC(K1, N1), ElementNDC(K2, N2), ElementNDC(K3, N3), ElementNDC(K4, N4),
ElementNDC(K5, N5), ElementNDC(K6, N6), ElementNDC(K7, N7), ElementNDC(K8, N8), ElementNDC(K9, N9) };
@ -276,7 +276,7 @@ namespace
}
//*************************************************************************
TEST(test_destruct_via_iunordered_multimap)
TEST_FIXTURE(SetupFixture, test_destruct_via_iunordered_multimap)
{
int current_count = NDC::get_instance_count();

View File

@ -164,7 +164,7 @@ namespace
#if ETL_USING_CPP17 && ETL_HAS_INITIALIZER_LIST && !defined(ETL_TEMPLATE_DEDUCTION_GUIDE_TESTS_DISABLED)
//*************************************************************************
TEST(test_cpp17_deduced_constructor)
TEST_FIXTURE(SetupFixture, test_cpp17_deduced_constructor)
{
etl::unordered_multiset data{ N0, N1, N2, N3, N4, N5, N6, N7, N8, N9 };
etl::unordered_multiset<NDC, 10U> check = { N0, N1, N2, N3, N4, N5, N6, N7, N8, N9 };
@ -206,16 +206,27 @@ namespace
DataM data2(std::move(data1));
size_t count1 = etl::distance(data1.begin(), data1.end());
size_t count2 = etl::distance(data2.begin(), data2.end());
CHECK(!data1.empty()); // Move does not clear the source.
CHECK_EQUAL(1, ItemM(1).value);
CHECK_EQUAL(2, ItemM(2).value);
CHECK_EQUAL(3, ItemM(3).value);
CHECK_EQUAL(4, ItemM(4).value);
DataM::const_iterator itr = data1.begin();
CHECK(data2.find(ItemM(1)) != data2.end());
CHECK(data2.find(ItemM(2)) != data2.end());
CHECK(data2.find(ItemM(3)) != data2.end());
CHECK(data2.find(ItemM(4)) != data2.end());
CHECK(data2.find(ItemM(1))->valid);
CHECK(data2.find(ItemM(2))->valid);
CHECK(data2.find(ItemM(3))->valid);
CHECK(data2.find(ItemM(4))->valid);
}
//*************************************************************************
TEST(test_destruct_via_iunordered_multiset)
TEST_FIXTURE(SetupFixture, test_destruct_via_iunordered_multiset)
{
int current_count = NDC::get_instance_count();
@ -294,11 +305,6 @@ namespace
data2 = std::move(data1);
CHECK(!data1.empty()); // Move does not clear the source.
CHECK_EQUAL(1, ItemM(1).value);
CHECK_EQUAL(2, ItemM(2).value);
CHECK_EQUAL(3, ItemM(3).value);
CHECK_EQUAL(4, ItemM(4).value);
}
//*************************************************************************

View File

@ -157,7 +157,7 @@ namespace
#if ETL_USING_CPP17 && ETL_HAS_INITIALIZER_LIST && !defined(ETL_TEMPLATE_DEDUCTION_GUIDE_TESTS_DISABLED)
//*************************************************************************
TEST(test_cpp17_deduced_constructor)
TEST_FIXTURE(SetupFixture, test_cpp17_deduced_constructor)
{
etl::unordered_set data{ N0, N1, N2, N3, N4, N5, N6, N7, N8, N9 };
etl::unordered_set<NDC, 10U> check = { N0, N1, N2, N3, N4, N5, N6, N7, N8, N9 };
@ -200,15 +200,10 @@ namespace
DataM data2(std::move(data1));
CHECK(!data1.empty()); // Move does not clear the source.
CHECK_EQUAL(1, ItemM(1).value);
CHECK_EQUAL(2, ItemM(2).value);
CHECK_EQUAL(3, ItemM(3).value);
CHECK_EQUAL(4, ItemM(4).value);
}
//*************************************************************************
TEST(test_destruct_via_iunordered_set)
TEST_FIXTURE(SetupFixture, test_destruct_via_iunordered_set)
{
int current_count = NDC::get_instance_count();
@ -287,11 +282,6 @@ namespace
data2 = std::move(data1);
CHECK(!data1.empty()); // Move does not clear the source.
CHECK_EQUAL(1, ItemM(1).value);
CHECK_EQUAL(2, ItemM(2).value);
CHECK_EQUAL(3, ItemM(3).value);
CHECK_EQUAL(4, ItemM(4).value);
}
//*************************************************************************

View File

@ -97,8 +97,8 @@ Global
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug MSVC - String Truncation Is Error|Win32.Build.0 = Debug|Win32
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug MSVC - String Truncation Is Error|x64.ActiveCfg = DebugStringTruncationIsError|x64
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug MSVC - String Truncation Is Error|x64.Build.0 = DebugStringTruncationIsError|x64
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug MSVC 64|Win32.ActiveCfg = Debug No Unit Tests|Win32
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug MSVC 64|Win32.Build.0 = Debug No Unit Tests|Win32
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug MSVC 64|Win32.ActiveCfg = Debug|Win32
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug MSVC 64|Win32.Build.0 = Debug|Win32
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug MSVC 64|x64.ActiveCfg = Debug64|x64
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug MSVC 64|x64.Build.0 = Debug64|x64
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug MSVC C++20 - No STL|Win32.ActiveCfg = Debug MSVC C++20 - No STL|Win32

File diff suppressed because it is too large Load Diff

View File

@ -2201,81 +2201,6 @@
<ClCompile Include="..\test_byte.cpp">
<Filter>Tests\Binary</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc8_ebu.h.t.cpp">
<Filter>Tests\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc8_icode.h.t.cpp">
<Filter>Tests\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc8_itu.h.t.cpp">
<Filter>Tests\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc8_maxim.h.t.cpp">
<Filter>Tests\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc8_wcdma.h.t.cpp">
<Filter>Tests\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_a.h.t.cpp">
<Filter>Tests\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_arc.h.t.cpp">
<Filter>Tests\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_buypass.h.t.cpp">
<Filter>Tests\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_cdma2000.h.t.cpp">
<Filter>Tests\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_dds110.h.t.cpp">
<Filter>Tests\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_dectr.h.t.cpp">
<Filter>Tests\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_dectx.h.t.cpp">
<Filter>Tests\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_dnp.h.t.cpp">
<Filter>Tests\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_en13757.h.t.cpp">
<Filter>Tests\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_maxim.h.t.cpp">
<Filter>Tests\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_mcrf4xx.h.t.cpp">
<Filter>Tests\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_profibus.h.t.cpp">
<Filter>Tests\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_riello.h.t.cpp">
<Filter>Tests\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_t10dif.h.t.cpp">
<Filter>Tests\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_teledisk.h.t.cpp">
<Filter>Tests\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_tms37157.h.t.cpp">
<Filter>Tests\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc32_d.h.t.cpp">
<Filter>Tests\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc32_jamcrc.h.t.cpp">
<Filter>Tests\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc32_q.h.t.cpp">
<Filter>Tests\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc32_xfer.h.t.cpp">
<Filter>Tests\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\test_etl_traits.cpp">
<Filter>Tests\Misc</Filter>
</ClCompile>
@ -2285,9 +2210,6 @@
<ClCompile Include="..\test_message_timer_interrupt.cpp">
<Filter>Tests\Messaging</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\absolute.h.t.cpp">
<Filter>Tests\Sanity Checks\Source</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\algorithm.h.t.cpp">
<Filter>Tests\Sanity Checks\Source</Filter>
</ClCompile>
@ -3242,6 +3164,90 @@
<ClCompile Include="..\test_nth_type.cpp">
<Filter>Tests\Types</Filter>
</ClCompile>
<ClCompile Include="..\test_successor.cpp">
<Filter>Tests\Patterns</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\absolute.h.t.cpp">
<Filter>Tests\Sanity Checks\Source</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc8_ebu.h.t.cpp">
<Filter>Tests\Sanity Checks\Source</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc8_icode.h.t.cpp">
<Filter>Tests\Sanity Checks\Source</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc8_itu.h.t.cpp">
<Filter>Tests\Sanity Checks\Source</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc8_maxim.h.t.cpp">
<Filter>Tests\Sanity Checks\Source</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc8_wcdma.h.t.cpp">
<Filter>Tests\Sanity Checks\Source</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_a.h.t.cpp">
<Filter>Tests\Sanity Checks\Source</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_arc.h.t.cpp">
<Filter>Tests\Sanity Checks\Source</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_buypass.h.t.cpp">
<Filter>Tests\Sanity Checks\Source</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_cdma2000.h.t.cpp">
<Filter>Tests\Sanity Checks\Source</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_dds110.h.t.cpp">
<Filter>Tests\Sanity Checks\Source</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_dectr.h.t.cpp">
<Filter>Tests\Sanity Checks\Source</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_dectx.h.t.cpp">
<Filter>Tests\Sanity Checks\Source</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_dnp.h.t.cpp">
<Filter>Tests\Sanity Checks\Source</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_en13757.h.t.cpp">
<Filter>Tests\Sanity Checks\Source</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_maxim.h.t.cpp">
<Filter>Tests\Sanity Checks\Source</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_mcrf4xx.h.t.cpp">
<Filter>Tests\Sanity Checks\Source</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_profibus.h.t.cpp">
<Filter>Tests\Sanity Checks\Source</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_riello.h.t.cpp">
<Filter>Tests\Sanity Checks\Source</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_t10dif.h.t.cpp">
<Filter>Tests\Sanity Checks\Source</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_teledisk.h.t.cpp">
<Filter>Tests\Sanity Checks\Source</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc16_tms37157.h.t.cpp">
<Filter>Tests\Sanity Checks\Source</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc32_d.h.t.cpp">
<Filter>Tests\Sanity Checks\Source</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc32_jamcrc.h.t.cpp">
<Filter>Tests\Sanity Checks\Source</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc32_q.h.t.cpp">
<Filter>Tests\Sanity Checks\Source</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\crc32_xfer.h.t.cpp">
<Filter>Tests\Sanity Checks\Source</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\delegate_cpp03.h.t.cpp">
<Filter>Tests\Sanity Checks\Source</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="..\..\library.properties">
@ -3344,7 +3350,7 @@
<Filter>Resource Files\CMake</Filter>
</None>
<None Include="..\..\scripts\update_release.py">
<Filter>Resource Files\Scripts</Filter>
<Filter>Tests\Scripts</Filter>
</None>
</ItemGroup>
<ItemGroup>

View File

@ -1 +1 @@
20.27.3
20.28.0