Merge branch 'feature/bit_cast-midpoint-lerp' into feature/unaligned-types

# Conflicts:
#	include/etl/endianness.h
#	test/vs2019/etl.vcxproj.filters
This commit is contained in:
John Wellbelove 2022-01-08 18:53:17 +00:00
commit 6b123e1bdb
47 changed files with 5043 additions and 271 deletions

2
.gitignore vendored
View File

@ -344,3 +344,5 @@ test/meson-logs
test/meson-private
test/build-make
test/build-ninja
test/vs2019/Debug MSVC C++20
test/vs2019/Debug MSVC C++20 - No STL

File diff suppressed because it is too large Load Diff

249
include/etl/bit.h Normal file
View File

@ -0,0 +1,249 @@
///\file
/******************************************************************************
The MIT License(MIT)
Embedded Template Library.
https://github.com/ETLCPP/etl
https://www.etlcpp.com
Copyright(c) 2021 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.
******************************************************************************/
#ifndef ETL_BIT_INCLUDED
#define ETL_BIT_INCLUDED
#include <string.h>
#include "platform.h"
#include "type_traits.h"
#include "binary.h"
#include "integral_limits.h"
#include "endianness.h"
#include "type_traits.h"
#if ETL_CPP20_SUPPORTED && ETL_USING_STL
#include <bit>
#endif
namespace etl
{
//***************************************************************************
/// bit_cast
//***************************************************************************
template <typename TDestination, typename TSource>
ETL_CONSTEXPR14
typename etl::enable_if<(sizeof(TDestination) == sizeof(TSource)) &&
etl::is_trivially_copyable<TSource>::value &&
etl::is_trivially_copyable<TDestination>::value, TDestination>::type
bit_cast(const TSource& source) ETL_NOEXCEPT
{
TDestination destination;
const char* s = &source;
char* d = &destination;
char* const de = d + sizeof(TDestination);
while (d != de)
{
*d++ = *s++;
}
return destination;
}
//***************************************************************************
/// byteswap
//***************************************************************************
template <typename T>
ETL_CONSTEXPR14
typename etl::enable_if<etl::is_integral<T>::value, T>::type
byteswap(T value) ETL_NOEXCEPT
{
return etl::reverse_bytes(value);
}
//***************************************************************************
/// has_single_bit
//***************************************************************************
template <typename T>
ETL_NODISCARD ETL_CONSTEXPR14
typename etl::enable_if<etl::is_unsigned<T>::value, bool>::type has_single_bit(T value) ETL_NOEXCEPT
{
return (value & (value - 1)) == 0;
}
//***************************************************************************
/// countl_zero
//***************************************************************************
template <typename T>
ETL_NODISCARD ETL_CONSTEXPR14
typename etl::enable_if<etl::is_unsigned<T>::value, int>::type
countl_zero(T value) ETL_NOEXCEPT
{
return etl::count_leading_zeros(value);
}
//***************************************************************************
/// countl_one
//***************************************************************************
template <typename T>
ETL_NODISCARD ETL_CONSTEXPR14
typename etl::enable_if<etl::is_unsigned<T>::value, int>::type
countl_one(T value) ETL_NOEXCEPT
{
return etl::count_leading_ones(value);
}
//***************************************************************************
/// countr_zero
//***************************************************************************
template <typename T>
ETL_NODISCARD ETL_CONSTEXPR14
typename etl::enable_if<etl::is_unsigned<T>::value, int>::type
countr_zero(T value) ETL_NOEXCEPT
{
return etl::count_trailing_zeros(value);
}
//***************************************************************************
/// countr_one
//***************************************************************************
template <typename T>
ETL_NODISCARD ETL_CONSTEXPR14
typename etl::enable_if<etl::is_unsigned<T>::value, int>::type
countr_one(T value) ETL_NOEXCEPT
{
return etl::count_trailing_ones(value);;
}
//***************************************************************************
/// bit_width
//***************************************************************************
template <typename T>
ETL_CONSTEXPR14
typename etl::enable_if<etl::is_unsigned<T>::value, T>::type
bit_width(T value) ETL_NOEXCEPT
{
#if ETL_CPP20_SUPPORTED && ETL_USING_STL
return std::bit_width(value);
#else
return etl::integral_limits<T>::bits - etl::countl_zero(value);
#endif
}
//***************************************************************************
/// bit_ceil
//***************************************************************************
template <typename T>
ETL_NODISCARD ETL_CONSTEXPR14
typename etl::enable_if<etl::is_unsigned<T>::value, T>::type
bit_ceil(T value)
{
#if ETL_CPP20_SUPPORTED && ETL_USING_STL
return std::bit_ceil(value);
#else
if (value == T(0))
{
return T(1);
}
else
{
return T(1) << etl::bit_width(T(value - T(1)));
}
#endif
}
//***************************************************************************
/// bit_floor
//***************************************************************************
template <typename T>
ETL_NODISCARD ETL_CONSTEXPR14
typename etl::enable_if<etl::is_unsigned<T>::value, T>::type
bit_floor(T value) ETL_NOEXCEPT
{
#if ETL_CPP20_SUPPORTED && ETL_USING_STL
return std::bit_floor(value);
#else
if (value == T(0))
{
return T(0);
}
else
{
return T(1) << (etl::bit_width(value) - T(1));
}
#endif
}
//***************************************************************************
/// rotl
//***************************************************************************
template <typename T>
ETL_NODISCARD ETL_CONSTEXPR14
typename etl::enable_if<etl::is_unsigned<T>::value, T>::type
rotl(T value, int n) ETL_NOEXCEPT
{
ETL_CONSTANT size_t N = etl::integral_limits<T>::bits;
if (n < 0)
{
return etl::rotate_right(value, -n);
}
else
{
return etl::rotate_left(value, n);
}
}
//***************************************************************************
/// rotr
//***************************************************************************
template <typename T>
ETL_NODISCARD ETL_CONSTEXPR14
typename etl::enable_if<etl::is_unsigned<T>::value, T>::type
rotr(T value, int n) ETL_NOEXCEPT
{
ETL_CONSTANT size_t N = etl::integral_limits<T>::bits;
if (n < 0)
{
return etl::rotate_left(value, -n);
}
else
{
return etl::rotate_right(value, n);
}
}
//***************************************************************************
/// popcount
//***************************************************************************
template <typename T>
ETL_NODISCARD ETL_CONSTEXPR14
typename etl::enable_if<etl::is_unsigned<T>::value, int>::type
popcount(T value) ETL_NOEXCEPT
{
return etl::count_bits(value);
}
}
#endif

View File

@ -196,11 +196,7 @@ namespace etl
};
// The type of the callback function.
//#if ETL_CPP11_SUPPORTED & !defined(ETL_DELEGATE_FORCE_CPP03_IMPLEMENTATION)
typedef etl::delegate<void(notification)> callback_type;
//#else
// typedef etl::delegate<void, notification> callback_type;
//#endif
//*********************************
buffer_descriptors(TBuffer* pbuffers_, callback_type callback_ = callback_type())

View File

@ -37,10 +37,46 @@ SOFTWARE.
#include "enum_type.h"
#include "binary.h"
#if ETL_CPP20_SUPPORTED && ETL_USING_STL
#include <bit>
#endif
///\defgroup endian endian
/// Constants & utilities for endianess
///\ingroup utilities
#if !((!defined(ETL_ENDIAN_LITTLE) && !defined(ETL_ENDIAN_BIG) && !defined(ETL_ENDIAN_NATIVE)) || ((defined(ETL_ENDIAN_LITTLE) && defined(ETL_ENDIAN_BIG) && defined(ETL_ENDIAN_NATIVE))))
#error All three of ETL_ENDIAN_LITTLE, ETL_ENDIAN_BIG and ETL_ENDIAN_NATIVE must be defined
#endif
// Have we not already defined all of the macros?
#if !defined(ETL_ENDIAN_LITTLE) || !defined(ETL_ENDIAN_BIG) || !defined(ETL_ENDIAN_NATIVE)
#undef ETL_ENDIAN_LITTLE
#undef ETL_ENDIAN_BIG
#undef ETL_ENDIAN_NATIVE
// Can we use the C++20 definitions?
#if ETL_CPP20_SUPPORTED && ETL_USING_STL
#define ETL_ENDIAN_LITTLE std::endian::little
#define ETL_ENDIAN_BIG std::endian::big
#define ETL_ENDIAN_NATIVE std::endian::native
// If not can we use the compiler macros?
#elif defined(__BYTE_ORDER__)
// Test the two versions of the macro we are likely to see.
#if defined(__ORDER_LITTLE_ENDIAN__)
#define ETL_ENDIAN_LITTLE __ORDER_LITTLE_ENDIAN__
#define ETL_ENDIAN_BIG __ORDER_BIG_ENDIAN__
#define ETL_ENDIAN_NATIVE __BYTE_ORDER__
#elif defined(__LITTLE_ENDIAN__)
#define ETL_ENDIAN_LITTLE __LITTLE_ENDIAN__
#define ETL_ENDIAN_BIG __BIG_ENDIAN__
#define ETL_ENDIAN_NATIVE __BYTE_ORDER__
#endif
#endif
#endif
// If true, then the endianness of the platform can be constexpr.
#define ETL_ENDIANNESS_IS_CONSTEXPR (ETL_CPP11_SUPPORTED && defined(ETL_ENDIAN_NATIVE))
namespace etl
{
//***************************************************************************
@ -49,17 +85,28 @@ namespace etl
//***************************************************************************
struct endian
{
#if defined(ETL_ENDIAN_NATIVE)
enum enum_type
{
little = static_cast<int>(ETL_ENDIAN_LITTLE),
big = static_cast<int>(ETL_ENDIAN_BIG),
native = static_cast<int>(ETL_ENDIAN_NATIVE),
unknown = INT_MAX
};
#else
enum enum_type
{
little,
big,
native
native,
unknown = native
};
#endif
ETL_DECLARE_ENUM_TYPE(endian, int)
ETL_ENUM_TYPE(little, "little")
ETL_ENUM_TYPE(big, "big")
ETL_ENUM_TYPE(native, "native")
ETL_ENUM_TYPE(little, "little")
ETL_ENUM_TYPE(big, "big")
ETL_ENUM_TYPE(unknown, "unknown")
ETL_END_ENUM_TYPE
};
@ -74,11 +121,17 @@ namespace etl
return etl::endian(*this);
}
#if ETL_ENDIANNESS_IS_CONSTEXPR
ETL_CONSTEXPR
#endif
operator etl::endian() const
{
return get();
}
#if ETL_ENDIANNESS_IS_CONSTEXPR
ETL_CONSTEXPR
#endif
static etl::endian value()
{
return get();
@ -86,38 +139,19 @@ namespace etl
private:
#if ETL_ENDIANNESS_IS_CONSTEXPR
ETL_CONSTEXPR static etl::endian get()
{
return etl::endian::native;
}
#else
static etl::endian get()
{
static union U
{
U()
: ui32(0x12345678UL)
{
}
static const uint32_t i = 0xFFFF0000;
uint32_t ui32;
uint16_t ui16[2];
} u;
return (u.ui16[0] == 0x5678U) ? etl::endian::little : etl::endian::big;
return (*reinterpret_cast<const unsigned char*>(&i) == 0) ? etl::endian::little : etl::endian::big;
}
// constexpr static auto check()
// {
//#if defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
//
// return etl::endian::big;
//
//#elif defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
//
// return etl::endian::little;
//
//#else
//
// return Endian::UNKNOWN;
//
//#endif
// }
#endif
};
//***************************************************************************

View File

@ -1,20 +1,33 @@
#pragma once
template <typename To, typename From>
etl::enable_if_t<sizeof(To) == sizeof(From) && etl::is_trivially_copyable_v<From> && etl::is_trivially_copyable_v<To>, To>
//ETL_CONSTEXPR
bit_cast(const From& src) ETL_NOEXCEPT
#include "platform.h"
template <typename TDestination, typename TSource>
typename etl::enable_if<(sizeof(TDestination) == sizeof(TSource)) &&
etl::is_trivially_copyable<TSource>::value &&
etl::is_trivially_copyable<TDestination>::value, TDestination>::type
bit_cast(const TSource& source) ETL_NOEXCEPT
{
To dst;
memcpy(&dst, &src, sizeof(To));
TDestination destination;
// __builtin_memcpy(&dst, &src, sizeof(To));
memcpy(&destination, &source, sizeof(TDestination));
return dst;
return destination;
}
std::midpoint
// https://en.cppreference.com/w/cpp/numeric/midpoint
template <typename TDestination, typename TSource>
ETL_CONSTEXPR
typename etl::enable_if<(sizeof(TDestination) == sizeof(TSource)) &&
etl::is_trivially_copyable<TSource>::value &&
etl::is_trivially_copyable<TDestination>::value, TDestination>::type
bit_cast(const TSource& source) ETL_NOEXCEPT
{
TDestination destination;
__builtin_memcpy(&destination, &source, sizeof(TDestination));
return destination;
}
std::lerp
// https://en.cppreference.com/w/cpp/numeric/lerp

View File

@ -106,9 +106,26 @@ namespace etl
return reference_wrapper<const T>(t.get());
}
//***************************************************************************
template <typename TArgumentType, typename TResultType>
struct unary_function
{
typedef TArgumentType argument_type;
typedef TResultType result_type;
};
//***************************************************************************
template <typename TFirstArgumentType, typename TSecondArgumentType, typename TResultType>
struct binary_function
{
typedef TFirstArgumentType first_argument_type;
typedef TSecondArgumentType second_argument_type;
typedef TResultType result_type;
};
//***************************************************************************
template <typename T = void>
struct less
struct less : public etl::binary_function<T, T, bool>
{
typedef T value_type;
@ -120,7 +137,7 @@ namespace etl
#if ETL_CPP11_SUPPORTED
template <>
struct less<void>
struct less<void> : public etl::binary_function<void, void, bool>
{
typedef int is_transparent;
@ -134,7 +151,7 @@ namespace etl
//***************************************************************************
template <typename T = void>
struct less_equal
struct less_equal : public etl::binary_function<T, T, bool>
{
typedef T value_type;
@ -144,10 +161,9 @@ namespace etl
}
};
#if ETL_CPP11_SUPPORTED
template <>
struct less_equal<void>
struct less_equal<void> : public etl::binary_function<void, void, bool>
{
typedef int is_transparent;
@ -161,7 +177,7 @@ namespace etl
//***************************************************************************
template <typename T = void>
struct greater
struct greater : public etl::binary_function<T, T, bool>
{
typedef T value_type;
@ -173,7 +189,7 @@ namespace etl
#if ETL_CPP11_SUPPORTED
template <>
struct greater<void>
struct greater<void> : public etl::binary_function<void, void, bool>
{
typedef int is_transparent;
@ -187,7 +203,7 @@ namespace etl
//***************************************************************************
template <typename T = void>
struct greater_equal
struct greater_equal : public etl::binary_function<T, T, bool>
{
typedef T value_type;
@ -199,7 +215,7 @@ namespace etl
#if ETL_CPP11_SUPPORTED
template <>
struct greater_equal<void>
struct greater_equal<void> : public etl::binary_function<void, void, bool>
{
typedef int is_transparent;
@ -213,7 +229,7 @@ namespace etl
//***************************************************************************
template <typename T = void>
struct equal_to
struct equal_to : public etl::binary_function<T, T, bool>
{
typedef T value_type;
@ -225,7 +241,7 @@ namespace etl
#if ETL_CPP11_SUPPORTED
template <>
struct equal_to<void>
struct equal_to<void> : public etl::binary_function<void, void, bool>
{
typedef void value_type;
typedef int is_transparent;
@ -240,7 +256,7 @@ namespace etl
//***************************************************************************
template <typename T = void>
struct not_equal_to
struct not_equal_to : public etl::binary_function<T, T, bool>
{
typedef T value_type;
@ -252,7 +268,7 @@ namespace etl
#if ETL_CPP11_SUPPORTED
template <>
struct not_equal_to<void>
struct not_equal_to<void> : public etl::binary_function<void, void, bool>
{
typedef int is_transparent;
@ -265,26 +281,6 @@ namespace etl
#endif
//***************************************************************************
template <typename TArgumentType, typename TResultType>
struct unary_function
{
typedef TArgumentType argument_type;
typedef TResultType result_type;
};
//***************************************************************************
template <typename TFirstArgumentType, typename TSecondArgumentType, typename TResultType>
struct binary_function
{
typedef TFirstArgumentType first_argument_type;
typedef TSecondArgumentType second_argument_type;
typedef TResultType result_type;
};
//***************************************************************************
template <typename TFunction>
class binder1st : public etl::unary_function<typename TFunction::second_argument_type, typename TFunction::result_type>
{

View File

@ -51,10 +51,13 @@ namespace etl
struct forward_iterator_tag : public input_iterator_tag {};
struct bidirectional_iterator_tag : public forward_iterator_tag {};
struct random_access_iterator_tag : public bidirectional_iterator_tag {};
struct contiguous_iterator_tag : public random_access_iterator_tag {};
//***************************************************************************
// iterator_traits
template <typename TIterator>
// For anything not a fundamental type.
template <typename TIterator, typename = typename etl::enable_if<!etl::is_fundamental<TIterator>::value, void>::type>
struct iterator_traits
{
typedef typename TIterator::iterator_category iterator_category;
@ -63,25 +66,27 @@ namespace etl
typedef typename TIterator::pointer pointer;
typedef typename TIterator::reference reference;
};
// For pointers.
template <typename T>
struct iterator_traits<T*>
struct iterator_traits<T*, void>
{
typedef ETL_OR_STD::random_access_iterator_tag iterator_category;
typedef T value_type;
typedef ptrdiff_t difference_type;
typedef T* pointer;
typedef T& reference;
typedef T value_type;
typedef ptrdiff_t difference_type;
typedef typename etl::remove_cv<T>::type* pointer;
typedef T& reference;
};
// For const pointers.
template <typename T>
struct iterator_traits<const T*>
struct iterator_traits<const T*, void>
{
typedef ETL_OR_STD::random_access_iterator_tag iterator_category;
typedef T value_type;
typedef ptrdiff_t difference_type;
typedef const T* pointer;
typedef const T& reference;
typedef ETL_OR_STD::random_access_iterator_tag iterator_category;
typedef T value_type;
typedef ptrdiff_t difference_type;
typedef const typename etl::remove_cv<T>::type* pointer;
typedef const T& reference;
};
//***************************************************************************

View File

@ -32,6 +32,13 @@ SOFTWARE.
#define ETL_NUMERIC_INCLUDED
#include "platform.h"
#include "type_traits.h"
#include "limits.h"
#include "iterator.h"
#if ETL_USING_STL
#include <iterator>
#endif
///\defgroup numeric numeric
///\ingroup utilities
@ -54,7 +61,159 @@ namespace etl
*first++ = value++;
}
}
//***************************************************************************
/// midpoint
/// For floating point.
//***************************************************************************
template <typename T>
ETL_CONSTEXPR14 typename etl::enable_if<!etl::is_pointer<T>::value &&
!etl::is_integral<T>::value &&
etl::is_floating_point<T>::value, T>::type
midpoint(T a, T b) ETL_NOEXCEPT
{
T lo = etl::numeric_limits<T>::min() * T(2);
T hi = etl::numeric_limits<T>::max() * T(2);
return ((abs(a) <= hi) && (abs(b) <= hi)) ?
(a + b) / T(2) :
(abs(a) < lo) ?
a + (b / T(2)) :
(abs(b) < lo) ?
((a / T(2)) + b) :
(a / T(2)) + (b / T(2));
}
//***************************************************************************
/// midpoint
/// For unsigned integrals.
//***************************************************************************
template <typename T>
ETL_CONSTEXPR14 typename etl::enable_if<!etl::is_pointer<T>::value &&
etl::is_integral<T>::value &&
!etl::is_floating_point<T>::value &&
etl::is_unsigned<T>::value, T>::type
midpoint(T a, T b) ETL_NOEXCEPT
{
if (a > b)
{
return a - ((a - b) >> 1);
}
else
{
return a + ((b - a) >> 1);
}
}
//***************************************************************************
/// midpoint
/// For signed integrals.
//***************************************************************************
template <typename T>
ETL_CONSTEXPR14 typename etl::enable_if<!etl::is_pointer<T>::value&&
etl::is_integral<T>::value &&
!etl::is_floating_point<T>::value&&
etl::is_signed<T>::value, T>::type
midpoint(T a, T b) ETL_NOEXCEPT
{
typedef typename etl::make_unsigned<T>::type utype;
if (a > b)
{
return a - T(utype(utype(a) - utype(b)) >> 1);
}
else
{
return a + T((utype(b) - utype(a)) >> 1);
}
}
//***************************************************************************
/// midpoint
/// For pointers.
//***************************************************************************
template <typename T>
ETL_CONSTEXPR typename etl::enable_if<etl::is_pointer<T>::value&&
!etl::is_integral<T>::value &&
!etl::is_floating_point<T>::value, T>::type
midpoint(T a, T b) ETL_NOEXCEPT
{
if (a > b)
{
return b + (etl::distance(b, a) / 2U);
}
else
{
return a + (etl::distance(a, b) / 2U);
}
}
//***************************************************************************
/// midpoint
/// For ETL random access iterators.
//***************************************************************************
template <typename T>
ETL_CONSTEXPR T midpoint(T a, T b, typename etl::enable_if<!etl::is_pointer<T>::value &&
!etl::is_integral<T>::value &&
!etl::is_floating_point<T>::value &&
etl::is_same<typename etl::iterator_traits<T>::iterator_category, ETL_OR_STD::random_access_iterator_tag>::value , int>::type = 0)
{
if (a > b)
{
return b + (etl::distance(b, a) / 2U);
}
else
{
return a + (etl::distance(a, b) / 2U);
}
}
//***************************************************************************
/// midpoint
/// For ETL forward and bidirectional iterators.
/// Parameter 'a' must be before 'b', otherwise the result is undefined.
//***************************************************************************
template <typename T>
ETL_CONSTEXPR T midpoint(T a, T b, typename etl::enable_if<(!etl::is_pointer<T>::value &&
!etl::is_integral<T>::value &&
!etl::is_floating_point<T>::value &&
etl::is_same<typename etl::iterator_traits<T>::iterator_category, ETL_OR_STD::forward_iterator_tag>::value ||
etl::is_same<typename etl::iterator_traits<T>::iterator_category, ETL_OR_STD::bidirectional_iterator_tag>::value)
, int>::type = 0)
{
etl::advance(a, etl::distance(a, b) / 2U);
return a;
}
//***************************************************************************
/// Linear interpolation
/// For floating point.
//***************************************************************************
template <typename T>
ETL_CONSTEXPR typename etl::enable_if<etl::is_floating_point<T>::value, T>::type
lerp(T a, T b, T t) ETL_NOEXCEPT
{
return a + (t * (b - a));
}
//***************************************************************************
/// Linear interpolation
/// For when any parameter is not floating point.
//***************************************************************************
template <typename TArithmetic1, typename TArithmetic2, typename TArithmetic3>
ETL_CONSTEXPR typename etl::enable_if<!etl::is_floating_point<TArithmetic1>::value ||
!etl::is_floating_point<TArithmetic2>::value ||
!etl::is_floating_point<TArithmetic3>::value, typename etl::conditional<etl::is_same<TArithmetic1, long double>::value ||
etl::is_same<TArithmetic2, long double>::value ||
etl::is_same<TArithmetic3, long double>::value, long double, double>::type>::type
lerp(TArithmetic1 a, TArithmetic2 b, TArithmetic3 t) ETL_NOEXCEPT
{
typedef typename etl::conditional<etl::is_integral<TArithmetic1>::value, double, TArithmetic1>::type typecast_a;
typedef typename etl::conditional<etl::is_integral<TArithmetic2>::value, double, TArithmetic2>::type typecast_b;
typedef typename etl::conditional<etl::is_integral<TArithmetic3>::value, double, TArithmetic3>::type typecast_t;
return typecast_a(a) + (typecast_t(t) * (typecast_b(b) - typecast_a(a)));
}
}
#endif

View File

@ -32,11 +32,13 @@ SOFTWARE.
* The header include guard has been intentionally omitted.
* This file is intended to evaluated multiple times by design.
*/
#if !defined(ETL_COMPILER_ARM5) && !defined(ETL_COMPILER_GREEN_HILLS)
#pragma pop_macro("min")
#pragma pop_macro("max")
#else
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)<(b)?(b):(a))
#if !defined(ETL_COMPILER_GREEN_HILLS)
#if !defined(ETL_COMPILER_ARM5)
#pragma pop_macro("min")
#pragma pop_macro("max")
#else
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)<(b)?(b):(a))
#endif
#endif

View File

@ -32,10 +32,13 @@ SOFTWARE.
* The header include guard has been intentionally omitted.
* This file is intended to evaluated multiple times by design.
*/
#if !defined(ETL_COMPILER_ARM5) && !defined(ETL_COMPILER_GREEN_HILLS)
#pragma push_macro("min")
#pragma push_macro("max")
#endif
#undef min
#undef max
#if !defined(ETL_COMPILER_GREEN_HILLS)
#if !defined(ETL_COMPILER_ARM5)
#pragma push_macro("min")
#pragma push_macro("max")
#endif
#undef min
#undef max
#endif

View File

@ -35,29 +35,78 @@ SOFTWARE.
#include "determine_compiler.h"
#if !defined(ETL_CPP11_SUPPORTED) && !defined(ETL_CPP14_SUPPORTED) && !defined(ETL_CPP17_SUPPORTED)
// Determine C++20 support
#if !defined(ETL_CPP20_SUPPORTED)
#if defined(__cplusplus)
#if defined(ETL_COMPILER_MICROSOFT)
#define ETL_CPP20_SUPPORTED (_MSC_VER >= 1929)
#elif defined(ETL_COMPILER_ARM5)
#define ETL_CPP20_SUPPORTED 0
#else
#define ETL_CPP20_SUPPORTED (__cplusplus >= 202002L)
#endif
#else
#define ETL_CPP20_SUPPORTED 0
#endif
#endif
#if ETL_CPP20_SUPPORTED
#define ETL_CPP11_SUPPORTED 1
#define ETL_CPP14_SUPPORTED 1
#define ETL_CPP17_SUPPORTED 1
#endif
// Determine C++17 support
#if !defined(ETL_CPP17_SUPPORTED)
#if defined(__cplusplus)
#if defined(ETL_COMPILER_MICROSOFT)
#define ETL_CPP17_SUPPORTED (_MSC_VER >= 1914)
#elif defined(ETL_COMPILER_ARM5)
#define ETL_CPP17_SUPPORTED 0
#else
#define ETL_CPP17_SUPPORTED (__cplusplus >= 201703L)
#endif
#else
#define ETL_CPP17_SUPPORTED 0
#endif
#endif
#if ETL_CPP17_SUPPORTED
#define ETL_CPP11_SUPPORTED 1
#define ETL_CPP14_SUPPORTED 1
#endif
// Determine C++14 support
#if !defined(ETL_CPP14_SUPPORTED)
#if defined(__cplusplus)
#if defined(ETL_COMPILER_MICROSOFT)
#define ETL_CPP14_SUPPORTED (_MSC_VER >= 1900)
#elif defined(ETL_COMPILER_ARM5)
#define ETL_CPP14_SUPPORTED 0
#else
#define ETL_CPP14_SUPPORTED (__cplusplus >= 201402L)
#endif
#else
#define ETL_CPP14_SUPPORTED 0
#endif
#endif
#if ETL_CPP14_SUPPORTED
#define ETL_CPP11_SUPPORTED 1
#endif
// Determine C++11 support
#if !defined(ETL_CPP11_SUPPORTED)
#if defined(__cplusplus)
#if defined(ETL_COMPILER_MICROSOFT)
#define ETL_CPP11_SUPPORTED (_MSC_VER >= 1600)
#define ETL_CPP14_SUPPORTED (_MSC_VER >= 1900)
#define ETL_CPP17_SUPPORTED (_MSC_VER >= 1914)
#define ETL_CPP20_SUPPORTED 0
#elif defined(ETL_COMPILER_ARM5)
#define ETL_CPP11_SUPPORTED 0
#define ETL_CPP14_SUPPORTED 0
#define ETL_CPP17_SUPPORTED 0
#define ETL_CPP20_SUPPORTED 0
#else
#define ETL_CPP11_SUPPORTED (__cplusplus >= 201103L)
#define ETL_CPP14_SUPPORTED (__cplusplus >= 201402L)
#define ETL_CPP17_SUPPORTED (__cplusplus >= 201703L)
#define ETL_CPP20_SUPPORTED 0
#endif
#else
#define ETL_CPP11_SUPPORTED 0
#define ETL_CPP14_SUPPORTED 0
#define ETL_CPP17_SUPPORTED 0
#define ETL_CPP20_SUPPORTED 0
#endif
#endif
@ -65,6 +114,7 @@ SOFTWARE.
#define ETL_CPP11_NOT_SUPPORTED !ETL_CPP11_SUPPORTED
#define ETL_CPP14_NOT_SUPPORTED !ETL_CPP14_SUPPORTED
#define ETL_CPP17_NOT_SUPPORTED !ETL_CPP17_SUPPORTED
#define ETL_CPP20_NOT_SUPPORTED !ETL_CPP20_SUPPORTED
#if !defined(ETL_NO_NULLPTR_SUPPORT)
#define ETL_NO_NULLPTR_SUPPORT ETL_CPP11_NOT_SUPPORTED

View File

@ -48,6 +48,7 @@ set(TEST_SOURCE_FILES
test_atomic_std.cpp
test_binary.cpp
test_bip_buffer_spsc_atomic.cpp
test_bit.cpp
test_bitset.cpp
test_bit_stream.cpp
test_byte_stream.cpp
@ -254,6 +255,7 @@ set(TEST_SOURCE_FILES
test_type_lookup.cpp
test_type_select.cpp
test_type_traits.cpp
# test_unaligned_type.cpp
test_unordered_map.cpp
test_unordered_multimap.cpp
test_unordered_multiset.cpp

View File

@ -73,6 +73,12 @@ SOFTWARE.
#define ETL_POLYMORPHIC_VECTOR
#define ETL_POLYMORPHIC_INDIRECT_VECTOR
#if defined(ETL_CPP20_ENABLED)
#define ETL_CPP20_SUPPORTED 1
#else
#define ETL_CPP20_SUPPORTED 0
#endif
//#define ETL_POLYMORPHIC_CONTAINERS
//#define ETL_MESSAGES_ARE_VIRTUAL

View File

@ -0,0 +1,29 @@
/******************************************************************************
The MIT License(MIT)
Embedded Template Library.
https://github.com/ETLCPP/etl
https://www.etlcpp.com
Copyright(c) 2022 John Wellbelove
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 <etl/bit.h>

View File

@ -49,6 +49,7 @@ target_sources(t98 PRIVATE etl_profile.h
../basic_string_stream.h.t.cpp
../binary.h.t.cpp
../bip_buffer_spsc_atomic.h.t.cpp
../bit.h.t.cpp
../bitset.h.t.cpp
../bit_stream.h.t.cpp
../byte_stream.h.t.cpp
@ -258,6 +259,7 @@ target_sources(t98 PRIVATE etl_profile.h
../u32format_spec.h.t.cpp
../u32string.h.t.cpp
../u32string_stream.h.t.cpp
#../unaligned_type.h.t.cpp
../unordered_map.h.t.cpp
../unordered_multimap.h.t.cpp
../unordered_multiset.h.t.cpp

View File

@ -34,6 +34,7 @@ SOFTWARE.
#define ETL_CPP11_SUPPORTED 0
#define ETL_CPP14_SUPPORTED 0
#define ETL_CPP17_SUPPORTED 0
#define ETL_CPP20_SUPPORTED 0
#define ETL_IN_UNIT_TEST
#define ETL_CALLBACK_TIMER_USE_INTERRUPT_LOCK
#define ETL_CALLBACK_TIMER_DISABLE_INTERRUPTS

View File

@ -49,6 +49,7 @@ target_sources(t11 PRIVATE etl_profile.h
../basic_string_stream.h.t.cpp
../binary.h.t.cpp
../bip_buffer_spsc_atomic.h.t.cpp
../bit.h.t.cpp
../bitset.h.t.cpp
../bit_stream.h.t.cpp
../byte_stream.h.t.cpp
@ -258,6 +259,7 @@ target_sources(t11 PRIVATE etl_profile.h
../u32format_spec.h.t.cpp
../u32string.h.t.cpp
../u32string_stream.h.t.cpp
#../unaligned_type.h.t.cpp
../unordered_map.h.t.cpp
../unordered_multimap.h.t.cpp
../unordered_multiset.h.t.cpp

View File

@ -34,6 +34,7 @@ SOFTWARE.
#define ETL_CPP11_SUPPORTED 1
#define ETL_CPP14_SUPPORTED 0
#define ETL_CPP17_SUPPORTED 0
#define ETL_CPP20_SUPPORTED 0
#define ETL_IN_UNIT_TEST
#define ETL_CALLBACK_TIMER_USE_INTERRUPT_LOCK
#define ETL_CALLBACK_TIMER_DISABLE_INTERRUPTS

View File

@ -49,6 +49,7 @@ target_sources(t14 PRIVATE etl_profile.h
../basic_string_stream.h.t.cpp
../binary.h.t.cpp
../bip_buffer_spsc_atomic.h.t.cpp
../bit.h.t.cpp
../bitset.h.t.cpp
../bit_stream.h.t.cpp
../byte_stream.h.t.cpp
@ -258,6 +259,7 @@ target_sources(t14 PRIVATE etl_profile.h
../u32format_spec.h.t.cpp
../u32string.h.t.cpp
../u32string_stream.h.t.cpp
#../unaligned_type.h.t.cpp
../unordered_map.h.t.cpp
../unordered_multimap.h.t.cpp
../unordered_multiset.h.t.cpp

View File

@ -34,6 +34,7 @@ SOFTWARE.
#define ETL_CPP11_SUPPORTED 1
#define ETL_CPP14_SUPPORTED 1
#define ETL_CPP17_SUPPORTED 0
#define ETL_CPP20_SUPPORTED 0
#define ETL_IN_UNIT_TEST
#define ETL_CALLBACK_TIMER_USE_INTERRUPT_LOCK
#define ETL_CALLBACK_TIMER_DISABLE_INTERRUPTS

View File

@ -49,6 +49,7 @@ target_sources(t17 PRIVATE etl_profile.h
../basic_string_stream.h.t.cpp
../binary.h.t.cpp
../bip_buffer_spsc_atomic.h.t.cpp
../bit.h.t.cpp
../bitset.h.t.cpp
../bit_stream.h.t.cpp
../byte_stream.h.t.cpp
@ -258,6 +259,7 @@ target_sources(t17 PRIVATE etl_profile.h
../u32format_spec.h.t.cpp
../u32string.h.t.cpp
../u32string_stream.h.t.cpp
#../unaligned_type.h.t.cpp
../unordered_map.h.t.cpp
../unordered_multimap.h.t.cpp
../unordered_multiset.h.t.cpp

View File

@ -34,6 +34,7 @@ SOFTWARE.
#define ETL_CPP11_SUPPORTED 1
#define ETL_CPP14_SUPPORTED 1
#define ETL_CPP17_SUPPORTED 1
#define ETL_CPP20_SUPPORTED 0
#define ETL_IN_UNIT_TEST
#define ETL_CALLBACK_TIMER_USE_INTERRUPT_LOCK
#define ETL_CALLBACK_TIMER_DISABLE_INTERRUPTS

View File

@ -0,0 +1,29 @@
/******************************************************************************
The MIT License(MIT)
Embedded Template Library.
https://github.com/ETLCPP/etl
https://www.etlcpp.com
Copyright(c) 2022 John Wellbelove
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 <etl/unaligned_type.h>

View File

@ -1203,10 +1203,10 @@ namespace
is_permutation = etl::is_permutation(std::begin(data1), std::end(data1), std::begin(not_permutation));
CHECK(!is_permutation);
is_permutation = etl::is_permutation(std::begin(data1), std::end(data1), std::begin(permutation), std::equal_to<int>());
is_permutation = etl::is_permutation(std::begin(data1), std::end(data1), std::begin(permutation), etl::equal_to<int>());
CHECK(is_permutation);
is_permutation = etl::is_permutation(std::begin(data1), std::end(data1), std::begin(not_permutation), std::equal_to<int>());
is_permutation = etl::is_permutation(std::begin(data1), std::end(data1), std::begin(not_permutation), etl::equal_to<int>());
CHECK(!is_permutation);
is_permutation = etl::is_permutation(std::begin(data1), std::end(data1), std::begin(permutation), std::end(permutation));
@ -1215,10 +1215,10 @@ namespace
is_permutation = etl::is_permutation(std::begin(data1), std::end(data1), std::begin(not_permutation), std::end(not_permutation));
CHECK(!is_permutation);
is_permutation = etl::is_permutation(std::begin(data1), std::end(data1), std::begin(permutation), std::end(permutation), std::equal_to<int>());
is_permutation = etl::is_permutation(std::begin(data1), std::end(data1), std::begin(permutation), std::end(permutation), etl::equal_to<int>());
CHECK(is_permutation);
is_permutation = etl::is_permutation(std::begin(data1), std::end(data1), std::begin(not_permutation), std::end(not_permutation), std::equal_to<int>());
is_permutation = etl::is_permutation(std::begin(data1), std::end(data1), std::begin(not_permutation), std::end(not_permutation), etl::equal_to<int>());
CHECK(!is_permutation);
}

View File

@ -40,6 +40,7 @@ SOFTWARE.
namespace
{
//***********************************
// Count bits the easy way.
template <typename T>
size_t test_count(T value)
@ -57,6 +58,73 @@ namespace
return count;
}
//***********************************
// Count trailing zeros the long way.
template <typename T>
size_t test_trailing_zeros(T value)
{
size_t count = 0UL;
for (int i = 0; i < etl::integral_limits<T>::bits; ++i)
{
if ((value & 1) == 0)
{
++count;
}
else
{
return count;
}
value >>= 1;
}
return count;
}
//***********************************
// Count leading zeros the long way.
template <typename T>
size_t test_leading_zeros(T value)
{
value = etl::reverse_bits(value);
return test_trailing_zeros(value);
}
//***********************************
// Count trailing ones the long way.
template <typename T>
size_t test_trailing_ones(T value)
{
size_t count = 0UL;
for (int i = 0; i < etl::integral_limits<T>::bits; ++i)
{
if ((value & 1) == 1)
{
++count;
}
else
{
return count;
}
value >>= 1;
}
return count;
}
//***********************************
// Count leading ones the long way.
template <typename T>
size_t test_leading_ones(T value)
{
value = etl::reverse_bits(value);
return test_trailing_ones(value);
}
//***********************************
// Check parity the easy way.
template <typename T>
size_t test_parity(T value)
@ -66,6 +134,7 @@ namespace
return count & 1;
}
//***********************************
// Power of 2.
uint64_t test_power_of_2(int power)
{
@ -79,6 +148,7 @@ namespace
return result;
}
//***********************************
// Fold bits.
template <typename TReturn>
TReturn test_fold_bits(uint64_t value, int size)
@ -99,6 +169,7 @@ namespace
return result;
}
//***********************************
// Slow gray to binary
template <typename T>
T compare_gray_to_binary(T value_)
@ -740,7 +811,7 @@ namespace
//*************************************************************************
TEST(test_binary_to_gray32)
{
etl::fnv_1a_32 hash;
etl::fnv_1_32 hash;
hash.add(1);
@ -1162,139 +1233,143 @@ namespace
//*************************************************************************
TEST(test_max_value_for_bits)
{
// Check that the values are correct.
//CHECK_EQUAL(0U, etl::max_value_for_nbits<0>::value);
CHECK_EQUAL(1U, etl::max_value_for_nbits<1>::value);
CHECK_EQUAL(3U, etl::max_value_for_nbits<2>::value);
CHECK_EQUAL(7U, etl::max_value_for_nbits<3>::value);
CHECK_EQUAL(15U, etl::max_value_for_nbits<4>::value);
CHECK_EQUAL(31U, etl::max_value_for_nbits<5>::value);
CHECK_EQUAL(63U, etl::max_value_for_nbits<6>::value);
CHECK_EQUAL(127U, etl::max_value_for_nbits<7>::value);
CHECK_EQUAL(255U, etl::max_value_for_nbits<8>::value);
CHECK_EQUAL(511U, etl::max_value_for_nbits<9>::value);
CHECK_EQUAL(1023U, etl::max_value_for_nbits<10>::value);
CHECK_EQUAL(2047U, etl::max_value_for_nbits<11>::value);
CHECK_EQUAL(4095U, etl::max_value_for_nbits<12>::value);
CHECK_EQUAL(8191U, etl::max_value_for_nbits<13>::value);
CHECK_EQUAL(16383U, etl::max_value_for_nbits<14>::value);
CHECK_EQUAL(32767U, etl::max_value_for_nbits<15>::value);
CHECK_EQUAL(65535U, etl::max_value_for_nbits<16>::value);
CHECK_EQUAL(131071UL, etl::max_value_for_nbits<17>::value);
CHECK_EQUAL(262143UL, etl::max_value_for_nbits<18>::value);
CHECK_EQUAL(524287UL, etl::max_value_for_nbits<19>::value);
CHECK_EQUAL(1048575UL, etl::max_value_for_nbits<20>::value);
CHECK_EQUAL(2097151UL, etl::max_value_for_nbits<21>::value);
CHECK_EQUAL(4194303UL, etl::max_value_for_nbits<22>::value);
CHECK_EQUAL(8388607UL, etl::max_value_for_nbits<23>::value);
CHECK_EQUAL(16777215UL, etl::max_value_for_nbits<24>::value);
CHECK_EQUAL(33554431UL, etl::max_value_for_nbits<25>::value);
CHECK_EQUAL(67108863UL, etl::max_value_for_nbits<26>::value);
CHECK_EQUAL(134217727UL, etl::max_value_for_nbits<27>::value);
CHECK_EQUAL(268435455UL, etl::max_value_for_nbits<28>::value);
CHECK_EQUAL(536870911UL, etl::max_value_for_nbits<29>::value);
CHECK_EQUAL(1073741823UL, etl::max_value_for_nbits<30>::value);
CHECK_EQUAL(2147483647UL, etl::max_value_for_nbits<31>::value);
CHECK_EQUAL(4294967295UL, etl::max_value_for_nbits<32>::value);
CHECK_EQUAL(8589934591ULL, etl::max_value_for_nbits<33>::value);
CHECK_EQUAL(17179869183ULL, etl::max_value_for_nbits<34>::value);
CHECK_EQUAL(34359738367ULL, etl::max_value_for_nbits<35>::value);
CHECK_EQUAL(68719476735ULL, etl::max_value_for_nbits<36>::value);
CHECK_EQUAL(137438953471ULL, etl::max_value_for_nbits<37>::value);
CHECK_EQUAL(274877906943ULL, etl::max_value_for_nbits<38>::value);
CHECK_EQUAL(549755813887ULL, etl::max_value_for_nbits<39>::value);
CHECK_EQUAL(1099511627775ULL, etl::max_value_for_nbits<40>::value);
CHECK_EQUAL(2199023255551ULL, etl::max_value_for_nbits<41>::value);
CHECK_EQUAL(4398046511103ULL, etl::max_value_for_nbits<42>::value);
CHECK_EQUAL(8796093022207ULL, etl::max_value_for_nbits<43>::value);
CHECK_EQUAL(17592186044415ULL, etl::max_value_for_nbits<44>::value);
CHECK_EQUAL(35184372088831ULL, etl::max_value_for_nbits<45>::value);
CHECK_EQUAL(70368744177663ULL, etl::max_value_for_nbits<46>::value);
CHECK_EQUAL(140737488355327ULL, etl::max_value_for_nbits<47>::value);
CHECK_EQUAL(281474976710655ULL, etl::max_value_for_nbits<48>::value);
CHECK_EQUAL(562949953421311ULL, etl::max_value_for_nbits<49>::value);
CHECK_EQUAL(1125899906842623ULL, etl::max_value_for_nbits<50>::value);
CHECK_EQUAL(2251799813685247ULL, etl::max_value_for_nbits<51>::value);
CHECK_EQUAL(4503599627370495ULL, etl::max_value_for_nbits<52>::value);
CHECK_EQUAL(9007199254740991ULL, etl::max_value_for_nbits<53>::value);
CHECK_EQUAL(18014398509481983ULL, etl::max_value_for_nbits<54>::value);
CHECK_EQUAL(36028797018963967ULL, etl::max_value_for_nbits<55>::value);
CHECK_EQUAL(72057594037927935ULL, etl::max_value_for_nbits<56>::value);
CHECK_EQUAL(144115188075855871ULL, etl::max_value_for_nbits<57>::value);
CHECK_EQUAL(288230376151711743ULL, etl::max_value_for_nbits<58>::value);
CHECK_EQUAL(576460752303423487ULL, etl::max_value_for_nbits<59>::value);
CHECK_EQUAL(1152921504606846975ULL, etl::max_value_for_nbits<60>::value);
CHECK_EQUAL(2305843009213693951ULL, etl::max_value_for_nbits<61>::value);
CHECK_EQUAL(4611686018427387903ULL, etl::max_value_for_nbits<62>::value);
CHECK_EQUAL(9223372036854775807ULL, etl::max_value_for_nbits<63>::value);
CHECK_EQUAL(18446744073709551615ULL, etl::max_value_for_nbits<64>::value);
// Check that the values are correct.
//CHECK_EQUAL(0U, etl::max_value_for_nbits<0>::value);
CHECK_EQUAL(1U, etl::max_value_for_nbits<1>::value);
CHECK_EQUAL(3U, etl::max_value_for_nbits<2>::value);
CHECK_EQUAL(7U, etl::max_value_for_nbits<3>::value);
CHECK_EQUAL(15U, etl::max_value_for_nbits<4>::value);
CHECK_EQUAL(31U, etl::max_value_for_nbits<5>::value);
CHECK_EQUAL(63U, etl::max_value_for_nbits<6>::value);
CHECK_EQUAL(127U, etl::max_value_for_nbits<7>::value);
CHECK_EQUAL(255U, etl::max_value_for_nbits<8>::value);
CHECK_EQUAL(511U, etl::max_value_for_nbits<9>::value);
CHECK_EQUAL(1023U, etl::max_value_for_nbits<10>::value);
CHECK_EQUAL(2047U, etl::max_value_for_nbits<11>::value);
CHECK_EQUAL(4095U, etl::max_value_for_nbits<12>::value);
CHECK_EQUAL(8191U, etl::max_value_for_nbits<13>::value);
CHECK_EQUAL(16383U, etl::max_value_for_nbits<14>::value);
CHECK_EQUAL(32767U, etl::max_value_for_nbits<15>::value);
CHECK_EQUAL(65535U, etl::max_value_for_nbits<16>::value);
CHECK_EQUAL(131071UL, etl::max_value_for_nbits<17>::value);
CHECK_EQUAL(262143UL, etl::max_value_for_nbits<18>::value);
CHECK_EQUAL(524287UL, etl::max_value_for_nbits<19>::value);
CHECK_EQUAL(1048575UL, etl::max_value_for_nbits<20>::value);
CHECK_EQUAL(2097151UL, etl::max_value_for_nbits<21>::value);
CHECK_EQUAL(4194303UL, etl::max_value_for_nbits<22>::value);
CHECK_EQUAL(8388607UL, etl::max_value_for_nbits<23>::value);
CHECK_EQUAL(16777215UL, etl::max_value_for_nbits<24>::value);
CHECK_EQUAL(33554431UL, etl::max_value_for_nbits<25>::value);
CHECK_EQUAL(67108863UL, etl::max_value_for_nbits<26>::value);
CHECK_EQUAL(134217727UL, etl::max_value_for_nbits<27>::value);
CHECK_EQUAL(268435455UL, etl::max_value_for_nbits<28>::value);
CHECK_EQUAL(536870911UL, etl::max_value_for_nbits<29>::value);
CHECK_EQUAL(1073741823UL, etl::max_value_for_nbits<30>::value);
CHECK_EQUAL(2147483647UL, etl::max_value_for_nbits<31>::value);
CHECK_EQUAL(4294967295UL, etl::max_value_for_nbits<32>::value);
CHECK_EQUAL(8589934591ULL, etl::max_value_for_nbits<33>::value);
CHECK_EQUAL(17179869183ULL, etl::max_value_for_nbits<34>::value);
CHECK_EQUAL(34359738367ULL, etl::max_value_for_nbits<35>::value);
CHECK_EQUAL(68719476735ULL, etl::max_value_for_nbits<36>::value);
CHECK_EQUAL(137438953471ULL, etl::max_value_for_nbits<37>::value);
CHECK_EQUAL(274877906943ULL, etl::max_value_for_nbits<38>::value);
CHECK_EQUAL(549755813887ULL, etl::max_value_for_nbits<39>::value);
CHECK_EQUAL(1099511627775ULL, etl::max_value_for_nbits<40>::value);
CHECK_EQUAL(2199023255551ULL, etl::max_value_for_nbits<41>::value);
CHECK_EQUAL(4398046511103ULL, etl::max_value_for_nbits<42>::value);
CHECK_EQUAL(8796093022207ULL, etl::max_value_for_nbits<43>::value);
CHECK_EQUAL(17592186044415ULL, etl::max_value_for_nbits<44>::value);
CHECK_EQUAL(35184372088831ULL, etl::max_value_for_nbits<45>::value);
CHECK_EQUAL(70368744177663ULL, etl::max_value_for_nbits<46>::value);
CHECK_EQUAL(140737488355327ULL, etl::max_value_for_nbits<47>::value);
CHECK_EQUAL(281474976710655ULL, etl::max_value_for_nbits<48>::value);
CHECK_EQUAL(562949953421311ULL, etl::max_value_for_nbits<49>::value);
CHECK_EQUAL(1125899906842623ULL, etl::max_value_for_nbits<50>::value);
CHECK_EQUAL(2251799813685247ULL, etl::max_value_for_nbits<51>::value);
CHECK_EQUAL(4503599627370495ULL, etl::max_value_for_nbits<52>::value);
CHECK_EQUAL(9007199254740991ULL, etl::max_value_for_nbits<53>::value);
CHECK_EQUAL(18014398509481983ULL, etl::max_value_for_nbits<54>::value);
CHECK_EQUAL(36028797018963967ULL, etl::max_value_for_nbits<55>::value);
CHECK_EQUAL(72057594037927935ULL, etl::max_value_for_nbits<56>::value);
CHECK_EQUAL(144115188075855871ULL, etl::max_value_for_nbits<57>::value);
CHECK_EQUAL(288230376151711743ULL, etl::max_value_for_nbits<58>::value);
CHECK_EQUAL(576460752303423487ULL, etl::max_value_for_nbits<59>::value);
CHECK_EQUAL(1152921504606846975ULL, etl::max_value_for_nbits<60>::value);
CHECK_EQUAL(2305843009213693951ULL, etl::max_value_for_nbits<61>::value);
CHECK_EQUAL(4611686018427387903ULL, etl::max_value_for_nbits<62>::value);
CHECK_EQUAL(9223372036854775807ULL, etl::max_value_for_nbits<63>::value);
CHECK_EQUAL(18446744073709551615ULL, etl::max_value_for_nbits<64>::value);
}
// Check that the value types are correct.
CHECK((etl::is_same<uint8_t, etl::max_value_for_nbits<0>::value_type>::value));
CHECK((etl::is_same<uint8_t, etl::max_value_for_nbits<1>::value_type>::value));
CHECK((etl::is_same<uint8_t, etl::max_value_for_nbits<2>::value_type>::value));
CHECK((etl::is_same<uint8_t, etl::max_value_for_nbits<3>::value_type>::value));
CHECK((etl::is_same<uint8_t, etl::max_value_for_nbits<4>::value_type>::value));
CHECK((etl::is_same<uint8_t, etl::max_value_for_nbits<5>::value_type>::value));
CHECK((etl::is_same<uint8_t, etl::max_value_for_nbits<6>::value_type>::value));
CHECK((etl::is_same<uint8_t, etl::max_value_for_nbits<7>::value_type>::value));
CHECK((etl::is_same<uint8_t, etl::max_value_for_nbits<8>::value_type>::value));
CHECK((etl::is_same<uint16_t, etl::max_value_for_nbits<9>::value_type>::value));
CHECK((etl::is_same<uint16_t, etl::max_value_for_nbits<10>::value_type>::value));
CHECK((etl::is_same<uint16_t, etl::max_value_for_nbits<11>::value_type>::value));
CHECK((etl::is_same<uint16_t, etl::max_value_for_nbits<12>::value_type>::value));
CHECK((etl::is_same<uint16_t, etl::max_value_for_nbits<13>::value_type>::value));
CHECK((etl::is_same<uint16_t, etl::max_value_for_nbits<14>::value_type>::value));
CHECK((etl::is_same<uint16_t, etl::max_value_for_nbits<15>::value_type>::value));
CHECK((etl::is_same<uint16_t, etl::max_value_for_nbits<16>::value_type>::value));
CHECK((etl::is_same<uint32_t, etl::max_value_for_nbits<17>::value_type>::value));
CHECK((etl::is_same<uint32_t, etl::max_value_for_nbits<18>::value_type>::value));
CHECK((etl::is_same<uint32_t, etl::max_value_for_nbits<19>::value_type>::value));
CHECK((etl::is_same<uint32_t, etl::max_value_for_nbits<20>::value_type>::value));
CHECK((etl::is_same<uint32_t, etl::max_value_for_nbits<21>::value_type>::value));
CHECK((etl::is_same<uint32_t, etl::max_value_for_nbits<22>::value_type>::value));
CHECK((etl::is_same<uint32_t, etl::max_value_for_nbits<23>::value_type>::value));
CHECK((etl::is_same<uint32_t, etl::max_value_for_nbits<24>::value_type>::value));
CHECK((etl::is_same<uint32_t, etl::max_value_for_nbits<25>::value_type>::value));
CHECK((etl::is_same<uint32_t, etl::max_value_for_nbits<26>::value_type>::value));
CHECK((etl::is_same<uint32_t, etl::max_value_for_nbits<27>::value_type>::value));
CHECK((etl::is_same<uint32_t, etl::max_value_for_nbits<28>::value_type>::value));
CHECK((etl::is_same<uint32_t, etl::max_value_for_nbits<29>::value_type>::value));
CHECK((etl::is_same<uint32_t, etl::max_value_for_nbits<30>::value_type>::value));
CHECK((etl::is_same<uint32_t, etl::max_value_for_nbits<31>::value_type>::value));
CHECK((etl::is_same<uint32_t, etl::max_value_for_nbits<32>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<33>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<34>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<35>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<36>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<37>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<38>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<39>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<40>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<41>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<42>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<43>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<44>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<45>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<46>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<47>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<48>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<49>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<50>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<51>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<52>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<53>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<54>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<55>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<56>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<57>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<58>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<59>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<60>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<61>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<62>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<63>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<64>::value_type>::value));
//*************************************************************************
TEST(test_max_value_for_bits_types)
{
// Check that the value types are correct.
CHECK((etl::is_same<uint8_t, etl::max_value_for_nbits<0>::value_type>::value));
CHECK((etl::is_same<uint8_t, etl::max_value_for_nbits<1>::value_type>::value));
CHECK((etl::is_same<uint8_t, etl::max_value_for_nbits<2>::value_type>::value));
CHECK((etl::is_same<uint8_t, etl::max_value_for_nbits<3>::value_type>::value));
CHECK((etl::is_same<uint8_t, etl::max_value_for_nbits<4>::value_type>::value));
CHECK((etl::is_same<uint8_t, etl::max_value_for_nbits<5>::value_type>::value));
CHECK((etl::is_same<uint8_t, etl::max_value_for_nbits<6>::value_type>::value));
CHECK((etl::is_same<uint8_t, etl::max_value_for_nbits<7>::value_type>::value));
CHECK((etl::is_same<uint8_t, etl::max_value_for_nbits<8>::value_type>::value));
CHECK((etl::is_same<uint16_t, etl::max_value_for_nbits<9>::value_type>::value));
CHECK((etl::is_same<uint16_t, etl::max_value_for_nbits<10>::value_type>::value));
CHECK((etl::is_same<uint16_t, etl::max_value_for_nbits<11>::value_type>::value));
CHECK((etl::is_same<uint16_t, etl::max_value_for_nbits<12>::value_type>::value));
CHECK((etl::is_same<uint16_t, etl::max_value_for_nbits<13>::value_type>::value));
CHECK((etl::is_same<uint16_t, etl::max_value_for_nbits<14>::value_type>::value));
CHECK((etl::is_same<uint16_t, etl::max_value_for_nbits<15>::value_type>::value));
CHECK((etl::is_same<uint16_t, etl::max_value_for_nbits<16>::value_type>::value));
CHECK((etl::is_same<uint32_t, etl::max_value_for_nbits<17>::value_type>::value));
CHECK((etl::is_same<uint32_t, etl::max_value_for_nbits<18>::value_type>::value));
CHECK((etl::is_same<uint32_t, etl::max_value_for_nbits<19>::value_type>::value));
CHECK((etl::is_same<uint32_t, etl::max_value_for_nbits<20>::value_type>::value));
CHECK((etl::is_same<uint32_t, etl::max_value_for_nbits<21>::value_type>::value));
CHECK((etl::is_same<uint32_t, etl::max_value_for_nbits<22>::value_type>::value));
CHECK((etl::is_same<uint32_t, etl::max_value_for_nbits<23>::value_type>::value));
CHECK((etl::is_same<uint32_t, etl::max_value_for_nbits<24>::value_type>::value));
CHECK((etl::is_same<uint32_t, etl::max_value_for_nbits<25>::value_type>::value));
CHECK((etl::is_same<uint32_t, etl::max_value_for_nbits<26>::value_type>::value));
CHECK((etl::is_same<uint32_t, etl::max_value_for_nbits<27>::value_type>::value));
CHECK((etl::is_same<uint32_t, etl::max_value_for_nbits<28>::value_type>::value));
CHECK((etl::is_same<uint32_t, etl::max_value_for_nbits<29>::value_type>::value));
CHECK((etl::is_same<uint32_t, etl::max_value_for_nbits<30>::value_type>::value));
CHECK((etl::is_same<uint32_t, etl::max_value_for_nbits<31>::value_type>::value));
CHECK((etl::is_same<uint32_t, etl::max_value_for_nbits<32>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<33>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<34>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<35>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<36>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<37>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<38>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<39>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<40>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<41>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<42>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<43>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<44>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<45>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<46>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<47>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<48>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<49>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<50>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<51>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<52>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<53>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<54>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<55>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<56>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<57>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<58>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<59>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<60>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<61>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<62>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<63>::value_type>::value));
CHECK((etl::is_same<uint64_t, etl::max_value_for_nbits<64>::value_type>::value));
}
//*************************************************************************
@ -1822,6 +1897,453 @@ namespace
CHECK(!etl::is_even(1));
CHECK(etl::is_even(2));
}
//*************************************************************************
TEST(test_count_trailing_zeros_8)
{
for (size_t i = 0; i < 256; ++i)
{
uint8_t value = uint8_t(i);
CHECK_EQUAL(int(test_trailing_zeros(value)), int(etl::count_trailing_zeros(value)));
if (test_trailing_zeros(value) != etl::count_trailing_zeros(value))
{
break;
}
}
}
#if !defined(ETL_FORCE_NO_ADVANCED_CPP)
//*************************************************************************
TEST(test_count_trailing_zeros_8_constexpr)
{
char temp[etl::count_trailing_zeros(uint8_t(0x08))];
CHECK_EQUAL(test_trailing_zeros(uint8_t(0x08)), sizeof(temp));
}
#endif
//*************************************************************************
TEST(test_count_trailing_zeros_16)
{
for (size_t i = 0; i < 65536; ++i)
{
uint16_t value = uint16_t(i);
CHECK_EQUAL(test_trailing_zeros(value), etl::count_trailing_zeros(value));
if (test_trailing_zeros(value) != etl::count_trailing_zeros(value))
{
break;
}
}
}
#if !defined(ETL_FORCE_NO_ADVANCED_CPP)
//*************************************************************************
TEST(test_count_trailing_zeros_16_constexpr)
{
char temp[etl::count_trailing_zeros(uint16_t(0x08))];
CHECK_EQUAL(test_trailing_zeros(uint16_t(0x08)), sizeof(temp));
}
#endif
//*************************************************************************
TEST(test_count_trailing_zeros_32)
{
etl::fnv_1a_32 hash;
for (size_t i = 0UL; i < 100000UL; ++i)
{
hash.add(1);
uint32_t value = hash.value();
CHECK_EQUAL(test_trailing_zeros(value), etl::count_trailing_zeros(value));
if (test_trailing_zeros(value) != etl::count_trailing_zeros(value))
{
break;
}
}
}
#if !defined(ETL_FORCE_NO_ADVANCED_CPP)
//*************************************************************************
TEST(test_count_trailing_zeros_32_constexpr)
{
char temp[etl::count_trailing_zeros(uint32_t(0x08))];
CHECK_EQUAL(test_trailing_zeros(uint32_t(0x08)), sizeof(temp));
}
#endif
//*************************************************************************
TEST(test_count_trailing_zeros_64)
{
etl::fnv_1a_64 hash;
for (size_t i = 0UL; i < 100000UL; ++i)
{
hash.add(1);
uint64_t value = hash.value();
CHECK_EQUAL(test_trailing_zeros(value), etl::count_trailing_zeros(value));
if (test_trailing_zeros(value) != etl::count_trailing_zeros(value))
{
break;
}
}
}
#if !defined(ETL_FORCE_NO_ADVANCED_CPP)
//*************************************************************************
TEST(test_count_trailing_zeros_64_constexpr)
{
char temp[etl::count_trailing_zeros(uint64_t(0x08))];
CHECK_EQUAL(etl::count_trailing_zeros(uint64_t(0x08)), sizeof(temp));
}
#endif
//*************************************************************************
TEST(test_count_trailing_ones_8)
{
for (size_t i = 0; i < 256; ++i)
{
uint8_t value = uint8_t(i);
CHECK_EQUAL(int(test_trailing_ones(value)), int(etl::count_trailing_ones(value)));
if (test_trailing_ones(value) != etl::count_trailing_ones(value))
{
break;
}
}
}
#if !defined(ETL_FORCE_NO_ADVANCED_CPP)
//*************************************************************************
TEST(test_count_trailing_ones_8_constexpr)
{
char temp[etl::count_trailing_ones(uint8_t(0x0F))];
CHECK_EQUAL(test_trailing_ones(uint8_t(0x0F)), sizeof(temp));
}
#endif
//*************************************************************************
TEST(test_count_trailing_ones_16)
{
for (size_t i = 0; i < 65536; ++i)
{
uint16_t value = uint16_t(i);
CHECK_EQUAL(int(test_trailing_ones(value)), int(etl::count_trailing_ones(value)));
if (test_trailing_ones(value) != etl::count_trailing_ones(value))
{
break;
}
}
}
#if !defined(ETL_FORCE_NO_ADVANCED_CPP)
//*************************************************************************
TEST(test_count_trailing_ones_16_constexpr)
{
char temp[etl::count_trailing_ones(uint16_t(0x000F))];
CHECK_EQUAL(test_trailing_ones(uint16_t(0x000F)), sizeof(temp));
}
#endif
//*************************************************************************
TEST(test_count_trailing_ones_32)
{
etl::fnv_1a_32 hash;
for (size_t i = 0UL; i < 100000UL; ++i)
{
hash.add(1);
uint32_t value = hash.value();
CHECK_EQUAL(test_trailing_ones(value), etl::count_trailing_ones(value));
if (test_trailing_ones(value) != etl::count_trailing_ones(value))
{
break;
}
}
}
#if !defined(ETL_FORCE_NO_ADVANCED_CPP)
//*************************************************************************
TEST(test_count_trailing_ones_32_constexpr)
{
char temp[etl::count_trailing_ones(uint32_t(0x0000000F))];
CHECK_EQUAL(test_trailing_ones(uint32_t(0x0000000F)), sizeof(temp));
}
#endif
//*************************************************************************
TEST(test_count_trailing_ones_64)
{
etl::fnv_1a_64 hash;
for (size_t i = 0UL; i < 100000UL; ++i)
{
hash.add(1);
uint64_t value = hash.value();
CHECK_EQUAL(test_trailing_ones(value), etl::count_trailing_ones(value));
if (test_trailing_ones(value) != etl::count_trailing_ones(value))
{
break;
}
}
}
#if !defined(ETL_FORCE_NO_ADVANCED_CPP)
//*************************************************************************
TEST(test_count_trailing_ones_64_constexpr)
{
char temp[etl::count_trailing_ones(uint64_t(0x000000000000000F))];
CHECK_EQUAL(test_trailing_ones(uint64_t(0x000000000000000F)), sizeof(temp));
}
#endif
//*************************************************************************
TEST(test_count_leading_zeros_8)
{
for (size_t i = 0; i < 256; ++i)
{
uint8_t value = uint8_t(i);
CHECK_EQUAL(int(test_leading_zeros(value)), int(etl::count_leading_zeros(value)));
if (test_leading_zeros(value) != etl::count_leading_zeros(value))
{
break;
}
}
}
#if !defined(ETL_FORCE_NO_ADVANCED_CPP)
//*************************************************************************
TEST(test_count_leading_zeros_8_constexpr)
{
char temp[etl::count_leading_zeros(uint8_t(0x01U))];
CHECK_EQUAL(test_leading_zeros(uint8_t(0x01U)), sizeof(temp));
}
#endif
//*************************************************************************
TEST(test_count_leading_zeros_16)
{
for (size_t i = 0; i < 65536; ++i)
{
uint16_t value = uint16_t(i);
CHECK_EQUAL(int(test_leading_zeros(value)), int(etl::count_leading_zeros(value)));
if (test_leading_zeros(value) != etl::count_leading_zeros(value))
{
break;
}
}
}
#if !defined(ETL_FORCE_NO_ADVANCED_CPP)
//*************************************************************************
TEST(test_count_leading_zeros_16_constexpr)
{
char temp[etl::count_leading_zeros(uint16_t(0x0800U))];
CHECK_EQUAL(test_leading_zeros(uint16_t(0x0800U)), sizeof(temp));
}
#endif
//*************************************************************************
TEST(test_count_leading_zeros_32)
{
etl::fnv_1a_32 hash;
for (size_t i = 0; i < 100000; ++i)
{
hash.add(1);
uint32_t value = hash.value();
CHECK_EQUAL(int(test_leading_zeros(value)), int(etl::count_leading_zeros(value)));
if (test_leading_zeros(value) != etl::count_leading_zeros(value))
{
break;
}
}
}
#if !defined(ETL_FORCE_NO_ADVANCED_CPP)
//*************************************************************************
TEST(test_count_leading_zeros_32_constexpr)
{
char temp[etl::count_leading_zeros(uint32_t(0x08000000U))];
CHECK_EQUAL(test_leading_zeros(uint32_t(0x08000000U)), sizeof(temp));
}
#endif
//*************************************************************************
TEST(test_count_leading_zeros_64)
{
etl::fnv_1a_64 hash;
for (size_t i = 0; i < 100000; ++i)
{
hash.add(1);
uint64_t value = hash.value();
CHECK_EQUAL(int(test_leading_zeros(value)), int(etl::count_leading_zeros(value)));
if (test_leading_zeros(value) != etl::count_leading_zeros(value))
{
break;
}
}
}
#if !defined(ETL_FORCE_NO_ADVANCED_CPP)
//*************************************************************************
TEST(test_count_leading_zeros_64_constexpr)
{
char temp[etl::count_leading_zeros(uint64_t(0x0800000000000000U))];
CHECK_EQUAL(test_leading_zeros(uint64_t(0x0800000000000000U)), sizeof(temp));
}
#endif
//*************************************************************************
TEST(test_count_leading_ones_8)
{
for (size_t i = 0; i < 256; ++i)
{
uint8_t value = uint8_t(i);
CHECK_EQUAL(int(test_leading_ones(value)), int(etl::count_leading_ones(value)));
if (test_leading_ones(value) != etl::count_leading_ones(value))
{
break;
}
}
}
#if !defined(ETL_FORCE_NO_ADVANCED_CPP)
//*************************************************************************
TEST(test_count_leading_ones_8_constexpr)
{
char temp[etl::count_leading_ones(uint8_t(0xF0U))];
CHECK_EQUAL(test_leading_ones(uint8_t(0xF0U)), sizeof(temp));
}
#endif
//*************************************************************************
TEST(test_count_leading_ones_16)
{
for (size_t i = 0; i < 65536; ++i)
{
uint16_t value = uint16_t(i);
CHECK_EQUAL(int(test_leading_ones(value)), int(etl::count_leading_ones(value)));
if (test_leading_ones(value) != etl::count_leading_ones(value))
{
break;
}
}
}
#if !defined(ETL_FORCE_NO_ADVANCED_CPP)
//*************************************************************************
TEST(test_count_leading_ones_16_constexpr)
{
char temp[etl::count_leading_ones(uint16_t(0xF000U))];
CHECK_EQUAL(test_leading_ones(uint16_t(0xF000U)), sizeof(temp));
}
#endif
//*************************************************************************
TEST(test_count_leading_ones_32)
{
etl::fnv_1a_32 hash;
for (size_t i = 0; i < 100000; ++i)
{
hash.add(1);
uint32_t value = hash.value();
CHECK_EQUAL(int(test_leading_ones(value)), int(etl::count_leading_ones(value)));
if (test_leading_ones(value) != etl::count_leading_ones(value))
{
break;
}
}
}
#if !defined(ETL_FORCE_NO_ADVANCED_CPP)
//*************************************************************************
TEST(test_count_leading_ones_32_constexpr)
{
char temp[etl::count_leading_ones(uint32_t(0xF0000000UL))];
CHECK_EQUAL(test_leading_ones(uint32_t(0xF0000000UL)), sizeof(temp));
}
#endif
//*************************************************************************
TEST(test_count_leading_ones_64)
{
etl::fnv_1a_64 hash;
for (size_t i = 0; i < 100000; ++i)
{
hash.add(1);
uint64_t value = hash.value();
CHECK_EQUAL(int(test_leading_ones(value)), int(etl::count_leading_ones(value)));
if (test_leading_ones(value) != etl::count_leading_ones(value))
{
break;
}
}
}
#if !defined(ETL_FORCE_NO_ADVANCED_CPP)
//*************************************************************************
TEST(test_count_leading_ones_64_constexpr)
{
char temp[etl::count_leading_ones(uint64_t(0xF000000000000000UL))];
CHECK_EQUAL(test_leading_ones(uint64_t(0xF000000000000000UL)), sizeof(temp));
}
#endif
};
}

1493
test/test_bit.cpp Normal file

File diff suppressed because it is too large Load Diff

View File

@ -33,6 +33,8 @@ SOFTWARE.
#if !defined(ETL_CRC_FORCE_CPP03_IMPLEMENTATION)
#include <functional>
namespace
{
//*****************************************************************************
@ -1103,6 +1105,19 @@ namespace
CHECK(!function_called);
CHECK(!parameter_correct);
}
//*************************************************************************
TEST_FIXTURE(SetupFixture, test_construct_from_std_function_from_free_int)
{
std::function<void(int, int)> std_function(free_int);
etl::delegate<void(int, int)> d(std_function);
d(VALUE1, VALUE2);
CHECK(function_called);
CHECK(parameter_correct);
}
};
}

View File

@ -29,9 +29,15 @@ SOFTWARE.
#include "unit_test_framework.h"
#include "etl/numeric.h"
#include "etl/deque.h"
#include "etl/list.h"
#include <algorithm>
#include <numeric>
#include <vector>
#include <deque>
#include <list>
#include <array>
namespace
{
@ -49,5 +55,153 @@ namespace
CHECK(are_same);
}
//*************************************************************************
TEST(test_midpoint_signed_integral)
{
CHECK_EQUAL(int32_t(0), (etl::midpoint(int32_t(0), int32_t(0))));
CHECK_EQUAL(int32_t(0), (etl::midpoint(int32_t(0), int32_t(1))));
CHECK_EQUAL(int32_t(1), (etl::midpoint(int32_t(1), int32_t(0))));
CHECK_EQUAL(std::numeric_limits<int32_t>::max() / 2, (etl::midpoint(0, std::numeric_limits<int32_t>::max())));
CHECK_EQUAL((std::numeric_limits<int32_t>::max() / 2) + 1, (etl::midpoint(std::numeric_limits<int32_t>::max(), 0)));
CHECK_EQUAL(int32_t(-1), (etl::midpoint(std::numeric_limits<int32_t>::min(), std::numeric_limits<int32_t>::max())));
CHECK_EQUAL(int32_t(0), (etl::midpoint(std::numeric_limits<int32_t>::max(), std::numeric_limits<int32_t>::min())));
}
//*************************************************************************
TEST(test_midpoint_unsigned_integral)
{
CHECK_EQUAL(uint32_t(0), (etl::midpoint(uint32_t(0), uint32_t(0))));
CHECK_EQUAL(uint32_t(0), (etl::midpoint(uint32_t(0), uint32_t(1))));
CHECK_EQUAL(uint32_t(1), (etl::midpoint(uint32_t(1), uint32_t(0))));
CHECK_EQUAL((std::numeric_limits<uint32_t>::max() / 2U), (etl::midpoint(std::numeric_limits<uint32_t>::min(), std::numeric_limits<uint32_t>::max())));
CHECK_EQUAL((std::numeric_limits<uint32_t>::max() / 2U) + 1, (etl::midpoint(std::numeric_limits<uint32_t>::max(), std::numeric_limits<uint32_t>::min())));
}
//*************************************************************************
TEST(test_midpoint_floating_point)
{
CHECK_CLOSE(0.0, (etl::midpoint(0.0, 0.0)), 0.001);
CHECK_CLOSE(0.5, (etl::midpoint(0.0, 1.0)), 0.001);
CHECK_CLOSE(0.5, (etl::midpoint(1.0, 0.0)), 0.001);
CHECK_CLOSE(0.0, (etl::midpoint(-std::numeric_limits<double>::max(), std::numeric_limits<double>::max())), 0.001);
CHECK_CLOSE(0.0, (etl::midpoint(std::numeric_limits<double>::max(), -std::numeric_limits<double>::max())), 0.001);
}
//*************************************************************************
TEST(test_midpoint_pointer)
{
std::vector<int> data = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
CHECK_EQUAL(data[5], (*etl::midpoint(data.data(), data.data() + data.size())));
CHECK_EQUAL(data[5], (*etl::midpoint(data.data() + data.size(), data.data())));
}
//*************************************************************************
TEST(test_midpoint_etl_random_access_iterator)
{
std::array<int, 10> initial = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
etl::deque<int, 10> data(initial.begin(), initial.end());
etl::deque<int, 10>::iterator b = data.begin();
etl::deque<int, 10>::iterator e = data.end();
CHECK_EQUAL(data[5], (*etl::midpoint(b, e)));
CHECK_EQUAL(data[5], (*etl::midpoint(e, b)));
}
//*************************************************************************
TEST(test_midpoint_etl_bidirectional_iterator)
{
std::array<int, 10> initial = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
etl::list<int, 10> data(initial.begin(), initial.end());
etl::list<int, 10>::iterator b = data.begin();
etl::list<int, 10>::iterator e = data.end();
etl::list<int, 10>::iterator c = data.begin();
etl::advance(c, 5);
int v = *etl::midpoint(b, e);
CHECK_EQUAL(*c, v);
}
#if ETL_USING_STL
//*************************************************************************
TEST(test_midpoint_std_random_access_iterator)
{
std::deque<int> data = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
std::deque<int>::iterator b = data.begin();
std::deque<int>::iterator e = data.end();
CHECK_EQUAL(data[5], (*etl::midpoint(b, e)));
CHECK_EQUAL(data[5], (*etl::midpoint(e, b)));
}
//*************************************************************************
TEST(test_midpoint_std_bidirectional_iterator)
{
std::list<int> data = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
std::list<int>::iterator b = data.begin();
std::list<int>::iterator e = data.end();
std::list<int>::iterator c = data.begin();
std::advance(c, 5);
int v = *etl::midpoint(b, e);
CHECK_EQUAL(*c, v);
}
#endif
//*************************************************************************
TEST(test_lerp_floating_point)
{
CHECK_CLOSE(-10.0, etl::lerp(-10.0, 10.0, 0.0), 0.001);
CHECK_CLOSE( -8.0, etl::lerp(-10.0, 10.0, 0.1), 0.001);
CHECK_CLOSE( -6.0, etl::lerp(-10.0, 10.0, 0.2), 0.001);
CHECK_CLOSE( -4.0, etl::lerp(-10.0, 10.0, 0.3), 0.001);
CHECK_CLOSE( -2.0, etl::lerp(-10.0, 10.0, 0.4), 0.001);
CHECK_CLOSE( 0.0, etl::lerp(-10.0, 10.0, 0.5), 0.001);
CHECK_CLOSE( 2.0, etl::lerp(-10.0, 10.0, 0.6), 0.001);
CHECK_CLOSE( 4.0, etl::lerp(-10.0, 10.0, 0.7), 0.001);
CHECK_CLOSE( 6.0, etl::lerp(-10.0, 10.0, 0.8), 0.001);
CHECK_CLOSE( 8.0, etl::lerp(-10.0, 10.0, 0.9), 0.001);
CHECK_CLOSE( 10.0, etl::lerp(-10.0, 10.0, 1.0), 0.001);
// Equal a & b
CHECK_CLOSE(10.0, etl::lerp(10.0, 10.0, 1.0), 0.001);
}
//*************************************************************************
TEST(test_lerp_at_least_one_integral)
{
CHECK_CLOSE(-10.0, etl::lerp(-10.0, 10.0, 0), 0.001);
CHECK_CLOSE( -8.0, etl::lerp(-10, 10.0, 0.1), 0.001);
CHECK_CLOSE( -6.0, etl::lerp(-10.0, 10, 0.2), 0.001);
CHECK_CLOSE( -4.0, etl::lerp(-10, 10, 0.3), 0.001);
CHECK_CLOSE( -2.0, etl::lerp(-10, 10.0, 0.4), 0.001);
CHECK_CLOSE( 0.0, etl::lerp(-10.0, 10, 0.5), 0.001);
CHECK_CLOSE( 2.0, etl::lerp(-10, 10, 0.6), 0.001);
CHECK_CLOSE( 4.0, etl::lerp(-10, 10.0, 0.7), 0.001);
CHECK_CLOSE( 6.0, etl::lerp(-10.0, 10, 0.8), 0.001);
CHECK_CLOSE( 8.0, etl::lerp(-10, 10, 0.9), 0.001);
CHECK_CLOSE( 10.0, etl::lerp(-10.0, 10.0, 1), 0.001);
// Equal a & b
CHECK_CLOSE(10.0, etl::lerp(10.0, 10.0, 1.0), 0.001);
CHECK_CLOSE(10.0, etl::lerp(10, 10.0, 1.0), 0.001);
CHECK_CLOSE(10.0, etl::lerp(10.0, 10, 1.0), 0.001);
CHECK_CLOSE(10.0, etl::lerp(10.0, 10.0, 1), 0.001);
CHECK_CLOSE(10.0, etl::lerp(10, 10, 1), 0.001);
}
};
}

View File

@ -68,7 +68,7 @@ namespace etl
{
for (auto c : str)
{
os << c;
os << uint16_t(c);
}
return os;

View File

@ -68,7 +68,7 @@ namespace etl
{
for (auto c : str)
{
os << c;
os << uint32_t(c);
}
return os;

View File

@ -68,7 +68,7 @@ namespace etl
{
for (auto c : str)
{
os << c;
os << uint16_t(c);
}
return os;

View File

@ -46,6 +46,22 @@ namespace
((result1 > 0) && (result2 > 0));
}
//***********************************
std::ostream& operator << (std::ostream& os, const etl::iu16string::value_type& c)
{
os << uint16_t(c);
return os;
}
//***********************************
std::ostream& operator << (std::ostream& os, const etl::iu16string::value_type* c)
{
os << (void*)c;
return os;
}
SUITE(test_string_char)
{
static const size_t SIZE = 11;

View File

@ -47,6 +47,22 @@ namespace
((result1 > 0) && (result2 > 0));
}
//***********************************
std::ostream& operator << (std::ostream& os, const etl::iu16string::value_type& c)
{
os << uint16_t(c);
return os;
}
//***********************************
std::ostream& operator << (std::ostream& os, const etl::iu16string::value_type* c)
{
os << (void*)c;
return os;
}
SUITE(test_string_char)
{
static constexpr size_t SIZE = 11;

View File

@ -46,6 +46,22 @@ namespace
((result1 > 0) && (result2 > 0));
}
//***********************************
std::ostream& operator << (std::ostream& os, const etl::iu32string::value_type& c)
{
os << uint32_t(c);
return os;
}
//***********************************
std::ostream& operator << (std::ostream& os, const etl::iu32string::value_type* c)
{
os << (void*)c;
return os;
}
SUITE(test_string_char)
{
static const size_t SIZE = 11;

View File

@ -47,6 +47,22 @@ namespace
((result1 > 0) && (result2 > 0));
}
//***********************************
std::ostream& operator << (std::ostream& os, const etl::u32string_ext::value_type& c)
{
os << uint32_t(c);
return os;
}
//***********************************
std::ostream& operator << (std::ostream& os, const etl::u32string_ext::value_type* c)
{
os << (void*)c;
return os;
}
SUITE(test_string_char)
{
static constexpr size_t SIZE = 11;

View File

@ -40,6 +40,14 @@ SOFTWARE.
namespace
{
//***********************************
std::ostream& operator << (std::ostream& os, const std::wstring::value_type& c)
{
os << uint16_t(c);
return os;
}
SUITE(test_string_utilities_std_u16)
{
using String = std::wstring;

View File

@ -40,6 +40,14 @@ SOFTWARE.
namespace
{
//***********************************
std::ostream& operator << (std::ostream& os, const std::u32string::value_type& c)
{
os << uint32_t(c);
return os;
}
SUITE(test_string_utilities_std_u32)
{
using String = std::u32string;

View File

@ -40,6 +40,14 @@ SOFTWARE.
namespace
{
//***********************************
std::ostream& operator << (std::ostream& os, const std::wstring::value_type& c)
{
os << uint16_t(c);
return os;
}
SUITE(test_string_utilities_std_wchar_t)
{
using String = std::wstring;

View File

@ -38,6 +38,14 @@ SOFTWARE.
namespace
{
//***********************************
std::ostream& operator << (std::ostream& os, const std::u16string::value_type& c)
{
os << uint16_t(c);
return os;
}
SUITE(test_string_utilities_u16)
{
static const size_t SIZE = 50;

View File

@ -38,6 +38,14 @@ SOFTWARE.
namespace
{
//***********************************
std::ostream& operator << (std::ostream& os, const etl::iu32string::value_type& c)
{
os << uint32_t(c);
return os;
}
SUITE(test_string_utilities_u32)
{
static const size_t SIZE = 50;

View File

@ -38,11 +38,19 @@ SOFTWARE.
namespace
{
//***********************************
std::ostream& operator << (std::ostream& os, const std::wstring::value_type& c)
{
os << uint16_t(c);
return os;
}
SUITE(test_string_utilities_wchar_t)
{
static const size_t SIZE = 50;
using String = etl::wstring<SIZE>;
using String = etl::wstring<SIZE>;
using IString = etl::iwstring;
using StringView = etl::wstring_view;
using Char = etl::iwstring::value_type;

View File

@ -46,6 +46,22 @@ namespace
((result1 > 0) && (result2 > 0));
}
//***********************************
std::ostream& operator << (std::ostream& os, const etl::iwstring::value_type& c)
{
os << uint16_t(c);
return os;
}
//***********************************
std::ostream& operator << (std::ostream& os, const etl::iwstring::value_type* c)
{
os << (void*)c;
return os;
}
SUITE(test_string_wchar_t)
{
static const size_t SIZE = 11;
@ -581,7 +597,6 @@ namespace
CHECK_EQUAL(&constText[0], constText.begin());
}
//*************************************************************************
TEST_FIXTURE(SetupFixture, test_end)
{

View File

@ -47,6 +47,22 @@ namespace
((result1 > 0) && (result2 > 0));
}
//***********************************
std::ostream& operator << (std::ostream& os, const etl::iwstring::value_type& c)
{
os << uint16_t(c);
return os;
}
//***********************************
std::ostream& operator << (std::ostream& os, const etl::iwstring::value_type* c)
{
os << (void*)c;
return os;
}
SUITE(test_string_char)
{
static constexpr size_t SIZE = 11;

View File

@ -29,6 +29,10 @@ Global
Debug MSVC - String Truncation Is Error|x64 = Debug MSVC - String Truncation Is Error|x64
Debug MSVC 64|Win32 = Debug MSVC 64|Win32
Debug MSVC 64|x64 = Debug MSVC 64|x64
Debug MSVC C++20 - No STL|Win32 = Debug MSVC C++20 - No STL|Win32
Debug MSVC C++20 - No STL|x64 = Debug MSVC C++20 - No STL|x64
Debug MSVC C++20|Win32 = Debug MSVC C++20|Win32
Debug MSVC C++20|x64 = Debug MSVC C++20|x64
Debug MSVC No Checks|Win32 = Debug MSVC No Checks|Win32
Debug MSVC No Checks|x64 = Debug MSVC No Checks|x64
Debug MSVC|Win32 = Debug MSVC|Win32
@ -85,6 +89,14 @@ Global
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug MSVC 64|Win32.Build.0 = Debug No Unit Tests|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
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug MSVC C++20 - No STL|Win32.Build.0 = Debug MSVC C++20 - No STL|Win32
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug MSVC C++20 - No STL|x64.ActiveCfg = Debug MSVC C++20 - No STL|x64
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug MSVC C++20 - No STL|x64.Build.0 = Debug MSVC C++20 - No STL|x64
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug MSVC C++20|Win32.ActiveCfg = Debug MSVC C++20|Win32
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug MSVC C++20|Win32.Build.0 = Debug MSVC C++20|Win32
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug MSVC C++20|x64.ActiveCfg = Debug MSVC C++20|x64
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug MSVC C++20|x64.Build.0 = Debug MSVC C++20|x64
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug MSVC No Checks|Win32.ActiveCfg = Debug MSVC No Checks|Win32
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug MSVC No Checks|Win32.Build.0 = Debug MSVC No Checks|Win32
{C21DF78C-D8E0-46AB-9D6F-D38A3C1CB0FB}.Debug MSVC No Checks|x64.ActiveCfg = Debug MSVC No Checks|x64

File diff suppressed because it is too large Load Diff

View File

@ -1173,6 +1173,9 @@
<ClInclude Include="..\..\include\etl\message_timer_locked.h">
<Filter>ETL\Frameworks</Filter>
</ClInclude>
<ClInclude Include="..\..\include\etl\bit.h">
<Filter>ETL\Utilities</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\main.cpp">
@ -3083,6 +3086,15 @@
<ClCompile Include="..\test_delegate_service_cpp03.cpp">
<Filter>Tests</Filter>
</ClCompile>
<ClCompile Include="..\test_bit.cpp">
<Filter>Tests</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\bit.h.t.cpp">
<Filter>Tests\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\sanity-check\unaligned_type.h.t.cpp">
<Filter>Tests\Sanity Checks</Filter>
</ClCompile>
<ClCompile Include="..\test_unaligned_type.cpp">
<Filter>Tests</Filter>
</ClCompile>
@ -3233,4 +3245,4 @@
<Filter>Resource Files</Filter>
</Natvis>
</ItemGroup>
</Project>
</Project>