mirror of
https://github.com/ETLCPP/etl.git
synced 2026-04-30 19:09:10 +08:00
Eradicated all GCC and clang warnings
This commit is contained in:
parent
c9c928b8bb
commit
cd18cc6af0
@ -41,10 +41,6 @@ SOFTWARE.
|
||||
|
||||
// Select the amtomic builtins based on the version of the GCC compiler.
|
||||
#if defined(ETL_COMPILER_GCC)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#pragma GCC diagnostic ignored "-Wunused-value"
|
||||
|
||||
#if ETL_COMPILER_FULL_VERSION >= 40700
|
||||
#define ETL_USE_ATOMIC_BUILTINS
|
||||
#else
|
||||
@ -68,7 +64,6 @@ namespace etl
|
||||
#define ETL_BUILTIN_LOCK while (__atomic_test_and_set(&flag, etl::memory_order_seq_cst)) {}
|
||||
#define ETL_BUILTIN_UNLOCK __atomic_clear(&flag, etl::memory_order_seq_cst);
|
||||
|
||||
|
||||
//***************************************************************************
|
||||
// Atomic type for pre C++11 GCC compilers that support the builtin '__atomic' functions.
|
||||
// Only integral and pointer types are supported.
|
||||
@ -849,6 +844,7 @@ namespace etl
|
||||
// Store
|
||||
void store(T v, etl::memory_order order = etl::memory_order_seq_cst)
|
||||
{
|
||||
(void)order;
|
||||
ETL_BUILTIN_LOCK;
|
||||
value = v;
|
||||
ETL_BUILTIN_UNLOCK;
|
||||
@ -856,6 +852,7 @@ namespace etl
|
||||
|
||||
void store(T v, etl::memory_order order = etl::memory_order_seq_cst) volatile
|
||||
{
|
||||
(void)order;
|
||||
ETL_BUILTIN_LOCK;
|
||||
value = v;
|
||||
ETL_BUILTIN_UNLOCK;
|
||||
@ -864,6 +861,7 @@ namespace etl
|
||||
// Load
|
||||
T load(etl::memory_order order = etl::memory_order_seq_cst) const volatile
|
||||
{
|
||||
(void)order;
|
||||
ETL_BUILTIN_LOCK;
|
||||
T result = value;
|
||||
ETL_BUILTIN_UNLOCK;
|
||||
@ -874,6 +872,7 @@ namespace etl
|
||||
// Load
|
||||
T load(etl::memory_order order = etl::memory_order_seq_cst) const
|
||||
{
|
||||
(void)order;
|
||||
ETL_BUILTIN_LOCK;
|
||||
T result = value;
|
||||
ETL_BUILTIN_UNLOCK;
|
||||
@ -884,6 +883,7 @@ namespace etl
|
||||
// Exchange
|
||||
T exchange(T v, etl::memory_order order = etl::memory_order_seq_cst)
|
||||
{
|
||||
(void)order;
|
||||
ETL_BUILTIN_LOCK;
|
||||
T result = value;
|
||||
value = v;
|
||||
@ -894,6 +894,7 @@ namespace etl
|
||||
|
||||
T exchange(T v, etl::memory_order order = etl::memory_order_seq_cst) volatile
|
||||
{
|
||||
(void)order;
|
||||
ETL_BUILTIN_LOCK;
|
||||
T result = value;
|
||||
value = v;
|
||||
@ -907,6 +908,7 @@ namespace etl
|
||||
{
|
||||
bool result;
|
||||
|
||||
(void)order;
|
||||
ETL_BUILTIN_LOCK;
|
||||
if (memcmp(&value, &expected, sizeof(T)) == 0)
|
||||
{
|
||||
@ -926,6 +928,7 @@ namespace etl
|
||||
{
|
||||
bool result;
|
||||
|
||||
(void)order;
|
||||
ETL_BUILTIN_LOCK;
|
||||
if (memcmp(&value, &expected, sizeof(T)) == 0)
|
||||
{
|
||||
@ -943,32 +946,42 @@ namespace etl
|
||||
|
||||
bool compare_exchange_weak(T& expected, T desired, etl::memory_order success, etl::memory_order failure)
|
||||
{
|
||||
(void)success;
|
||||
(void)failure;
|
||||
return compare_exchange_weak(expected, desired);
|
||||
}
|
||||
|
||||
bool compare_exchange_weak(T& expected, T desired, etl::memory_order success, etl::memory_order failure) volatile
|
||||
{
|
||||
(void)success;
|
||||
(void)failure;
|
||||
return compare_exchange_weak(expected, desired);
|
||||
}
|
||||
|
||||
// Compare exchange strong
|
||||
bool compare_exchange_strong(T& expected, T desired, etl::memory_order order = etl::memory_order_seq_cst)
|
||||
{
|
||||
(void)order;
|
||||
return compare_exchange_weak(expected, desired);
|
||||
}
|
||||
|
||||
bool compare_exchange_strong(T& expected, T desired, etl::memory_order order = etl::memory_order_seq_cst) volatile
|
||||
{
|
||||
(void)order;
|
||||
return compare_exchange_weak(expected, desired);
|
||||
}
|
||||
|
||||
bool compare_exchange_strong(T& expected, T desired, etl::memory_order success, etl::memory_order failure)
|
||||
{
|
||||
(void)success;
|
||||
(void)failure;
|
||||
return compare_exchange_weak(expected, desired);
|
||||
}
|
||||
|
||||
bool compare_exchange_strong(T& expected, T desired, etl::memory_order success, etl::memory_order failure) volatile
|
||||
{
|
||||
(void)success;
|
||||
(void)failure;
|
||||
return compare_exchange_weak(expected, desired);
|
||||
}
|
||||
|
||||
@ -2206,8 +2219,4 @@ namespace etl
|
||||
typedef etl::atomic<uintmax_t> atomic_uintmax_t;
|
||||
}
|
||||
|
||||
#if defined(ETL_COMPILER_GCC)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@ -53,11 +53,6 @@ SOFTWARE.
|
||||
#include "binary.h"
|
||||
#include "flags.h"
|
||||
|
||||
#ifdef ETL_COMPILER_GCC
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-variable"
|
||||
#endif
|
||||
|
||||
#include "private/minmax_push.h"
|
||||
|
||||
//*****************************************************************************
|
||||
@ -2630,8 +2625,4 @@ namespace etl
|
||||
|
||||
#include "private/minmax_pop.h"
|
||||
|
||||
#ifdef ETL_COMPILER_GCC
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@ -194,7 +194,7 @@ namespace etl
|
||||
//*********************************
|
||||
/// etl::left_spec from etl::left stream manipulator
|
||||
//*********************************
|
||||
friend basic_string_stream& operator <<(basic_string_stream& ss, etl::private_basic_format_spec::left_spec spec)
|
||||
friend basic_string_stream& operator <<(basic_string_stream& ss, etl::private_basic_format_spec::left_spec /*spec*/)
|
||||
{
|
||||
ss.spec.left();
|
||||
return ss;
|
||||
@ -203,7 +203,7 @@ namespace etl
|
||||
//*********************************
|
||||
/// etl::right_spec from etl::left stream manipulator
|
||||
//*********************************
|
||||
friend basic_string_stream& operator <<(basic_string_stream& ss, etl::private_basic_format_spec::right_spec spec)
|
||||
friend basic_string_stream& operator <<(basic_string_stream& ss, etl::private_basic_format_spec::right_spec /*spec*/)
|
||||
{
|
||||
ss.spec.right();
|
||||
return ss;
|
||||
|
||||
@ -155,7 +155,7 @@ namespace etl
|
||||
} // namespace etl
|
||||
|
||||
|
||||
static void swap(etl::debug_count& lhs, etl::debug_count& rhs)
|
||||
inline void swap(etl::debug_count& lhs, etl::debug_count& rhs)
|
||||
{
|
||||
lhs.swap(rhs);
|
||||
}
|
||||
|
||||
@ -358,7 +358,7 @@ namespace etl
|
||||
///\param position The position to insert at.
|
||||
///\param value The value to insert.
|
||||
//*********************************************************************
|
||||
iterator insert(const_iterator position, const_reference value)
|
||||
iterator insert(const_iterator /*position*/, const_reference value)
|
||||
{
|
||||
return insert(value).first;
|
||||
}
|
||||
@ -370,7 +370,7 @@ namespace etl
|
||||
///\param position The position to insert at.
|
||||
///\param value The value to insert.
|
||||
//*********************************************************************
|
||||
iterator insert(const_iterator position, rvalue_reference value)
|
||||
iterator insert(const_iterator /*position*/, rvalue_reference value)
|
||||
{
|
||||
return insert(etl::move(value)).first;
|
||||
}
|
||||
|
||||
@ -301,7 +301,7 @@ namespace etl
|
||||
///\param position The position to insert at.
|
||||
///\param value The value to insert.
|
||||
//*********************************************************************
|
||||
iterator insert(const_iterator position, const value_type& value)
|
||||
iterator insert(const_iterator /*position*/, const value_type& value)
|
||||
{
|
||||
return insert(value).first;
|
||||
}
|
||||
@ -313,7 +313,7 @@ namespace etl
|
||||
///\param position The position to insert at.
|
||||
///\param value The value to insert.
|
||||
//*********************************************************************
|
||||
iterator insert(const_iterator position, rvalue_reference value)
|
||||
iterator insert(const_iterator /*position*/, rvalue_reference value)
|
||||
{
|
||||
return insert(etl::move(value)).first;
|
||||
}
|
||||
|
||||
@ -272,7 +272,7 @@ namespace etl
|
||||
///\param position The position to insert at.
|
||||
///\param value The value to insert.
|
||||
//*********************************************************************
|
||||
iterator insert(const_iterator position, const_reference value)
|
||||
iterator insert(const_iterator /*position*/, const_reference value)
|
||||
{
|
||||
return insert(value).first;
|
||||
}
|
||||
@ -284,7 +284,7 @@ namespace etl
|
||||
///\param position The position to insert at.
|
||||
///\param value The value to insert.
|
||||
//*********************************************************************
|
||||
iterator insert(const_iterator position, rvalue_reference value)
|
||||
iterator insert(const_iterator /*position*/, rvalue_reference value)
|
||||
{
|
||||
return insert(etl::move(value)).first;
|
||||
}
|
||||
|
||||
@ -280,7 +280,7 @@ namespace etl
|
||||
///\param position The position to insert at.
|
||||
///\param value The value to insert.
|
||||
//*********************************************************************
|
||||
iterator insert(const_iterator position, const_reference value)
|
||||
iterator insert(const_iterator /*position*/, const_reference value)
|
||||
{
|
||||
return insert(value).first;
|
||||
}
|
||||
@ -292,7 +292,7 @@ namespace etl
|
||||
///\param position The position to insert at.
|
||||
///\param value The value to insert.
|
||||
//*********************************************************************
|
||||
iterator insert(const_iterator position, rvalue_reference value)
|
||||
iterator insert(const_iterator /*position*/, rvalue_reference value)
|
||||
{
|
||||
return insert(etl::move(value)).first;
|
||||
}
|
||||
|
||||
@ -1499,7 +1499,6 @@ namespace etl
|
||||
else
|
||||
{
|
||||
node_t* p_last_node = &this->start_node;
|
||||
node_t* p_rhs_node = rhs.start_node.next;
|
||||
|
||||
// Add all of the elements.
|
||||
etl::iforward_list<T>::iterator first = rhs.begin();
|
||||
|
||||
@ -484,7 +484,7 @@ namespace etl
|
||||
cog.outl("#else")
|
||||
cog.outl(" //********************************************")
|
||||
cog.outl(" template <typename TMessage>")
|
||||
cog.out(" explicit message_packet(const TMessage& msg, typename etl::enable_if<!etl::is_same<typename etl::remove_reference<TMessage>::type, etl::message_packet<")
|
||||
cog.out(" explicit message_packet(const TMessage& /*msg*/, typename etl::enable_if<!etl::is_same<typename etl::remove_reference<TMessage>::type, etl::message_packet<")
|
||||
for n in range(1, int(Handlers)):
|
||||
cog.out("T%s, " % n)
|
||||
cog.outl("T%s> >::value &&" % int(Handlers))
|
||||
@ -759,7 +759,7 @@ namespace etl
|
||||
cog.outl("#else")
|
||||
cog.outl(" //********************************************")
|
||||
cog.outl(" template <typename TMessage>")
|
||||
cog.out(" explicit message_packet(const TMessage& msg, typename etl::enable_if<!etl::is_same<typename etl::remove_reference<TMessage>::type, etl::message_packet<")
|
||||
cog.out(" explicit message_packet(const TMessage& /*msg*/, typename etl::enable_if<!etl::is_same<typename etl::remove_reference<TMessage>::type, etl::message_packet<")
|
||||
for t in range(1, n):
|
||||
cog.out("T%s, " % t)
|
||||
cog.outl("T%s> >::value &&" % n)
|
||||
|
||||
@ -40,11 +40,6 @@ SOFTWARE.
|
||||
#include "static_assert.h"
|
||||
#include "initializer_list.h"
|
||||
|
||||
#ifdef ETL_COMPILER_GCC
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-variable"
|
||||
#endif
|
||||
|
||||
//*****************************************************************************
|
||||
///\defgroup indirect_vector indirect_vector
|
||||
/// A indirect_vector with the capacity defined at compile time. Objects are allocated from a pool and stored as pointers.
|
||||
@ -1568,9 +1563,5 @@ namespace etl
|
||||
};
|
||||
}
|
||||
|
||||
#ifdef ETL_COMPILER_GCC
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@ -393,7 +393,7 @@ namespace etl
|
||||
#else
|
||||
//********************************************
|
||||
template <typename TMessage>
|
||||
explicit message_packet(const TMessage& msg, typename etl::enable_if<!etl::is_same<typename etl::remove_reference<TMessage>::type, etl::message_packet<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> >::value &&
|
||||
explicit message_packet(const TMessage& /*msg*/, typename etl::enable_if<!etl::is_same<typename etl::remove_reference<TMessage>::type, etl::message_packet<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> >::value &&
|
||||
!etl::is_same<typename etl::remove_reference<TMessage>::type, etl::imessage>::value &&
|
||||
!etl::is_one_of<typename etl::remove_reference<TMessage>::type, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>::value, int>::type = 0)
|
||||
: data()
|
||||
@ -677,7 +677,7 @@ namespace etl
|
||||
#else
|
||||
//********************************************
|
||||
template <typename TMessage>
|
||||
explicit message_packet(const TMessage& msg, typename etl::enable_if<!etl::is_same<typename etl::remove_reference<TMessage>::type, etl::message_packet<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> >::value &&
|
||||
explicit message_packet(const TMessage& /*msg*/, typename etl::enable_if<!etl::is_same<typename etl::remove_reference<TMessage>::type, etl::message_packet<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> >::value &&
|
||||
!etl::is_same<typename etl::remove_reference<TMessage>::type, etl::imessage>::value &&
|
||||
!etl::is_one_of<typename etl::remove_reference<TMessage>::type, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>::value, int>::type = 0)
|
||||
: data()
|
||||
@ -959,7 +959,7 @@ namespace etl
|
||||
#else
|
||||
//********************************************
|
||||
template <typename TMessage>
|
||||
explicit message_packet(const TMessage& msg, typename etl::enable_if<!etl::is_same<typename etl::remove_reference<TMessage>::type, etl::message_packet<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> >::value &&
|
||||
explicit message_packet(const TMessage& /*msg*/, typename etl::enable_if<!etl::is_same<typename etl::remove_reference<TMessage>::type, etl::message_packet<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> >::value &&
|
||||
!etl::is_same<typename etl::remove_reference<TMessage>::type, etl::imessage>::value &&
|
||||
!etl::is_one_of<typename etl::remove_reference<TMessage>::type, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>::value, int>::type = 0)
|
||||
: data()
|
||||
@ -1239,7 +1239,7 @@ namespace etl
|
||||
#else
|
||||
//********************************************
|
||||
template <typename TMessage>
|
||||
explicit message_packet(const TMessage& msg, typename etl::enable_if<!etl::is_same<typename etl::remove_reference<TMessage>::type, etl::message_packet<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> >::value &&
|
||||
explicit message_packet(const TMessage& /*msg*/, typename etl::enable_if<!etl::is_same<typename etl::remove_reference<TMessage>::type, etl::message_packet<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> >::value &&
|
||||
!etl::is_same<typename etl::remove_reference<TMessage>::type, etl::imessage>::value &&
|
||||
!etl::is_one_of<typename etl::remove_reference<TMessage>::type, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>::value, int>::type = 0)
|
||||
: data()
|
||||
@ -1516,7 +1516,7 @@ namespace etl
|
||||
#else
|
||||
//********************************************
|
||||
template <typename TMessage>
|
||||
explicit message_packet(const TMessage& msg, typename etl::enable_if<!etl::is_same<typename etl::remove_reference<TMessage>::type, etl::message_packet<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> >::value &&
|
||||
explicit message_packet(const TMessage& /*msg*/, typename etl::enable_if<!etl::is_same<typename etl::remove_reference<TMessage>::type, etl::message_packet<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> >::value &&
|
||||
!etl::is_same<typename etl::remove_reference<TMessage>::type, etl::imessage>::value &&
|
||||
!etl::is_one_of<typename etl::remove_reference<TMessage>::type, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>::value, int>::type = 0)
|
||||
: data()
|
||||
@ -1788,7 +1788,7 @@ namespace etl
|
||||
#else
|
||||
//********************************************
|
||||
template <typename TMessage>
|
||||
explicit message_packet(const TMessage& msg, typename etl::enable_if<!etl::is_same<typename etl::remove_reference<TMessage>::type, etl::message_packet<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> >::value &&
|
||||
explicit message_packet(const TMessage& /*msg*/, typename etl::enable_if<!etl::is_same<typename etl::remove_reference<TMessage>::type, etl::message_packet<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> >::value &&
|
||||
!etl::is_same<typename etl::remove_reference<TMessage>::type, etl::imessage>::value &&
|
||||
!etl::is_one_of<typename etl::remove_reference<TMessage>::type, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>::value, int>::type = 0)
|
||||
: data()
|
||||
@ -2058,7 +2058,7 @@ namespace etl
|
||||
#else
|
||||
//********************************************
|
||||
template <typename TMessage>
|
||||
explicit message_packet(const TMessage& msg, typename etl::enable_if<!etl::is_same<typename etl::remove_reference<TMessage>::type, etl::message_packet<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> >::value &&
|
||||
explicit message_packet(const TMessage& /*msg*/, typename etl::enable_if<!etl::is_same<typename etl::remove_reference<TMessage>::type, etl::message_packet<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> >::value &&
|
||||
!etl::is_same<typename etl::remove_reference<TMessage>::type, etl::imessage>::value &&
|
||||
!etl::is_one_of<typename etl::remove_reference<TMessage>::type, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>::value, int>::type = 0)
|
||||
: data()
|
||||
@ -2326,7 +2326,7 @@ namespace etl
|
||||
#else
|
||||
//********************************************
|
||||
template <typename TMessage>
|
||||
explicit message_packet(const TMessage& msg, typename etl::enable_if<!etl::is_same<typename etl::remove_reference<TMessage>::type, etl::message_packet<T1, T2, T3, T4, T5, T6, T7, T8, T9> >::value &&
|
||||
explicit message_packet(const TMessage& /*msg*/, typename etl::enable_if<!etl::is_same<typename etl::remove_reference<TMessage>::type, etl::message_packet<T1, T2, T3, T4, T5, T6, T7, T8, T9> >::value &&
|
||||
!etl::is_same<typename etl::remove_reference<TMessage>::type, etl::imessage>::value &&
|
||||
!etl::is_one_of<typename etl::remove_reference<TMessage>::type, T1, T2, T3, T4, T5, T6, T7, T8, T9>::value, int>::type = 0)
|
||||
: data()
|
||||
@ -2591,7 +2591,7 @@ namespace etl
|
||||
#else
|
||||
//********************************************
|
||||
template <typename TMessage>
|
||||
explicit message_packet(const TMessage& msg, typename etl::enable_if<!etl::is_same<typename etl::remove_reference<TMessage>::type, etl::message_packet<T1, T2, T3, T4, T5, T6, T7, T8> >::value &&
|
||||
explicit message_packet(const TMessage& /*msg*/, typename etl::enable_if<!etl::is_same<typename etl::remove_reference<TMessage>::type, etl::message_packet<T1, T2, T3, T4, T5, T6, T7, T8> >::value &&
|
||||
!etl::is_same<typename etl::remove_reference<TMessage>::type, etl::imessage>::value &&
|
||||
!etl::is_one_of<typename etl::remove_reference<TMessage>::type, T1, T2, T3, T4, T5, T6, T7, T8>::value, int>::type = 0)
|
||||
: data()
|
||||
@ -2851,7 +2851,7 @@ namespace etl
|
||||
#else
|
||||
//********************************************
|
||||
template <typename TMessage>
|
||||
explicit message_packet(const TMessage& msg, typename etl::enable_if<!etl::is_same<typename etl::remove_reference<TMessage>::type, etl::message_packet<T1, T2, T3, T4, T5, T6, T7> >::value &&
|
||||
explicit message_packet(const TMessage& /*msg*/, typename etl::enable_if<!etl::is_same<typename etl::remove_reference<TMessage>::type, etl::message_packet<T1, T2, T3, T4, T5, T6, T7> >::value &&
|
||||
!etl::is_same<typename etl::remove_reference<TMessage>::type, etl::imessage>::value &&
|
||||
!etl::is_one_of<typename etl::remove_reference<TMessage>::type, T1, T2, T3, T4, T5, T6, T7>::value, int>::type = 0)
|
||||
: data()
|
||||
@ -3109,7 +3109,7 @@ namespace etl
|
||||
#else
|
||||
//********************************************
|
||||
template <typename TMessage>
|
||||
explicit message_packet(const TMessage& msg, typename etl::enable_if<!etl::is_same<typename etl::remove_reference<TMessage>::type, etl::message_packet<T1, T2, T3, T4, T5, T6> >::value &&
|
||||
explicit message_packet(const TMessage& /*msg*/, typename etl::enable_if<!etl::is_same<typename etl::remove_reference<TMessage>::type, etl::message_packet<T1, T2, T3, T4, T5, T6> >::value &&
|
||||
!etl::is_same<typename etl::remove_reference<TMessage>::type, etl::imessage>::value &&
|
||||
!etl::is_one_of<typename etl::remove_reference<TMessage>::type, T1, T2, T3, T4, T5, T6>::value, int>::type = 0)
|
||||
: data()
|
||||
@ -3365,7 +3365,7 @@ namespace etl
|
||||
#else
|
||||
//********************************************
|
||||
template <typename TMessage>
|
||||
explicit message_packet(const TMessage& msg, typename etl::enable_if<!etl::is_same<typename etl::remove_reference<TMessage>::type, etl::message_packet<T1, T2, T3, T4, T5> >::value &&
|
||||
explicit message_packet(const TMessage& /*msg*/, typename etl::enable_if<!etl::is_same<typename etl::remove_reference<TMessage>::type, etl::message_packet<T1, T2, T3, T4, T5> >::value &&
|
||||
!etl::is_same<typename etl::remove_reference<TMessage>::type, etl::imessage>::value &&
|
||||
!etl::is_one_of<typename etl::remove_reference<TMessage>::type, T1, T2, T3, T4, T5>::value, int>::type = 0)
|
||||
: data()
|
||||
@ -3618,7 +3618,7 @@ namespace etl
|
||||
#else
|
||||
//********************************************
|
||||
template <typename TMessage>
|
||||
explicit message_packet(const TMessage& msg, typename etl::enable_if<!etl::is_same<typename etl::remove_reference<TMessage>::type, etl::message_packet<T1, T2, T3, T4> >::value &&
|
||||
explicit message_packet(const TMessage& /*msg*/, typename etl::enable_if<!etl::is_same<typename etl::remove_reference<TMessage>::type, etl::message_packet<T1, T2, T3, T4> >::value &&
|
||||
!etl::is_same<typename etl::remove_reference<TMessage>::type, etl::imessage>::value &&
|
||||
!etl::is_one_of<typename etl::remove_reference<TMessage>::type, T1, T2, T3, T4>::value, int>::type = 0)
|
||||
: data()
|
||||
@ -3866,7 +3866,7 @@ namespace etl
|
||||
#else
|
||||
//********************************************
|
||||
template <typename TMessage>
|
||||
explicit message_packet(const TMessage& msg, typename etl::enable_if<!etl::is_same<typename etl::remove_reference<TMessage>::type, etl::message_packet<T1, T2, T3> >::value &&
|
||||
explicit message_packet(const TMessage& /*msg*/, typename etl::enable_if<!etl::is_same<typename etl::remove_reference<TMessage>::type, etl::message_packet<T1, T2, T3> >::value &&
|
||||
!etl::is_same<typename etl::remove_reference<TMessage>::type, etl::imessage>::value &&
|
||||
!etl::is_one_of<typename etl::remove_reference<TMessage>::type, T1, T2, T3>::value, int>::type = 0)
|
||||
: data()
|
||||
@ -4112,7 +4112,7 @@ namespace etl
|
||||
#else
|
||||
//********************************************
|
||||
template <typename TMessage>
|
||||
explicit message_packet(const TMessage& msg, typename etl::enable_if<!etl::is_same<typename etl::remove_reference<TMessage>::type, etl::message_packet<T1, T2> >::value &&
|
||||
explicit message_packet(const TMessage& /*msg*/, typename etl::enable_if<!etl::is_same<typename etl::remove_reference<TMessage>::type, etl::message_packet<T1, T2> >::value &&
|
||||
!etl::is_same<typename etl::remove_reference<TMessage>::type, etl::imessage>::value &&
|
||||
!etl::is_one_of<typename etl::remove_reference<TMessage>::type, T1, T2>::value, int>::type = 0)
|
||||
: data()
|
||||
@ -4356,7 +4356,7 @@ namespace etl
|
||||
#else
|
||||
//********************************************
|
||||
template <typename TMessage>
|
||||
explicit message_packet(const TMessage& msg, typename etl::enable_if<!etl::is_same<typename etl::remove_reference<TMessage>::type, etl::message_packet<T1> >::value &&
|
||||
explicit message_packet(const TMessage& /*msg*/, typename etl::enable_if<!etl::is_same<typename etl::remove_reference<TMessage>::type, etl::message_packet<T1> >::value &&
|
||||
!etl::is_same<typename etl::remove_reference<TMessage>::type, etl::imessage>::value &&
|
||||
!etl::is_one_of<typename etl::remove_reference<TMessage>::type, T1>::value, int>::type = 0)
|
||||
: data()
|
||||
|
||||
@ -283,12 +283,11 @@ namespace etl
|
||||
/// Construct from iterator + size
|
||||
//*************************************************************************
|
||||
template <typename TIterator, typename TSize>
|
||||
ETL_CONSTEXPR poly_span(const TIterator begin_, const TSize size_) ETL_NOEXCEPT
|
||||
ETL_CONSTEXPR poly_span(const TIterator begin_, const TSize /*size_*/) ETL_NOEXCEPT
|
||||
: pbegin(etl::addressof(*begin_))
|
||||
, element_size(sizeof(typename etl::iterator_traits<TIterator>::value_type))
|
||||
{
|
||||
typedef typename etl::iterator_traits<TIterator>::value_type data_type;
|
||||
typedef typename etl::iterator_traits<TIterator>::iterator_category iterator_category;
|
||||
|
||||
ETL_STATIC_ASSERT((etl::is_same<ETL_OR_STD::random_access_iterator_tag, typename etl::iterator_traits<TIterator>::iterator_category>::value), "Not a random access iterator");
|
||||
ETL_STATIC_ASSERT((etl::is_base_of<TBase, data_type>::value || etl::is_same<TBase, data_type>::value), "TBase not a base of the data type");
|
||||
@ -298,7 +297,7 @@ namespace etl
|
||||
/// Construct from iterators
|
||||
//*************************************************************************
|
||||
template <typename TIterator>
|
||||
ETL_CONSTEXPR poly_span(const TIterator begin_, const TIterator end_)
|
||||
ETL_CONSTEXPR poly_span(const TIterator begin_, const TIterator /*end_*/)
|
||||
: pbegin(etl::addressof(*begin_))
|
||||
, element_size(sizeof(typename etl::iterator_traits<TIterator>::value_type))
|
||||
{
|
||||
@ -600,7 +599,7 @@ namespace etl
|
||||
/// Construct from iterator + offset + element size
|
||||
/// extent_ is ignored.
|
||||
//*************************************************************************
|
||||
ETL_CONSTEXPR poly_span(TBase* pbegin_, size_t offset_, size_t extent_, size_t element_size_) ETL_NOEXCEPT
|
||||
ETL_CONSTEXPR poly_span(TBase* pbegin_, size_t offset_, size_t /*extent_*/, size_t element_size_) ETL_NOEXCEPT
|
||||
: pbegin(reinterpret_cast<pointer>(reinterpret_cast<char_ptr_t>(pbegin_) + (offset_ * element_size_)))
|
||||
, element_size(element_size_)
|
||||
{
|
||||
|
||||
39
include/etl/private/diagnostic_pessimizing-move_push.h
Normal file
39
include/etl/private/diagnostic_pessimizing-move_push.h
Normal file
@ -0,0 +1,39 @@
|
||||
///\file
|
||||
|
||||
/******************************************************************************
|
||||
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.
|
||||
******************************************************************************/
|
||||
|
||||
/*
|
||||
* The header include guard has been intentionally omitted.
|
||||
* This file is intended to evaluated multiple times by design.
|
||||
*/
|
||||
|
||||
#if defined(__clang__) || defined(__llvm__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wpessimizing-move"
|
||||
#endif
|
||||
42
include/etl/private/diagnostic_pop.h
Normal file
42
include/etl/private/diagnostic_pop.h
Normal file
@ -0,0 +1,42 @@
|
||||
///\file
|
||||
|
||||
/******************************************************************************
|
||||
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.
|
||||
******************************************************************************/
|
||||
|
||||
/*
|
||||
* The header include guard has been intentionally omitted.
|
||||
* This file is intended to evaluated multiple times by design.
|
||||
*/
|
||||
|
||||
#if defined(__GNUC__) && !defined(__clang__) && !defined(__llvm__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
#if defined(__clang__) || defined(__llvm__)
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
39
include/etl/private/diagnostic_self_assign_overloaded_push.h
Normal file
39
include/etl/private/diagnostic_self_assign_overloaded_push.h
Normal file
@ -0,0 +1,39 @@
|
||||
///\file
|
||||
|
||||
/******************************************************************************
|
||||
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.
|
||||
******************************************************************************/
|
||||
|
||||
/*
|
||||
* The header include guard has been intentionally omitted.
|
||||
* This file is intended to evaluated multiple times by design.
|
||||
*/
|
||||
|
||||
#if defined(__clang__) || defined(__llvm__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wself-assign-overloaded"
|
||||
#endif
|
||||
44
include/etl/private/diagnostic_unused_function_push.h
Normal file
44
include/etl/private/diagnostic_unused_function_push.h
Normal file
@ -0,0 +1,44 @@
|
||||
///\file
|
||||
|
||||
/******************************************************************************
|
||||
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.
|
||||
******************************************************************************/
|
||||
|
||||
/*
|
||||
* The header include guard has been intentionally omitted.
|
||||
* This file is intended to evaluated multiple times by design.
|
||||
*/
|
||||
|
||||
#if defined(__GNUC__) && !defined(__clang__) && !defined(__llvm__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-function"
|
||||
#endif
|
||||
|
||||
#if defined(__clang__) || defined(__llvm__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wunused-function"
|
||||
#endif
|
||||
@ -44,10 +44,6 @@ SOFTWARE.
|
||||
#include "../functional.h"
|
||||
#include "../iterator.h"
|
||||
|
||||
#ifdef ETL_COMPILER_GCC
|
||||
#pragma GCC diagnostic ignored "-Wunused-variable"
|
||||
#endif
|
||||
|
||||
#include "minmax_push.h"
|
||||
|
||||
namespace etl
|
||||
|
||||
@ -181,7 +181,7 @@ namespace etl
|
||||
template <typename T>
|
||||
struct operation_type<T, Non_Copyable, Non_Moveable>
|
||||
{
|
||||
static void do_operation(int operation, char* pstorage, const char* pvalue)
|
||||
static void do_operation(int operation, char* pstorage, const char* /*pvalue*/)
|
||||
{
|
||||
switch (operation)
|
||||
{
|
||||
|
||||
@ -588,7 +588,7 @@ namespace etl
|
||||
///\param position The position to insert at.
|
||||
///\param value The value to insert.
|
||||
//*********************************************************************
|
||||
iterator insert(const_iterator position, reference value)
|
||||
iterator insert(const_iterator /*position*/, reference value)
|
||||
{
|
||||
return insert(value).first;
|
||||
}
|
||||
|
||||
@ -480,7 +480,7 @@ namespace etl
|
||||
///\param position The position to insert at.
|
||||
///\param value The value to insert.
|
||||
//*********************************************************************
|
||||
iterator insert(const_iterator position, const value_type& value)
|
||||
iterator insert(const_iterator /*position*/, const value_type& value)
|
||||
{
|
||||
return insert(value).first;
|
||||
}
|
||||
|
||||
@ -473,7 +473,7 @@ namespace etl
|
||||
///\param position The position to insert at.
|
||||
///\param value The value to insert.
|
||||
//*********************************************************************
|
||||
iterator insert(const_iterator position, value_type& value)
|
||||
iterator insert(const_iterator /*position*/, value_type& value)
|
||||
{
|
||||
return insert(value).first;
|
||||
}
|
||||
|
||||
@ -456,7 +456,7 @@ namespace etl
|
||||
///\param position The position to insert at.
|
||||
///\param value The value to insert.
|
||||
//*********************************************************************
|
||||
iterator insert(const_iterator position, reference value)
|
||||
iterator insert(const_iterator /*position*/, reference value)
|
||||
{
|
||||
return insert(value).first;
|
||||
}
|
||||
|
||||
@ -2531,8 +2531,6 @@ namespace etl
|
||||
set(set&& other)
|
||||
: etl::iset<TKey, TCompare>(node_pool, MAX_SIZE)
|
||||
{
|
||||
int count = 0;
|
||||
|
||||
if (this != &other)
|
||||
{
|
||||
typename etl::iset<TKey, TCompare>::iterator from = other.begin();
|
||||
|
||||
@ -86,7 +86,7 @@ namespace etl
|
||||
/// Construct from pointer + size
|
||||
//*************************************************************************
|
||||
template <typename TIterator, typename TSize>
|
||||
ETL_CONSTEXPR span(const TIterator begin_, const TSize size_) ETL_NOEXCEPT
|
||||
ETL_CONSTEXPR span(const TIterator begin_, const TSize /*size_*/) ETL_NOEXCEPT
|
||||
: pbegin(etl::addressof(*begin_))
|
||||
{
|
||||
}
|
||||
@ -95,7 +95,7 @@ namespace etl
|
||||
/// Construct from iterators
|
||||
//*************************************************************************
|
||||
template <typename TIterator>
|
||||
ETL_CONSTEXPR span(const TIterator begin_, const TIterator end_)
|
||||
ETL_CONSTEXPR span(const TIterator begin_, const TIterator /*end_*/)
|
||||
: pbegin(etl::addressof(*begin_))
|
||||
{
|
||||
}
|
||||
|
||||
@ -808,13 +808,13 @@ namespace etl
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
const transition* const transition_table_end() const
|
||||
const transition* transition_table_end() const
|
||||
{
|
||||
return transition_table_begin + transition_table_size;
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
const state* const state_table_end() const
|
||||
const state* state_table_end() const
|
||||
{
|
||||
return state_table_begin + state_table_size;
|
||||
}
|
||||
@ -1058,13 +1058,13 @@ namespace etl
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
const transition* const transition_table_end() const
|
||||
const transition* transition_table_end() const
|
||||
{
|
||||
return transition_table_begin + transition_table_size;
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
const state* const state_table_end() const
|
||||
const state* state_table_end() const
|
||||
{
|
||||
return state_table_begin + state_table_size;
|
||||
}
|
||||
|
||||
@ -279,22 +279,22 @@ namespace etl
|
||||
enum
|
||||
{
|
||||
value =
|
||||
(unsigned int) etl::is_same<T, typename T1::type>::value ? T1::ID :
|
||||
(unsigned int) etl::is_same<T, typename T2::type>::value ? T2::ID :
|
||||
(unsigned int) etl::is_same<T, typename T3::type>::value ? T3::ID :
|
||||
(unsigned int) etl::is_same<T, typename T4::type>::value ? T4::ID :
|
||||
(unsigned int) etl::is_same<T, typename T5::type>::value ? T5::ID :
|
||||
(unsigned int) etl::is_same<T, typename T6::type>::value ? T6::ID :
|
||||
(unsigned int) etl::is_same<T, typename T7::type>::value ? T7::ID :
|
||||
(unsigned int) etl::is_same<T, typename T8::type>::value ? T8::ID :
|
||||
(unsigned int) etl::is_same<T, typename T9::type>::value ? T9::ID :
|
||||
(unsigned int) etl::is_same<T, typename T10::type>::value ? T10::ID :
|
||||
(unsigned int) etl::is_same<T, typename T11::type>::value ? T11::ID :
|
||||
(unsigned int) etl::is_same<T, typename T12::type>::value ? T12::ID :
|
||||
(unsigned int) etl::is_same<T, typename T13::type>::value ? T13::ID :
|
||||
(unsigned int) etl::is_same<T, typename T14::type>::value ? T14::ID :
|
||||
(unsigned int) etl::is_same<T, typename T15::type>::value ? T15::ID :
|
||||
(unsigned int) etl::is_same<T, typename T16::type>::value ? T16::ID :
|
||||
(unsigned int) etl::is_same<T, typename T1::type>::value ? (unsigned int)T1::ID :
|
||||
(unsigned int) etl::is_same<T, typename T2::type>::value ? (unsigned int)T2::ID :
|
||||
(unsigned int) etl::is_same<T, typename T3::type>::value ? (unsigned int)T3::ID :
|
||||
(unsigned int) etl::is_same<T, typename T4::type>::value ? (unsigned int)T4::ID :
|
||||
(unsigned int) etl::is_same<T, typename T5::type>::value ? (unsigned int)T5::ID :
|
||||
(unsigned int) etl::is_same<T, typename T6::type>::value ? (unsigned int)T6::ID :
|
||||
(unsigned int) etl::is_same<T, typename T7::type>::value ? (unsigned int)T7::ID :
|
||||
(unsigned int) etl::is_same<T, typename T8::type>::value ? (unsigned int)T8::ID :
|
||||
(unsigned int) etl::is_same<T, typename T9::type>::value ? (unsigned int)T9::ID :
|
||||
(unsigned int) etl::is_same<T, typename T10::type>::value ? (unsigned int)T10::ID :
|
||||
(unsigned int) etl::is_same<T, typename T11::type>::value ? (unsigned int)T11::ID :
|
||||
(unsigned int) etl::is_same<T, typename T12::type>::value ? (unsigned int)T12::ID :
|
||||
(unsigned int) etl::is_same<T, typename T13::type>::value ? (unsigned int)T13::ID :
|
||||
(unsigned int) etl::is_same<T, typename T14::type>::value ? (unsigned int)T14::ID :
|
||||
(unsigned int) etl::is_same<T, typename T15::type>::value ? (unsigned int)T15::ID :
|
||||
(unsigned int) etl::is_same<T, typename T16::type>::value ? (unsigned int)T16::ID :
|
||||
(unsigned int) UNKNOWN
|
||||
};
|
||||
|
||||
|
||||
@ -374,7 +374,7 @@ namespace etl
|
||||
}
|
||||
|
||||
//*******************************
|
||||
static ETL_CONSTEXPR14 void copy(const char* src, int endian_src, char* dst)
|
||||
static ETL_CONSTEXPR14 void copy(const char* src, int /*endian_src*/, char* dst)
|
||||
{
|
||||
dst[0] = src[0];
|
||||
}
|
||||
|
||||
@ -775,7 +775,7 @@ namespace etl
|
||||
///\param position The position to insert at.
|
||||
///\param value The value to insert.
|
||||
//*********************************************************************
|
||||
iterator insert(const_iterator position, const_reference key)
|
||||
iterator insert(const_iterator /*position*/, const_reference key)
|
||||
{
|
||||
return insert(key).first;
|
||||
}
|
||||
|
||||
@ -54,11 +54,6 @@ SOFTWARE.
|
||||
#include "algorithm.h"
|
||||
#include "initializer_list.h"
|
||||
|
||||
#ifdef ETL_COMPILER_GCC
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-variable"
|
||||
#endif
|
||||
|
||||
//*****************************************************************************
|
||||
///\defgroup vector vector
|
||||
/// A vector with the capacity defined at compile time.
|
||||
@ -1816,8 +1811,4 @@ namespace etl
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef ETL_COMPILER_GCC
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@ -32,8 +32,6 @@ if (ETL_FORCE_TEST_CPP03_IMPLEMENTATION)
|
||||
add_definitions(-DETL_FORCE_TEST_CPP03_IMPLEMENTATION)
|
||||
endif()
|
||||
|
||||
include_directories(${UTPP_INCLUDE_DIRS} ${PROJECT_SOURCE_DIR}/../include)
|
||||
|
||||
set(TEST_SOURCE_FILES
|
||||
main.cpp
|
||||
murmurhash3.cpp
|
||||
@ -314,6 +312,10 @@ set(UNITTEST_SOURCE_FILES
|
||||
UnitTest++/XmlTestReporter.cpp
|
||||
)
|
||||
|
||||
set(UNITTEST_DIR
|
||||
UnitTest++
|
||||
)
|
||||
|
||||
if (WIN32)
|
||||
set(UNITTEST_SOURCE_FILES
|
||||
${UNITTEST_SOURCE_FILES}
|
||||
@ -327,20 +329,33 @@ else ()
|
||||
)
|
||||
endif ()
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
||||
message(STATUS "Using MSVC")
|
||||
endif()
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||
message(STATUS "Using GNU")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address,undefined")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
|
||||
endif()
|
||||
|
||||
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")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
|
||||
endif()
|
||||
|
||||
add_executable(etl_tests ${TEST_SOURCE_FILES})
|
||||
add_library(unit_test ${UNITTEST_SOURCE_FILES})
|
||||
include_directories(${PROJECT_SOURCE_DIR}/../include)
|
||||
target_include_directories(etl_tests SYSTEM PRIVATE ${UNITTEST_DIR})
|
||||
target_include_directories(etl_tests PUBLIC ${CMAKE_CURRENT_LIST_DIR})
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
# atomic is need on Linux with Clang
|
||||
@ -355,8 +370,6 @@ else()
|
||||
target_link_libraries(etl_tests unit_test)
|
||||
endif()
|
||||
|
||||
target_include_directories(etl_tests PUBLIC ${CMAKE_CURRENT_LIST_DIR})
|
||||
|
||||
# Enable the 'make test' CMake target using the executable defined above
|
||||
add_test(etl_unit_tests etl_tests)
|
||||
|
||||
|
||||
@ -1,6 +1,16 @@
|
||||
#ifndef UNITTEST_CHECKS_H
|
||||
#define UNITTEST_CHECKS_H
|
||||
|
||||
#if defined(__GNUC__) && !defined(__clang__) && !defined(__llvm__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wsign-compare"
|
||||
#endif
|
||||
|
||||
#if defined(__clang__) || defined(__llvm__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wsign-compare"
|
||||
#endif
|
||||
|
||||
#include "Config.h"
|
||||
#include "TestResults.h"
|
||||
#include "MemoryOutStream.h"
|
||||
@ -155,4 +165,12 @@ namespace UnitTest {
|
||||
|
||||
}
|
||||
|
||||
#if defined(__GNUC__) && !defined(__clang__) && !defined(__llvm__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
#if defined(__clang__) || defined(__llvm__)
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@ -52,6 +52,12 @@ struct non_random_iterator : public etl::iterator<ETL_OR_STD::bidirectional_iter
|
||||
ptr = other.ptr;
|
||||
}
|
||||
|
||||
non_random_iterator& operator =(const non_random_iterator& other)
|
||||
{
|
||||
ptr = other.ptr;
|
||||
return *this;
|
||||
}
|
||||
|
||||
T& operator *()
|
||||
{
|
||||
return *ptr;
|
||||
@ -131,6 +137,12 @@ struct random_iterator : public etl::iterator<ETL_OR_STD::random_access_iterator
|
||||
ptr = other.ptr;
|
||||
}
|
||||
|
||||
random_iterator& operator =(const random_iterator& other)
|
||||
{
|
||||
ptr = other.ptr;
|
||||
return *this;
|
||||
}
|
||||
|
||||
T& operator *()
|
||||
{
|
||||
return *ptr;
|
||||
|
||||
@ -733,6 +733,8 @@ namespace
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
#include "etl/private/diagnostic_unused_function_push.h"
|
||||
|
||||
struct C_issue_482 {};
|
||||
|
||||
void f_issue_482(etl::array_view<char>)
|
||||
@ -751,6 +753,8 @@ namespace
|
||||
f_issue_482(c);
|
||||
}
|
||||
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
//*************************************************************************
|
||||
TEST(test_fill)
|
||||
{
|
||||
|
||||
@ -39,9 +39,9 @@ namespace
|
||||
//***********************************
|
||||
// Count bits the long way.
|
||||
template <typename T>
|
||||
size_t test_count(T value)
|
||||
int test_count(T value)
|
||||
{
|
||||
size_t count = 0UL;
|
||||
int count = 0;
|
||||
|
||||
for (int i = 0; i < etl::integral_limits<T>::bits; ++i)
|
||||
{
|
||||
@ -57,9 +57,9 @@ namespace
|
||||
//***********************************
|
||||
// Count trailing zeros the long way.
|
||||
template <typename T>
|
||||
size_t test_trailing_zeros(T value)
|
||||
int test_trailing_zeros(T value)
|
||||
{
|
||||
size_t count = 0UL;
|
||||
int count = 0;
|
||||
|
||||
for (int i = 0; i < etl::integral_limits<T>::bits; ++i)
|
||||
{
|
||||
@ -81,7 +81,7 @@ namespace
|
||||
//***********************************
|
||||
// Count leading zeros the long way.
|
||||
template <typename T>
|
||||
size_t test_leading_zeros(T value)
|
||||
int test_leading_zeros(T value)
|
||||
{
|
||||
value = etl::reverse_bits(value);
|
||||
return test_trailing_zeros(value);
|
||||
@ -90,9 +90,9 @@ namespace
|
||||
//***********************************
|
||||
// Count trailing ones the long way.
|
||||
template <typename T>
|
||||
size_t test_trailing_ones(T value)
|
||||
int test_trailing_ones(T value)
|
||||
{
|
||||
size_t count = 0UL;
|
||||
int count = 0UL;
|
||||
|
||||
for (int i = 0; i < etl::integral_limits<T>::bits; ++i)
|
||||
{
|
||||
@ -114,7 +114,7 @@ namespace
|
||||
//***********************************
|
||||
// Count leading ones the long way.
|
||||
template <typename T>
|
||||
size_t test_leading_ones(T value)
|
||||
int test_leading_ones(T value)
|
||||
{
|
||||
value = etl::reverse_bits(value);
|
||||
return test_trailing_ones(value);
|
||||
|
||||
@ -33,6 +33,8 @@ SOFTWARE.
|
||||
#include <array>
|
||||
#include <numeric>
|
||||
|
||||
#include "etl/private/diagnostic_unused_function_push.h"
|
||||
|
||||
namespace
|
||||
{
|
||||
//***********************************
|
||||
@ -63,8 +65,6 @@ namespace etl
|
||||
template <>
|
||||
Object read_unchecked<Object>(etl::bit_stream_reader& stream)
|
||||
{
|
||||
bool success = true;
|
||||
|
||||
int16_t result_s = stream.read_unchecked<int16_t>(14);
|
||||
int32_t result_i = stream.read_unchecked<int32_t>(23);
|
||||
uint8_t result_c = stream.read_unchecked<uint8_t>();
|
||||
@ -960,12 +960,12 @@ namespace
|
||||
//*************************************************************************
|
||||
TEST(test_read_multiple_full_size)
|
||||
{
|
||||
int8_t c1 = 90; // 0x5A
|
||||
uint16_t s1 = 4660; // 0x1234
|
||||
int32_t i1 = 0x89ABCDEF; // 0x89ABCDEF
|
||||
int32_t i2 = 0xFEDCBA98; // 0xFEDCBA98
|
||||
uint16_t s2 = 22136; // 0x5678
|
||||
int8_t c2 = -91; // 0xA5
|
||||
//int8_t c1 = 90; // 0x5A
|
||||
//uint16_t s1 = 4660; // 0x1234
|
||||
//int32_t i1 = 0x89ABCDEF; // 0x89ABCDEF
|
||||
//int32_t i2 = 0xFEDCBA98; // 0xFEDCBA98
|
||||
//uint16_t s2 = 22136; // 0x5678
|
||||
//int8_t c2 = -91; // 0xA5
|
||||
|
||||
std::array storage = { char(0x5A),
|
||||
char(0x12), char(0x34),
|
||||
@ -1006,12 +1006,12 @@ namespace
|
||||
//*************************************************************************
|
||||
TEST(test_read_multiple_variable_size)
|
||||
{
|
||||
int8_t c1 = 90; // 0x5A 6 bits
|
||||
uint16_t s1 = 4660; // 0x1234 13 bits
|
||||
int32_t i1 = 0x89ABCDEF; // 0x89ABCDEF 23 bits
|
||||
int32_t i2 = 0xFEDCBA98; // 0xFEDCBA98 25 bits
|
||||
uint16_t s2 = 22136; // 0x5678 11 bits
|
||||
int8_t c2 = -91; // 0xA5 7 bits
|
||||
//int8_t c1 = 90; // 0x5A 6 bits
|
||||
//uint16_t s1 = 4660; // 0x1234 13 bits
|
||||
//int32_t i1 = 0x89ABCDEF; // 0x89ABCDEF 23 bits
|
||||
//int32_t i2 = 0xFEDCBA98; // 0xFEDCBA98 25 bits
|
||||
//uint16_t s2 = 22136; // 0x5678 11 bits
|
||||
//int8_t c2 = -91; // 0xA5 7 bits
|
||||
|
||||
std::array storage = { char(0x6A), char(0x46), char(0x8A), char(0xF3),
|
||||
char(0x7B), char(0xDB), char(0x97), char(0x53),
|
||||
@ -1049,12 +1049,12 @@ namespace
|
||||
//*************************************************************************
|
||||
TEST(test_read_multiple_variable_size_using_non_member_functions)
|
||||
{
|
||||
int8_t c1 = 90; // 0x5A 6 bits
|
||||
uint16_t s1 = 4660; // 0x1234 13 bits
|
||||
int32_t i1 = 0x89ABCDEF; // 0x89ABCDEF 23 bits
|
||||
int32_t i2 = 0xFEDCBA98; // 0xFEDCBA98 25 bits
|
||||
uint16_t s2 = 22136; // 0x5678 11 bits
|
||||
int8_t c2 = -91; // 0xA5 7 bits
|
||||
//int8_t c1 = 90; // 0x5A 6 bits
|
||||
//uint16_t s1 = 4660; // 0x1234 13 bits
|
||||
//int32_t i1 = 0x89ABCDEF; // 0x89ABCDEF 23 bits
|
||||
//int32_t i2 = 0xFEDCBA98; // 0xFEDCBA98 25 bits
|
||||
//uint16_t s2 = 22136; // 0x5678 11 bits
|
||||
//int8_t c2 = -91; // 0xA5 7 bits
|
||||
|
||||
std::array storage = { char(0x6A), char(0x46), char(0x8A), char(0xF3),
|
||||
char(0x7B), char(0xDB), char(0x97), char(0x53),
|
||||
@ -1145,3 +1145,5 @@ namespace
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
@ -43,6 +43,7 @@ namespace
|
||||
uint8_t c;
|
||||
};
|
||||
|
||||
#include "etl/private/diagnostic_unused_function_push.h"
|
||||
bool operator ==(const Object& lhs, const Object& rhs)
|
||||
{
|
||||
return (lhs.s == rhs.s) &&
|
||||
@ -55,6 +56,7 @@ namespace
|
||||
os << object.s << "," << object.i << "," << (int)object.c;
|
||||
return os;
|
||||
}
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
}
|
||||
|
||||
namespace etl
|
||||
@ -63,8 +65,6 @@ namespace etl
|
||||
template <>
|
||||
Object read_unchecked<Object>(etl::bit_stream_reader& stream)
|
||||
{
|
||||
bool success = true;
|
||||
|
||||
int16_t result_s = stream.read_unchecked<int16_t>(14);
|
||||
int32_t result_i = stream.read_unchecked<int32_t>(23);
|
||||
uint8_t result_c = stream.read_unchecked<uint8_t>();
|
||||
@ -968,12 +968,12 @@ namespace
|
||||
//*************************************************************************
|
||||
TEST(test_read_multiple_full_size)
|
||||
{
|
||||
int8_t c1 = 90; // 0x5A
|
||||
uint16_t s1 = 4660; // 0x1234
|
||||
int32_t i1 = 0x89ABCDEF; // 0x89ABCDEF
|
||||
int32_t i2 = 0xFEDCBA98; // 0xFEDCBA98
|
||||
uint16_t s2 = 22136; // 0x5678
|
||||
int8_t c2 = -91; // 0xA5
|
||||
//int8_t c1 = 90; // 0x5A
|
||||
//uint16_t s1 = 4660; // 0x1234
|
||||
//int32_t i1 = 0x89ABCDEF; // 0x89ABCDEF
|
||||
//int32_t i2 = 0xFEDCBA98; // 0xFEDCBA98
|
||||
//uint16_t s2 = 22136; // 0x5678
|
||||
//int8_t c2 = -91; // 0xA5
|
||||
|
||||
std::array storage = { char(0x5A),
|
||||
char(0x2C), char(0x48),
|
||||
@ -1014,12 +1014,12 @@ namespace
|
||||
//*************************************************************************
|
||||
TEST(test_read_multiple_variable_size)
|
||||
{
|
||||
int8_t c1 = 90; // 0x5A 6 bits
|
||||
uint16_t s1 = 4660; // 0x1234 13 bits
|
||||
int32_t i1 = 0x89ABCDEF; // 0x89ABCDEF 23 bits
|
||||
int32_t i2 = 0xFEDCBA98; // 0xFEDCBA98 25 bits
|
||||
uint16_t s2 = 22136; // 0x5678 11 bits
|
||||
int8_t c2 = -91; // 0xA5 7 bits
|
||||
//int8_t c1 = 90; // 0x5A 6 bits
|
||||
//uint16_t s1 = 4660; // 0x1234 13 bits
|
||||
//int32_t i1 = 0x89ABCDEF; // 0x89ABCDEF 23 bits
|
||||
//int32_t i2 = 0xFEDCBA98; // 0xFEDCBA98 25 bits
|
||||
//uint16_t s2 = 22136; // 0x5678 11 bits
|
||||
//int8_t c2 = -91; // 0xA5 7 bits
|
||||
|
||||
std::array storage = { char(0x58), char(0xB1), char(0x3E), char(0xF6),
|
||||
char(0x7A), char(0x86), char(0x57), char(0x4E),
|
||||
@ -1057,12 +1057,12 @@ namespace
|
||||
//*************************************************************************
|
||||
TEST(test_read_multiple_variable_size_using_non_member_functions)
|
||||
{
|
||||
int8_t c1 = 90; // 0x5A 6 bits
|
||||
uint16_t s1 = 4660; // 0x1234 13 bits
|
||||
int32_t i1 = 0x89ABCDEF; // 0x89ABCDEF 23 bits
|
||||
int32_t i2 = 0xFEDCBA98; // 0xFEDCBA98 25 bits
|
||||
uint16_t s2 = 22136; // 0x5678 11 bits
|
||||
int8_t c2 = -91; // 0xA5 7 bits
|
||||
//int8_t c1 = 90; // 0x5A 6 bits
|
||||
//uint16_t s1 = 4660; // 0x1234 13 bits
|
||||
//int32_t i1 = 0x89ABCDEF; // 0x89ABCDEF 23 bits
|
||||
//int32_t i2 = 0xFEDCBA98; // 0xFEDCBA98 25 bits
|
||||
//uint16_t s2 = 22136; // 0x5678 11 bits
|
||||
//int8_t c2 = -91; // 0xA5 7 bits
|
||||
|
||||
std::array storage = { char(0x58), char(0xB1), char(0x3E), char(0xF6),
|
||||
char(0x7A), char(0x86), char(0x57), char(0x4E),
|
||||
@ -1153,3 +1153,4 @@ namespace
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -44,6 +44,7 @@ namespace
|
||||
uint8_t c;
|
||||
};
|
||||
|
||||
#include "etl/private/diagnostic_unused_function_push.h"
|
||||
bool operator ==(const Object& lhs, const Object& rhs)
|
||||
{
|
||||
return (lhs.s == rhs.s) &&
|
||||
@ -56,6 +57,7 @@ namespace
|
||||
os << object.s << "," << object.i << "," << (int)object.c;
|
||||
return os;
|
||||
}
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
}
|
||||
|
||||
namespace etl
|
||||
@ -791,3 +793,4 @@ namespace
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -44,6 +44,7 @@ namespace
|
||||
uint8_t c;
|
||||
};
|
||||
|
||||
#include "etl/private/diagnostic_unused_function_push.h"
|
||||
bool operator ==(const Object& lhs, const Object& rhs)
|
||||
{
|
||||
return (lhs.s == rhs.s) &&
|
||||
@ -56,6 +57,7 @@ namespace
|
||||
os << object.s << "," << object.i << "," << (int)object.c;
|
||||
return os;
|
||||
}
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
}
|
||||
|
||||
namespace etl
|
||||
|
||||
@ -48,12 +48,16 @@ namespace
|
||||
|
||||
using Point = etl::coordinate_2d<Value>;
|
||||
|
||||
#include "etl/private/diagnostic_unused_function_push.h"
|
||||
|
||||
std::ostream& operator << (std::ostream& os, const Point& point)
|
||||
{
|
||||
os << "(" << int(point.x) << "," << int(point.y) << ")";
|
||||
return os;
|
||||
}
|
||||
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
using BresenhamLine = etl::bresenham_line<Value>;
|
||||
|
||||
SUITE(test_bresenham_line)
|
||||
|
||||
@ -779,6 +779,7 @@ namespace
|
||||
|
||||
// Start the repeating timers.
|
||||
timer_controller.start(id0);
|
||||
timer_controller.start(id1);
|
||||
timer_controller.start(id2);
|
||||
timer_controller.start(id3);
|
||||
|
||||
|
||||
@ -511,17 +511,17 @@ namespace
|
||||
Data data;
|
||||
data.push(input1.begin(), input1.end());
|
||||
|
||||
for (int i = 0; i < SIZE; ++i)
|
||||
for (size_t i = 0; i < SIZE; ++i)
|
||||
{
|
||||
CHECK_EQUAL(input1[i + 3], data[i]);
|
||||
}
|
||||
|
||||
for (int i = 0; i < SIZE; ++i)
|
||||
for (size_t i = 0; i < SIZE; ++i)
|
||||
{
|
||||
data[i] = input2[i];
|
||||
}
|
||||
|
||||
for (int i = 0; i < SIZE; ++i)
|
||||
for (size_t i = 0; i < SIZE; ++i)
|
||||
{
|
||||
CHECK_EQUAL(input2[i], data[i]);
|
||||
}
|
||||
@ -535,7 +535,7 @@ namespace
|
||||
Data data;
|
||||
data.push(input.begin(), input.end());
|
||||
|
||||
for (int i = 0; i < SIZE; ++i)
|
||||
for (size_t i = 0; i < SIZE; ++i)
|
||||
{
|
||||
CHECK_EQUAL(input[i + 3], data[i]);
|
||||
}
|
||||
|
||||
@ -521,17 +521,17 @@ namespace
|
||||
Data data(buffer1.raw, SIZE);
|
||||
data.push(input1.begin(), input1.end());
|
||||
|
||||
for (int i = 0; i < SIZE; ++i)
|
||||
for (int i = 0; i < int(SIZE); ++i)
|
||||
{
|
||||
CHECK_EQUAL(input1[i + 3], data[i]);
|
||||
}
|
||||
|
||||
for (int i = 0; i < SIZE; ++i)
|
||||
for (int i = 0; i < int(SIZE); ++i)
|
||||
{
|
||||
data[i] = input2[i];
|
||||
}
|
||||
|
||||
for (int i = 0; i < SIZE; ++i)
|
||||
for (int i = 0; i < int(SIZE); ++i)
|
||||
{
|
||||
CHECK_EQUAL(input2[i], data[i]);
|
||||
}
|
||||
@ -545,7 +545,7 @@ namespace
|
||||
Data data(buffer1.raw, SIZE);
|
||||
data.push(input.begin(), input.end());
|
||||
|
||||
for (int i = 0; i < SIZE; ++i)
|
||||
for (int i = 0; i < int(SIZE); ++i)
|
||||
{
|
||||
CHECK_EQUAL(input[i + 3], data[i]);
|
||||
}
|
||||
|
||||
@ -327,7 +327,9 @@ namespace
|
||||
DataNDC deque1(initial_data.begin(), initial_data.end());
|
||||
DataNDC deque2(deque1);
|
||||
|
||||
#include "etl/private/diagnostic_self_assign_overloaded_push.h"
|
||||
deque2 = deque2;
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
CHECK_EQUAL(deque1.size(), deque2.size());
|
||||
CHECK(std::equal(deque1.begin(), deque1.end(), deque2.begin()));
|
||||
|
||||
@ -471,7 +471,9 @@ namespace
|
||||
DataNDC data(initial_data.begin(), initial_data.end());
|
||||
DataNDC other_data(data);
|
||||
|
||||
#include "etl/private/diagnostic_self_assign_overloaded_push.h"
|
||||
other_data = other_data;
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
bool isEqual = Check_Equal(data.begin(),
|
||||
data.end(),
|
||||
|
||||
@ -442,7 +442,9 @@ namespace
|
||||
DataNDC data(initial_data.begin(), initial_data.end());
|
||||
DataNDC other_data(data);
|
||||
|
||||
#include "etl/private/diagnostic_self_assign_overloaded_push.h"
|
||||
other_data = other_data;
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
bool isEqual = Check_Equal(data.begin(),
|
||||
data.end(),
|
||||
|
||||
@ -404,7 +404,9 @@ namespace
|
||||
DataNDC data(initial_data.begin(), initial_data.end());
|
||||
DataNDC other_data(data);
|
||||
|
||||
#include "etl/private/diagnostic_self_assign_overloaded_push.h"
|
||||
other_data = other_data;
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
bool isEqual = std::equal(data.begin(),
|
||||
data.end(),
|
||||
@ -1239,8 +1241,6 @@ namespace
|
||||
#if ETL_USING_CPP17 && ETL_HAS_INITIALIZER_LIST && !defined(ETL_TEMPLATE_DEDUCTION_GUIDE_TESTS_DISABLED)
|
||||
TEST_FIXTURE(SetupFixture, test_flat_set_template_deduction)
|
||||
{
|
||||
using Pair = ETL_OR_STD::pair<const int, NDC>;
|
||||
|
||||
etl::flat_multiset data{ NDC("A"), NDC("B"), NDC("B2"), NDC("C"), NDC("D"), NDC("E"), NDC("F") };
|
||||
|
||||
auto v = *data.begin();
|
||||
|
||||
@ -413,7 +413,9 @@ namespace
|
||||
DataNDC data(initial_data.begin(), initial_data.end());
|
||||
DataNDC other_data(data);
|
||||
|
||||
#include "etl/private/diagnostic_self_assign_overloaded_push.h"
|
||||
other_data = other_data;
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
bool isEqual = std::equal(data.begin(),
|
||||
data.end(),
|
||||
@ -1164,8 +1166,6 @@ namespace
|
||||
#if ETL_USING_CPP17 && ETL_HAS_INITIALIZER_LIST && !defined(ETL_TEMPLATE_DEDUCTION_GUIDE_TESTS_DISABLED)
|
||||
TEST_FIXTURE(SetupFixture, test_flat_set_template_deduction)
|
||||
{
|
||||
using Pair = ETL_OR_STD::pair<const int, NDC>;
|
||||
|
||||
etl::flat_set data{ NDC("A"), NDC("B"), NDC("C"), NDC("D"), NDC("E"), NDC("F") };
|
||||
|
||||
auto v = *data.begin();
|
||||
|
||||
@ -969,7 +969,9 @@ namespace
|
||||
DataNDC data(sorted_data.begin(), sorted_data.end());
|
||||
DataNDC other_data(data);
|
||||
|
||||
#include "etl/private/diagnostic_self_assign_overloaded_push.h"
|
||||
other_data = other_data;
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
CHECK_EQUAL(data.size(), other_data.size());
|
||||
|
||||
|
||||
@ -1348,7 +1348,9 @@ namespace
|
||||
DataNDC data1(sorted_data.begin(), sorted_data.end(), pool);
|
||||
DataNDC other_data(data1, pool);
|
||||
|
||||
#include "etl/private/diagnostic_self_assign_overloaded_push.h"
|
||||
other_data = other_data;
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
CHECK_EQUAL(data1.size(), other_data.size());
|
||||
|
||||
|
||||
@ -393,7 +393,9 @@ namespace
|
||||
DataNDC data(initial_data.begin(), initial_data.end());
|
||||
DataNDC other_data(data);
|
||||
|
||||
#include "etl/private/diagnostic_self_assign_overloaded_push.h"
|
||||
other_data = other_data;
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
bool is_equal = std::equal(data.begin(),
|
||||
data.end(),
|
||||
|
||||
@ -463,7 +463,9 @@ namespace
|
||||
DataNDC data(initial_data.begin(), initial_data.end(), lookup1, pool1);
|
||||
DataNDC other_data(data, lookup2, pool2);
|
||||
|
||||
#include "etl/private/diagnostic_self_assign_overloaded_push.h"
|
||||
other_data = other_data;
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
bool is_equal = std::equal(data.begin(),
|
||||
data.end(),
|
||||
|
||||
@ -34,13 +34,6 @@ SOFTWARE.
|
||||
#include <array>
|
||||
#include <algorithm>
|
||||
|
||||
#if defined(ETL_COMPILER_GCC)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-variable"
|
||||
#else
|
||||
#pragma warning(disable:4101) // Unused variable.
|
||||
#endif
|
||||
|
||||
uint8_t rw = 0x12U;
|
||||
uint8_t ro = 0x34U;
|
||||
uint8_t wo = 0x56U;
|
||||
@ -226,7 +219,3 @@ namespace
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#if defined(ETL_COMPILER_GCC)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
@ -1204,7 +1204,9 @@ namespace
|
||||
DataNDC data(sorted_data.begin(), sorted_data.end());
|
||||
DataNDC other_data = data;
|
||||
|
||||
#include "etl/private/diagnostic_self_assign_overloaded_push.h"
|
||||
other_data = other_data;
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
CHECK_EQUAL(data.size(), other_data.size());
|
||||
|
||||
|
||||
@ -1426,7 +1426,9 @@ namespace
|
||||
DataNDC other_data(pool);
|
||||
|
||||
other_data = data;
|
||||
#include "etl/private/diagnostic_self_assign_overloaded_push.h"
|
||||
other_data = other_data;
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
CHECK_EQUAL(data.size(), other_data.size());
|
||||
|
||||
|
||||
@ -363,7 +363,9 @@ namespace
|
||||
Data data(initial_data.begin(), initial_data.end());
|
||||
Data other_data(data);
|
||||
|
||||
#include "etl/private/diagnostic_self_assign_overloaded_push.h"
|
||||
other_data = other_data;
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
bool isEqual = std::equal(data.begin(),
|
||||
data.end(),
|
||||
|
||||
@ -104,7 +104,7 @@ namespace
|
||||
}
|
||||
|
||||
template <class U>
|
||||
void operator()(U* p) const
|
||||
void operator()(U* /*p*/) const
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
@ -338,7 +338,10 @@ namespace
|
||||
Message2 message2(2.2);
|
||||
|
||||
Packet packet1(message1);
|
||||
|
||||
#include "etl/private/diagnostic_pessimizing-move_push.h"
|
||||
Packet packet2(std::move(Packet(message1)));
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
CHECK_EQUAL(MESSAGE1, packet1.get().get_message_id());
|
||||
CHECK_EQUAL(MESSAGE1, packet2.get().get_message_id());
|
||||
|
||||
@ -64,7 +64,7 @@ namespace
|
||||
{
|
||||
}
|
||||
|
||||
void on_receive(const Message1& msg)
|
||||
void on_receive(const Message1&)
|
||||
{
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ namespace
|
||||
{
|
||||
}
|
||||
|
||||
void on_receive(const Message1& msg)
|
||||
void on_receive(const Message1&)
|
||||
{
|
||||
}
|
||||
|
||||
@ -106,7 +106,7 @@ namespace
|
||||
{
|
||||
}
|
||||
|
||||
void on_receive(const Message1& msg)
|
||||
void on_receive(const Message1&)
|
||||
{
|
||||
}
|
||||
|
||||
@ -127,7 +127,7 @@ namespace
|
||||
{
|
||||
}
|
||||
|
||||
void on_receive(const Message1& msg)
|
||||
void on_receive(const Message1&)
|
||||
{
|
||||
}
|
||||
|
||||
@ -148,7 +148,7 @@ namespace
|
||||
{
|
||||
}
|
||||
|
||||
void on_receive(const Message1& msg)
|
||||
void on_receive(const Message1&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@ -716,6 +716,7 @@ namespace
|
||||
|
||||
// Start the repeating timers.
|
||||
timer_controller.start(id1);
|
||||
timer_controller.start(id2);
|
||||
timer_controller.start(id3);
|
||||
timer_controller.start(id4);
|
||||
|
||||
|
||||
@ -53,6 +53,11 @@ namespace
|
||||
{
|
||||
}
|
||||
|
||||
Index(const Index& other)
|
||||
: index(other.index)
|
||||
{
|
||||
}
|
||||
|
||||
Index& operator ++()
|
||||
{
|
||||
++index;
|
||||
@ -71,7 +76,7 @@ namespace
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool operator = (const Index& other)
|
||||
Index& operator = (const Index& other)
|
||||
{
|
||||
index = other.index;
|
||||
|
||||
|
||||
@ -362,7 +362,9 @@ namespace
|
||||
Data data(initial_data.begin(), initial_data.end());
|
||||
Data other_data(data);
|
||||
|
||||
#include "etl/private/diagnostic_self_assign_overloaded_push.h"
|
||||
other_data = other_data;
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
bool isEqual = std::equal(data.begin(),
|
||||
data.end(),
|
||||
|
||||
@ -365,7 +365,9 @@ namespace
|
||||
Data data(initial_data.begin(), initial_data.end());
|
||||
Data other_data(data);
|
||||
|
||||
#include "etl/private/diagnostic_self_assign_overloaded_push.h"
|
||||
other_data = other_data;
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
bool isEqual = std::equal(data.begin(),
|
||||
data.end(),
|
||||
|
||||
@ -130,6 +130,7 @@ namespace
|
||||
//*************************************************************************
|
||||
TEST(test_moveable)
|
||||
{
|
||||
#include "etl/private/diagnostic_pessimizing-move_push.h"
|
||||
etl::optional<DataM> data(std::move(DataM(1)));
|
||||
CHECK_EQUAL(1U, data.value().value);
|
||||
CHECK(bool(data));
|
||||
@ -141,6 +142,7 @@ namespace
|
||||
etl::optional<DataM> data2(etl::move(data));
|
||||
CHECK_EQUAL(2U, data2.value().value);
|
||||
CHECK(bool(data2));
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
|
||||
@ -37,11 +37,6 @@ SOFTWARE.
|
||||
#include "etl/pool.h"
|
||||
#include "etl/largest.h"
|
||||
|
||||
#if defined(ETL_COMPILER_GCC)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
|
||||
#endif
|
||||
|
||||
typedef TestDataDC<std::string> Test_Data;
|
||||
typedef TestDataNDC<std::string> Test_Data2;
|
||||
|
||||
@ -267,6 +262,7 @@ namespace
|
||||
CHECK_EQUAL(4U, pool.available());
|
||||
|
||||
Test_Data* p;
|
||||
(void)p;
|
||||
|
||||
p = pool.allocate();
|
||||
CHECK_EQUAL(3U, pool.available());
|
||||
@ -296,6 +292,7 @@ namespace
|
||||
CHECK_EQUAL(0U, pool.size());
|
||||
|
||||
Test_Data* p;
|
||||
(void)p;
|
||||
|
||||
p = pool.allocate();
|
||||
CHECK_EQUAL(1U, pool.size());
|
||||
@ -318,6 +315,7 @@ namespace
|
||||
CHECK(!pool.full());
|
||||
|
||||
Test_Data* p;
|
||||
(void)p;
|
||||
|
||||
p = pool.allocate();
|
||||
CHECK(!pool.empty());
|
||||
@ -376,6 +374,11 @@ namespace
|
||||
double* p3 = nullptr;
|
||||
Test_Data* p4 = nullptr;
|
||||
|
||||
(void)p1;
|
||||
(void)p2;
|
||||
(void)p3;
|
||||
(void)p4;
|
||||
|
||||
CHECK_NO_THROW(p1 = pool.allocate<uint8_t>());
|
||||
CHECK_NO_THROW(p2 = pool.allocate<uint32_t>());
|
||||
CHECK_NO_THROW(p3 = pool.allocate<double>());
|
||||
@ -471,7 +474,3 @@ namespace
|
||||
CHECK_EQUAL(0, memPool.size());
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(ETL_COMPILER_GCC)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
@ -37,11 +37,6 @@ SOFTWARE.
|
||||
#include "etl/pool.h"
|
||||
#include "etl/largest.h"
|
||||
|
||||
#if defined(ETL_COMPILER_GCC)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
|
||||
#endif
|
||||
|
||||
typedef TestDataDC<std::string> Test_Data;
|
||||
typedef TestDataNDC<std::string> Test_Data2;
|
||||
|
||||
@ -282,6 +277,7 @@ namespace
|
||||
CHECK_EQUAL(4U, pool.available());
|
||||
|
||||
Test_Data* p;
|
||||
(void)p;
|
||||
|
||||
p = pool.allocate();
|
||||
CHECK_EQUAL(3U, pool.available());
|
||||
@ -320,6 +316,7 @@ namespace
|
||||
CHECK_EQUAL(0U, pool.size());
|
||||
|
||||
Test_Data* p;
|
||||
(void)p;
|
||||
|
||||
p = pool.allocate();
|
||||
CHECK_EQUAL(1U, pool.size());
|
||||
@ -347,6 +344,7 @@ namespace
|
||||
CHECK(!pool.full());
|
||||
|
||||
Test_Data* p;
|
||||
(void)p;
|
||||
|
||||
p = pool.allocate();
|
||||
CHECK(!pool.empty());
|
||||
@ -404,121 +402,123 @@ namespace
|
||||
delete[] buffer;
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST(test_create_destroy)
|
||||
{
|
||||
const size_t SIZE = 4;
|
||||
//*************************************************************************
|
||||
TEST(test_create_destroy)
|
||||
{
|
||||
const size_t SIZE = 4;
|
||||
|
||||
auto buffer0 = new etl::pool_ext<D0>::element[SIZE];
|
||||
etl::pool_ext<D0> pool0(buffer0, SIZE);
|
||||
auto buffer0 = new etl::pool_ext<D0>::element[SIZE];
|
||||
etl::pool_ext<D0> pool0(buffer0, SIZE);
|
||||
|
||||
auto buffer1 = new etl::pool_ext<D1>::element[SIZE];
|
||||
etl::pool_ext<D1> pool1(buffer1, SIZE);
|
||||
auto buffer1 = new etl::pool_ext<D1>::element[SIZE];
|
||||
etl::pool_ext<D1> pool1(buffer1, SIZE);
|
||||
|
||||
auto buffer2 = new etl::pool_ext<D2>::element[SIZE];
|
||||
etl::pool_ext<D2> pool2(buffer2, SIZE);
|
||||
auto buffer2 = new etl::pool_ext<D2>::element[SIZE];
|
||||
etl::pool_ext<D2> pool2(buffer2, SIZE);
|
||||
|
||||
auto buffer3 = new etl::pool_ext<D3>::element[SIZE];
|
||||
etl::pool_ext<D3> pool3(buffer3, SIZE);
|
||||
auto buffer3 = new etl::pool_ext<D3>::element[SIZE];
|
||||
etl::pool_ext<D3> pool3(buffer3, SIZE);
|
||||
|
||||
auto buffer4 = new etl::pool_ext<D4>::element[SIZE];
|
||||
etl::pool_ext<D4> pool4(buffer4, SIZE);
|
||||
auto buffer4 = new etl::pool_ext<D4>::element[SIZE];
|
||||
etl::pool_ext<D4> pool4(buffer4, SIZE);
|
||||
|
||||
|
||||
D0* p0 = pool0.create();
|
||||
D1* p1 = pool1.create("1");
|
||||
D2* p2 = pool2.create("1", "2");
|
||||
D3* p3 = pool3.create("1", "2", "3");
|
||||
D4* p4 = pool4.create("1", "2", "3", "4");
|
||||
D0* p0 = pool0.create();
|
||||
D1* p1 = pool1.create("1");
|
||||
D2* p2 = pool2.create("1", "2");
|
||||
D3* p3 = pool3.create("1", "2", "3");
|
||||
D4* p4 = pool4.create("1", "2", "3", "4");
|
||||
|
||||
CHECK_EQUAL(pool0.max_size() - 1, pool0.available());
|
||||
CHECK_EQUAL(1U, pool0.size());
|
||||
(void)p1;
|
||||
(void)p2;
|
||||
(void)p3;
|
||||
(void)p4;
|
||||
|
||||
CHECK_EQUAL(pool1.max_size() - 1, pool1.available());
|
||||
CHECK_EQUAL(1U, pool1.size());
|
||||
CHECK_EQUAL(pool0.max_size() - 1, pool0.available());
|
||||
CHECK_EQUAL(1U, pool0.size());
|
||||
|
||||
CHECK_EQUAL(pool2.max_size() - 1, pool2.available());
|
||||
CHECK_EQUAL(1U, pool2.size());
|
||||
CHECK_EQUAL(pool1.max_size() - 1, pool1.available());
|
||||
CHECK_EQUAL(1U, pool1.size());
|
||||
|
||||
CHECK_EQUAL(pool3.max_size() - 1, pool3.available());
|
||||
CHECK_EQUAL(1U, pool3.size());
|
||||
CHECK_EQUAL(pool2.max_size() - 1, pool2.available());
|
||||
CHECK_EQUAL(1U, pool2.size());
|
||||
|
||||
CHECK_EQUAL(pool4.max_size() - 1, pool4.available());
|
||||
CHECK_EQUAL(1U, pool4.size());
|
||||
CHECK_EQUAL(pool3.max_size() - 1, pool3.available());
|
||||
CHECK_EQUAL(1U, pool3.size());
|
||||
|
||||
CHECK_EQUAL(D0(), *p0);
|
||||
CHECK_EQUAL(D1("1"), *p1);
|
||||
CHECK_EQUAL(D2("1", "2"), *p2);
|
||||
CHECK_EQUAL(D3("1", "2", "3"), *p3);
|
||||
CHECK_EQUAL(D4("1", "2", "3", "4"), *p4);
|
||||
CHECK_EQUAL(pool4.max_size() - 1, pool4.available());
|
||||
CHECK_EQUAL(1U, pool4.size());
|
||||
|
||||
pool0.destroy<D0>(p0);
|
||||
pool1.destroy<D1>(p1);
|
||||
pool2.destroy<D2>(p2);
|
||||
pool3.destroy<D3>(p3);
|
||||
pool4.destroy<D4>(p4);
|
||||
CHECK_EQUAL(D0(), *p0);
|
||||
CHECK_EQUAL(D1("1"), *p1);
|
||||
CHECK_EQUAL(D2("1", "2"), *p2);
|
||||
CHECK_EQUAL(D3("1", "2", "3"), *p3);
|
||||
CHECK_EQUAL(D4("1", "2", "3", "4"), *p4);
|
||||
|
||||
CHECK_EQUAL(pool0.max_size(), pool0.available());
|
||||
CHECK_EQUAL(0U, pool0.size());
|
||||
pool0.destroy<D0>(p0);
|
||||
pool1.destroy<D1>(p1);
|
||||
pool2.destroy<D2>(p2);
|
||||
pool3.destroy<D3>(p3);
|
||||
pool4.destroy<D4>(p4);
|
||||
|
||||
CHECK_EQUAL(pool1.max_size(), pool1.available());
|
||||
CHECK_EQUAL(0U, pool1.size());
|
||||
CHECK_EQUAL(pool0.max_size(), pool0.available());
|
||||
CHECK_EQUAL(0U, pool0.size());
|
||||
|
||||
CHECK_EQUAL(pool2.max_size(), pool2.available());
|
||||
CHECK_EQUAL(0U, pool2.size());
|
||||
CHECK_EQUAL(pool1.max_size(), pool1.available());
|
||||
CHECK_EQUAL(0U, pool1.size());
|
||||
|
||||
CHECK_EQUAL(pool3.max_size(), pool3.available());
|
||||
CHECK_EQUAL(0U, pool3.size());
|
||||
CHECK_EQUAL(pool2.max_size(), pool2.available());
|
||||
CHECK_EQUAL(0U, pool2.size());
|
||||
|
||||
CHECK_EQUAL(pool4.max_size(), pool4.available());
|
||||
CHECK_EQUAL(0U, pool4.size());
|
||||
CHECK_EQUAL(pool3.max_size(), pool3.available());
|
||||
CHECK_EQUAL(0U, pool3.size());
|
||||
|
||||
delete[] buffer0;
|
||||
delete[] buffer1;
|
||||
delete[] buffer2;
|
||||
delete[] buffer3;
|
||||
delete[] buffer4;
|
||||
}
|
||||
CHECK_EQUAL(pool4.max_size(), pool4.available());
|
||||
CHECK_EQUAL(0U, pool4.size());
|
||||
|
||||
//*************************************************************************
|
||||
TEST(test_allocate_release_non_class)
|
||||
{
|
||||
const size_t SIZE = 4;
|
||||
auto buffer = new etl::pool_ext<int>::element[SIZE];
|
||||
etl::pool_ext<int> pool(buffer, SIZE);
|
||||
delete[] buffer0;
|
||||
delete[] buffer1;
|
||||
delete[] buffer2;
|
||||
delete[] buffer3;
|
||||
delete[] buffer4;
|
||||
}
|
||||
|
||||
int* i = pool.allocate();
|
||||
pool.release(i);
|
||||
//*************************************************************************
|
||||
TEST(test_allocate_release_non_class)
|
||||
{
|
||||
const size_t SIZE = 4;
|
||||
auto buffer = new etl::pool_ext<int>::element[SIZE];
|
||||
etl::pool_ext<int> pool(buffer, SIZE);
|
||||
|
||||
delete[] buffer;
|
||||
}
|
||||
int* i = pool.allocate();
|
||||
pool.release(i);
|
||||
|
||||
delete[] buffer;
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST(test_issue_406_pool_of_c_array)
|
||||
{
|
||||
using elem_type = uint8_t[10];
|
||||
//*************************************************************************
|
||||
TEST(test_issue_406_pool_of_c_array)
|
||||
{
|
||||
using elem_type = uint8_t[10];
|
||||
|
||||
const size_t SIZE = 3;
|
||||
auto buffer = new etl::pool_ext<elem_type>::element[SIZE];
|
||||
etl::pool_ext<elem_type> memPool(buffer, SIZE);
|
||||
const size_t SIZE = 3;
|
||||
auto buffer = new etl::pool_ext<elem_type>::element[SIZE];
|
||||
etl::pool_ext<elem_type> memPool(buffer, SIZE);
|
||||
|
||||
CHECK_EQUAL(3, memPool.available());
|
||||
CHECK_EQUAL(0, memPool.size());
|
||||
CHECK_EQUAL(3, memPool.available());
|
||||
CHECK_EQUAL(0, memPool.size());
|
||||
|
||||
elem_type* memory = memPool.allocate();
|
||||
elem_type* memory = memPool.allocate();
|
||||
|
||||
CHECK_EQUAL(2, memPool.available());
|
||||
CHECK_EQUAL(1, memPool.size());
|
||||
CHECK_EQUAL(2, memPool.available());
|
||||
CHECK_EQUAL(1, memPool.size());
|
||||
|
||||
memPool.release(memory);
|
||||
memPool.release(memory);
|
||||
|
||||
CHECK_EQUAL(3, memPool.available());
|
||||
CHECK_EQUAL(0, memPool.size());
|
||||
CHECK_EQUAL(3, memPool.available());
|
||||
CHECK_EQUAL(0, memPool.size());
|
||||
|
||||
delete[] buffer;
|
||||
delete[] buffer;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#if defined(ETL_COMPILER_GCC)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
@ -571,7 +571,10 @@ namespace
|
||||
|
||||
etl::priority_queue<int, SIZE> priority_queue2 = priority_queue1;
|
||||
|
||||
#include "etl/private/diagnostic_self_assign_overloaded_push.h"
|
||||
priority_queue1 = priority_queue1;
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
|
||||
CHECK(priority_queue1.size() == priority_queue2.size());
|
||||
|
||||
|
||||
@ -538,7 +538,9 @@ namespace
|
||||
queue.push(3);
|
||||
queue.push(4);
|
||||
|
||||
#include "etl/private/diagnostic_self_assign_overloaded_push.h"
|
||||
queue = queue;
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
CHECK(queue.max_size() == queue.size());
|
||||
|
||||
|
||||
@ -521,8 +521,10 @@ namespace
|
||||
queue.push(3);
|
||||
queue.push(4);
|
||||
|
||||
#include "etl/private/diagnostic_self_assign_overloaded_push.h"
|
||||
queue = queue;
|
||||
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
CHECK(queue.max_size() == queue.size());
|
||||
|
||||
CHECK_EQUAL(1, queue.front());
|
||||
|
||||
@ -98,10 +98,10 @@ namespace
|
||||
return (lhs < rhs.k);
|
||||
}
|
||||
|
||||
bool operator <(const Key& lhs, const Key& rhs)
|
||||
{
|
||||
return (lhs.k < rhs.k);
|
||||
}
|
||||
//bool operator <(const Key& lhs, const Key& rhs)
|
||||
//{
|
||||
// return (lhs.k < rhs.k);
|
||||
//}
|
||||
|
||||
SUITE(test_set)
|
||||
{
|
||||
@ -330,7 +330,9 @@ namespace
|
||||
Data data(initial_data.begin(), initial_data.end());
|
||||
Data otherData(data);
|
||||
|
||||
#include "etl/private/diagnostic_self_assign_overloaded_push.h"
|
||||
data = data;
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
bool isEqual = Check_Equal(data.begin(),
|
||||
data.end(),
|
||||
|
||||
@ -80,17 +80,17 @@ namespace
|
||||
{
|
||||
}
|
||||
|
||||
void on_receive(const Message1& message)
|
||||
void on_receive(const Message1&)
|
||||
{
|
||||
++count_message1;
|
||||
}
|
||||
|
||||
void on_receive(const Message2& message)
|
||||
void on_receive(const Message2&)
|
||||
{
|
||||
++count_message2;
|
||||
}
|
||||
|
||||
void on_receive_unknown(const etl::imessage& message)
|
||||
void on_receive_unknown(const etl::imessage&)
|
||||
{
|
||||
|
||||
}
|
||||
@ -118,12 +118,12 @@ namespace
|
||||
{
|
||||
}
|
||||
|
||||
void on_receive(const Message1& message)
|
||||
void on_receive(const Message1&)
|
||||
{
|
||||
++count_message1;
|
||||
}
|
||||
|
||||
void on_receive_unknown(const etl::imessage& message)
|
||||
void on_receive_unknown(const etl::imessage&)
|
||||
{
|
||||
++count_unknown_message;
|
||||
}
|
||||
@ -173,7 +173,7 @@ namespace
|
||||
return rcm2;
|
||||
}
|
||||
|
||||
void release(const etl::ireference_counted_message& msg) override
|
||||
void release(const etl::ireference_counted_message&) override
|
||||
{
|
||||
// Do nothing.
|
||||
}
|
||||
@ -182,7 +182,9 @@ namespace
|
||||
//*************************************************************************
|
||||
TEST(test_move_constructor)
|
||||
{
|
||||
#include "etl/private/diagnostic_pessimizing-move_push.h"
|
||||
etl::shared_message sm1(std::move(etl::shared_message(message_pool, Message1(1))));
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
CHECK_EQUAL(1, sm1.get_reference_count());
|
||||
}
|
||||
|
||||
@ -194,11 +196,17 @@ namespace
|
||||
Message2& m2 = prcm->get_message(); // Check that we can get a non-const reference to the message.
|
||||
const Message2& cm2 = prcm->get_message(); // Check that we can get a const reference to the message.
|
||||
|
||||
(void)m2;
|
||||
(void)cm2;
|
||||
|
||||
etl::shared_message sm1(*prcm);
|
||||
|
||||
etl::imessage& im = sm1.get_message(); // Check that we can get a non-const reference to the message.
|
||||
const etl::imessage& cim = sm1.get_message(); // Check that we can get a const reference to the message.
|
||||
|
||||
(void)im;
|
||||
(void)cim;
|
||||
|
||||
CHECK_EQUAL(1, sm1.get_reference_count());
|
||||
CHECK(sm1.is_valid());
|
||||
}
|
||||
@ -207,7 +215,9 @@ namespace
|
||||
TEST(test_move_assignment)
|
||||
{
|
||||
etl::shared_message sm2 = etl::shared_message(message_pool, Message1(2));
|
||||
#include "etl/private/diagnostic_pessimizing-move_push.h"
|
||||
sm2 = std::move(etl::shared_message(message_pool, Message1(3)));
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
CHECK_EQUAL(1, sm2.get_reference_count());
|
||||
CHECK(sm2.is_valid());
|
||||
}
|
||||
@ -266,6 +276,8 @@ namespace
|
||||
CHECK_NO_THROW(prcm = message_pool.allocate<Message1>(3));
|
||||
CHECK_NO_THROW(prcm = message_pool.allocate<Message1>(4));
|
||||
|
||||
(void)prcm;
|
||||
|
||||
try
|
||||
{
|
||||
prcm = message_pool.allocate<Message1>(5);
|
||||
|
||||
@ -412,10 +412,10 @@ namespace
|
||||
View view(etldata);
|
||||
CView cview = view;
|
||||
|
||||
CHECK_EQUAL(etldata.size(), view.size());
|
||||
CHECK_EQUAL(etldata.max_size(), view.max_size());
|
||||
CHECK_EQUAL(etldata.size(), cview.size());
|
||||
CHECK_EQUAL(etldata.max_size(), cview.max_size());
|
||||
|
||||
bool isEqual = std::equal(view.begin(), view.end(), etldata.begin());
|
||||
bool isEqual = std::equal(cview.begin(), cview.end(), etldata.begin());
|
||||
CHECK(isEqual);
|
||||
}
|
||||
|
||||
@ -693,7 +693,7 @@ namespace
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
void f_issue_481(etl::span<const char, 10> value)
|
||||
void f_issue_481(etl::span<const char, 10>)
|
||||
{
|
||||
}
|
||||
|
||||
@ -705,6 +705,8 @@ namespace
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
#include "etl/private/diagnostic_unused_function_push.h"
|
||||
|
||||
struct C_issue_482 {};
|
||||
|
||||
void f_issue_482(etl::span<char>)
|
||||
@ -741,7 +743,7 @@ namespace
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
void f_issue_486(etl::span<const char, 11> value)
|
||||
void f_issue_486(etl::span<const char, 11>)
|
||||
{
|
||||
}
|
||||
|
||||
@ -755,5 +757,6 @@ namespace
|
||||
// Should not compile.
|
||||
//f_issue_486(c);
|
||||
}
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
};
|
||||
}
|
||||
|
||||
@ -412,10 +412,10 @@ namespace
|
||||
View view(etldata);
|
||||
CView cview = view;
|
||||
|
||||
CHECK_EQUAL(etldata.size(), view.size());
|
||||
CHECK_EQUAL(etldata.max_size(), view.max_size());
|
||||
CHECK_EQUAL(etldata.size(), cview.size());
|
||||
CHECK_EQUAL(etldata.max_size(), cview.max_size());
|
||||
|
||||
bool isEqual = std::equal(view.begin(), view.end(), etldata.begin());
|
||||
bool isEqual = std::equal(cview.begin(), cview.end(), etldata.begin());
|
||||
CHECK(isEqual);
|
||||
}
|
||||
|
||||
@ -683,7 +683,7 @@ namespace
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
void f_issue_481(etl::span<const char, 10> value)
|
||||
void f_issue_481(etl::span<const char, 10>)
|
||||
{
|
||||
}
|
||||
|
||||
@ -695,6 +695,8 @@ namespace
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
#include "etl/private/diagnostic_unused_function_push.h"
|
||||
|
||||
struct C_issue_482 {};
|
||||
|
||||
void f_issue_482(etl::span<char>)
|
||||
@ -731,7 +733,7 @@ namespace
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
void f_issue_486(etl::span<const char, 11> value)
|
||||
void f_issue_486(etl::span<const char, 11>)
|
||||
{
|
||||
}
|
||||
|
||||
@ -745,5 +747,7 @@ namespace
|
||||
// Should not compile.
|
||||
//f_issue_486(c);
|
||||
}
|
||||
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
};
|
||||
}
|
||||
|
||||
@ -491,8 +491,10 @@ namespace
|
||||
stack.push(3);
|
||||
stack.push(4);
|
||||
|
||||
#include "etl/private/diagnostic_self_assign_overloaded_push.h"
|
||||
stack = stack;
|
||||
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
CHECK(stack.max_size() == stack.size());
|
||||
|
||||
CHECK_EQUAL(4, stack.top());
|
||||
|
||||
@ -485,7 +485,9 @@ namespace
|
||||
Text text(initial_text.begin(), initial_text.end());
|
||||
Text other_text(text);
|
||||
|
||||
#include "etl/private/diagnostic_self_assign_overloaded_push.h"
|
||||
other_text = other_text;
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
bool is_equal = Equal(text, other_text);
|
||||
|
||||
@ -502,7 +504,9 @@ namespace
|
||||
Text text(longer_text.begin(), longer_text.end());
|
||||
Text other_text(text);
|
||||
|
||||
#include "etl/private/diagnostic_self_assign_overloaded_push.h"
|
||||
other_text = other_text;
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
bool is_equal = Equal(text, other_text);
|
||||
|
||||
|
||||
@ -613,7 +613,9 @@ namespace
|
||||
TextBuffer buffer2;
|
||||
Text other_text(text, buffer2.data(), buffer2.size());
|
||||
|
||||
#include "etl/private/diagnostic_self_assign_overloaded_push.h"
|
||||
other_text = other_text;
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
bool is_equal = Equal(text, other_text);
|
||||
|
||||
@ -633,7 +635,9 @@ namespace
|
||||
TextBuffer buffer2;
|
||||
Text other_text(text, buffer2.data(), buffer2.size());
|
||||
|
||||
#include "etl/private/diagnostic_self_assign_overloaded_push.h"
|
||||
other_text = other_text;
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
bool is_equal = Equal(text, other_text);
|
||||
|
||||
|
||||
@ -47,20 +47,20 @@ namespace
|
||||
}
|
||||
|
||||
//***********************************
|
||||
std::ostream& operator << (std::ostream& os, const etl::iu16string::value_type& c)
|
||||
{
|
||||
os << uint16_t(c);
|
||||
//std::ostream& operator << (std::ostream& os, const etl::iu16string::value_type& c)
|
||||
//{
|
||||
// os << uint16_t(c);
|
||||
|
||||
return os;
|
||||
}
|
||||
// return os;
|
||||
//}
|
||||
|
||||
//***********************************
|
||||
std::ostream& operator << (std::ostream& os, const etl::iu16string::value_type* c)
|
||||
{
|
||||
os << (void*)c;
|
||||
//std::ostream& operator << (std::ostream& os, const etl::iu16string::value_type* c)
|
||||
//{
|
||||
// os << (void*)c;
|
||||
|
||||
return os;
|
||||
}
|
||||
// return os;
|
||||
//}
|
||||
|
||||
SUITE(test_string_char)
|
||||
{
|
||||
@ -501,7 +501,9 @@ namespace
|
||||
Text text(initial_text.begin(), initial_text.end());
|
||||
Text other_text(text);
|
||||
|
||||
#include "etl/private/diagnostic_self_assign_overloaded_push.h"
|
||||
other_text = other_text;
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
bool is_equal = Equal(text, other_text);
|
||||
|
||||
@ -518,7 +520,9 @@ namespace
|
||||
Text text(longer_text.begin(), longer_text.end());
|
||||
Text other_text(text);
|
||||
|
||||
#include "etl/private/diagnostic_self_assign_overloaded_push.h"
|
||||
other_text = other_text;
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
bool is_equal = Equal(text, other_text);
|
||||
|
||||
|
||||
@ -48,20 +48,20 @@ namespace
|
||||
}
|
||||
|
||||
//***********************************
|
||||
std::ostream& operator << (std::ostream& os, const etl::iu16string::value_type& c)
|
||||
{
|
||||
os << uint16_t(c);
|
||||
//std::ostream& operator << (std::ostream& os, const etl::iu16string::value_type& c)
|
||||
//{
|
||||
// os << uint16_t(c);
|
||||
|
||||
return os;
|
||||
}
|
||||
// return os;
|
||||
//}
|
||||
|
||||
//***********************************
|
||||
std::ostream& operator << (std::ostream& os, const etl::iu16string::value_type* c)
|
||||
{
|
||||
os << (void*)c;
|
||||
//std::ostream& operator << (std::ostream& os, const etl::iu16string::value_type* c)
|
||||
//{
|
||||
// os << (void*)c;
|
||||
|
||||
return os;
|
||||
}
|
||||
// return os;
|
||||
//}
|
||||
|
||||
SUITE(test_string_char)
|
||||
{
|
||||
@ -629,7 +629,9 @@ namespace
|
||||
TextBuffer buffer2;
|
||||
Text other_text(text, buffer2.data(), buffer2.size());
|
||||
|
||||
#include "etl/private/diagnostic_self_assign_overloaded_push.h"
|
||||
other_text = other_text;
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
bool is_equal = Equal(text, other_text);
|
||||
|
||||
@ -649,7 +651,9 @@ namespace
|
||||
TextBuffer buffer2;
|
||||
Text other_text(text, buffer2.data(), buffer2.size());
|
||||
|
||||
#include "etl/private/diagnostic_self_assign_overloaded_push.h"
|
||||
other_text = other_text;
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
bool is_equal = Equal(text, other_text);
|
||||
|
||||
|
||||
@ -47,20 +47,20 @@ namespace
|
||||
}
|
||||
|
||||
//***********************************
|
||||
std::ostream& operator << (std::ostream& os, const etl::iu32string::value_type& c)
|
||||
{
|
||||
os << uint32_t(c);
|
||||
//std::ostream& operator << (std::ostream& os, const etl::iu32string::value_type& c)
|
||||
//{
|
||||
// os << uint32_t(c);
|
||||
|
||||
return os;
|
||||
}
|
||||
// return os;
|
||||
//}
|
||||
|
||||
//***********************************
|
||||
std::ostream& operator << (std::ostream& os, const etl::iu32string::value_type* c)
|
||||
{
|
||||
os << (void*)c;
|
||||
//std::ostream& operator << (std::ostream& os, const etl::iu32string::value_type* c)
|
||||
//{
|
||||
// os << (void*)c;
|
||||
|
||||
return os;
|
||||
}
|
||||
// return os;
|
||||
//}
|
||||
|
||||
SUITE(test_string_char)
|
||||
{
|
||||
@ -501,7 +501,9 @@ namespace
|
||||
Text text(initial_text.begin(), initial_text.end());
|
||||
Text other_text(text);
|
||||
|
||||
#include "etl/private/diagnostic_self_assign_overloaded_push.h"
|
||||
other_text = other_text;
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
bool is_equal = Equal(text, other_text);
|
||||
|
||||
@ -518,7 +520,9 @@ namespace
|
||||
Text text(longer_text.begin(), longer_text.end());
|
||||
Text other_text(text);
|
||||
|
||||
#include "etl/private/diagnostic_self_assign_overloaded_push.h"
|
||||
other_text = other_text;
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
bool is_equal = Equal(text, other_text);
|
||||
|
||||
|
||||
@ -48,20 +48,20 @@ namespace
|
||||
}
|
||||
|
||||
//***********************************
|
||||
std::ostream& operator << (std::ostream& os, const etl::u32string_ext::value_type& c)
|
||||
{
|
||||
os << uint32_t(c);
|
||||
//std::ostream& operator << (std::ostream& os, const etl::u32string_ext::value_type& c)
|
||||
//{
|
||||
// os << uint32_t(c);
|
||||
|
||||
return os;
|
||||
}
|
||||
// return os;
|
||||
//}
|
||||
|
||||
//***********************************
|
||||
std::ostream& operator << (std::ostream& os, const etl::u32string_ext::value_type* c)
|
||||
{
|
||||
os << (void*)c;
|
||||
//std::ostream& operator << (std::ostream& os, const etl::u32string_ext::value_type* c)
|
||||
//{
|
||||
// os << (void*)c;
|
||||
|
||||
return os;
|
||||
}
|
||||
// return os;
|
||||
//}
|
||||
|
||||
SUITE(test_string_char)
|
||||
{
|
||||
@ -629,7 +629,9 @@ namespace
|
||||
TextBuffer buffer2;
|
||||
Text other_text(text, buffer2.data(), buffer2.size());
|
||||
|
||||
#include "etl/private/diagnostic_self_assign_overloaded_push.h"
|
||||
other_text = other_text;
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
bool is_equal = Equal(text, other_text);
|
||||
|
||||
@ -649,7 +651,9 @@ namespace
|
||||
TextBuffer buffer2;
|
||||
Text other_text(text, buffer2.data(), buffer2.size());
|
||||
|
||||
#include "etl/private/diagnostic_self_assign_overloaded_push.h"
|
||||
other_text = other_text;
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
bool is_equal = Equal(text, other_text);
|
||||
|
||||
|
||||
@ -41,12 +41,12 @@ SOFTWARE.
|
||||
namespace
|
||||
{
|
||||
//***********************************
|
||||
std::ostream& operator << (std::ostream& os, const std::wstring::value_type& c)
|
||||
{
|
||||
os << uint16_t(c);
|
||||
//std::ostream& operator << (std::ostream& os, const std::wstring::value_type& c)
|
||||
//{
|
||||
// os << uint16_t(c);
|
||||
|
||||
return os;
|
||||
}
|
||||
// return os;
|
||||
//}
|
||||
|
||||
SUITE(test_string_utilities_std_u16)
|
||||
{
|
||||
|
||||
@ -41,12 +41,12 @@ SOFTWARE.
|
||||
namespace
|
||||
{
|
||||
//***********************************
|
||||
std::ostream& operator << (std::ostream& os, const std::u32string::value_type& c)
|
||||
{
|
||||
os << uint32_t(c);
|
||||
//std::ostream& operator << (std::ostream& os, const std::u32string::value_type& c)
|
||||
//{
|
||||
// os << uint32_t(c);
|
||||
|
||||
return os;
|
||||
}
|
||||
// return os;
|
||||
//}
|
||||
|
||||
SUITE(test_string_utilities_std_u32)
|
||||
{
|
||||
|
||||
@ -41,12 +41,12 @@ SOFTWARE.
|
||||
namespace
|
||||
{
|
||||
//***********************************
|
||||
std::ostream& operator << (std::ostream& os, const std::wstring::value_type& c)
|
||||
{
|
||||
os << uint16_t(c);
|
||||
//std::ostream& operator << (std::ostream& os, const std::wstring::value_type& c)
|
||||
//{
|
||||
// os << uint16_t(c);
|
||||
|
||||
return os;
|
||||
}
|
||||
// return os;
|
||||
//}
|
||||
|
||||
SUITE(test_string_utilities_std_wchar_t)
|
||||
{
|
||||
|
||||
@ -39,12 +39,12 @@ SOFTWARE.
|
||||
namespace
|
||||
{
|
||||
//***********************************
|
||||
std::ostream& operator << (std::ostream& os, const std::u16string::value_type& c)
|
||||
{
|
||||
os << uint16_t(c);
|
||||
//std::ostream& operator << (std::ostream& os, const std::u16string::value_type& c)
|
||||
//{
|
||||
// os << uint16_t(c);
|
||||
|
||||
return os;
|
||||
}
|
||||
// return os;
|
||||
//}
|
||||
|
||||
SUITE(test_string_utilities_u16)
|
||||
{
|
||||
|
||||
@ -39,12 +39,12 @@ SOFTWARE.
|
||||
namespace
|
||||
{
|
||||
//***********************************
|
||||
std::ostream& operator << (std::ostream& os, const etl::iu32string::value_type& c)
|
||||
{
|
||||
os << uint32_t(c);
|
||||
//std::ostream& operator << (std::ostream& os, const etl::iu32string::value_type& c)
|
||||
//{
|
||||
// os << uint32_t(c);
|
||||
|
||||
return os;
|
||||
}
|
||||
// return os;
|
||||
//}
|
||||
|
||||
SUITE(test_string_utilities_u32)
|
||||
{
|
||||
|
||||
@ -39,12 +39,12 @@ SOFTWARE.
|
||||
namespace
|
||||
{
|
||||
//***********************************
|
||||
std::ostream& operator << (std::ostream& os, const std::wstring::value_type& c)
|
||||
{
|
||||
os << uint16_t(c);
|
||||
//std::ostream& operator << (std::ostream& os, const std::wstring::value_type& c)
|
||||
//{
|
||||
// os << uint16_t(c);
|
||||
|
||||
return os;
|
||||
}
|
||||
// return os;
|
||||
//}
|
||||
|
||||
SUITE(test_string_utilities_wchar_t)
|
||||
{
|
||||
|
||||
@ -47,20 +47,20 @@ namespace
|
||||
}
|
||||
|
||||
//***********************************
|
||||
std::ostream& operator << (std::ostream& os, const etl::iwstring::value_type& c)
|
||||
{
|
||||
os << uint16_t(c);
|
||||
//std::ostream& operator << (std::ostream& os, const etl::iwstring::value_type& c)
|
||||
//{
|
||||
// os << uint16_t(c);
|
||||
|
||||
return os;
|
||||
}
|
||||
// return os;
|
||||
//}
|
||||
|
||||
//***********************************
|
||||
std::ostream& operator << (std::ostream& os, const etl::iwstring::value_type* c)
|
||||
{
|
||||
os << (void*)c;
|
||||
//std::ostream& operator << (std::ostream& os, const etl::iwstring::value_type* c)
|
||||
//{
|
||||
// os << (void*)c;
|
||||
|
||||
return os;
|
||||
}
|
||||
// return os;
|
||||
//}
|
||||
|
||||
SUITE(test_string_wchar_t)
|
||||
{
|
||||
@ -501,7 +501,9 @@ namespace
|
||||
Text text(initial_text.begin(), initial_text.end());
|
||||
Text other_text(text);
|
||||
|
||||
#include "etl/private/diagnostic_self_assign_overloaded_push.h"
|
||||
other_text = other_text;
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
bool is_equal = Equal(text, other_text);
|
||||
|
||||
@ -518,7 +520,9 @@ namespace
|
||||
Text text(longer_text.begin(), longer_text.end());
|
||||
Text other_text(text);
|
||||
|
||||
#include "etl/private/diagnostic_self_assign_overloaded_push.h"
|
||||
other_text = other_text;
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
bool is_equal = Equal(text, other_text);
|
||||
|
||||
|
||||
@ -48,20 +48,20 @@ namespace
|
||||
}
|
||||
|
||||
//***********************************
|
||||
std::ostream& operator << (std::ostream& os, const etl::iwstring::value_type& c)
|
||||
{
|
||||
os << uint16_t(c);
|
||||
//std::ostream& operator << (std::ostream& os, const etl::iwstring::value_type& c)
|
||||
//{
|
||||
// os << uint16_t(c);
|
||||
|
||||
return os;
|
||||
}
|
||||
// return os;
|
||||
//}
|
||||
|
||||
//***********************************
|
||||
std::ostream& operator << (std::ostream& os, const etl::iwstring::value_type* c)
|
||||
{
|
||||
os << (void*)c;
|
||||
//std::ostream& operator << (std::ostream& os, const etl::iwstring::value_type* c)
|
||||
//{
|
||||
// os << (void*)c;
|
||||
|
||||
return os;
|
||||
}
|
||||
// return os;
|
||||
//}
|
||||
|
||||
SUITE(test_string_char)
|
||||
{
|
||||
@ -629,7 +629,9 @@ namespace
|
||||
TextBuffer buffer2;
|
||||
Text other_text(text, buffer2.data(), buffer2.size());
|
||||
|
||||
#include "etl/private/diagnostic_self_assign_overloaded_push.h"
|
||||
other_text = other_text;
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
bool is_equal = Equal(text, other_text);
|
||||
|
||||
@ -649,7 +651,9 @@ namespace
|
||||
TextBuffer buffer2;
|
||||
Text other_text(text, buffer2.data(), buffer2.size());
|
||||
|
||||
#include "etl/private/diagnostic_self_assign_overloaded_push.h"
|
||||
other_text = other_text;
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
bool is_equal = Equal(text, other_text);
|
||||
|
||||
|
||||
@ -350,7 +350,9 @@ namespace
|
||||
DataNDC data(initial_data.begin(), initial_data.end());
|
||||
DataNDC other_data(data);
|
||||
|
||||
#include "etl/private/diagnostic_self_assign_overloaded_push.h"
|
||||
other_data = other_data;
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
bool isEqual = std::equal(data.begin(),
|
||||
data.end(),
|
||||
|
||||
@ -327,7 +327,10 @@ namespace
|
||||
DataNDC data(initial_data.begin(), initial_data.end());
|
||||
DataNDC other_data(data);
|
||||
|
||||
#include "etl/private/diagnostic_self_assign_overloaded_push.h"
|
||||
other_data = other_data;
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
|
||||
bool isEqual = std::equal(data.begin(),
|
||||
data.end(),
|
||||
|
||||
@ -206,14 +206,8 @@ 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.
|
||||
|
||||
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());
|
||||
@ -277,7 +271,9 @@ namespace
|
||||
DataNDC data(initial_data.begin(), initial_data.end());
|
||||
DataNDC other_data(data);
|
||||
|
||||
#include "etl/private/diagnostic_self_assign_overloaded_push.h"
|
||||
other_data = other_data;
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
bool isEqual = std::equal(data.begin(),
|
||||
data.end(),
|
||||
|
||||
@ -254,7 +254,9 @@ namespace
|
||||
DataNDC data(initial_data.begin(), initial_data.end());
|
||||
DataNDC other_data(data);
|
||||
|
||||
#include "etl/private/diagnostic_self_assign_overloaded_push.h"
|
||||
other_data = other_data;
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
bool isEqual = std::equal(data.begin(),
|
||||
data.end(),
|
||||
|
||||
@ -36,7 +36,6 @@ namespace
|
||||
{
|
||||
bool nonConstCalled;
|
||||
bool constCalled;
|
||||
int value;
|
||||
|
||||
void TestText(std::string&)
|
||||
{
|
||||
@ -169,7 +168,9 @@ namespace
|
||||
etl::pair<ItemM1, ItemM2> p1(1, 2.3);
|
||||
etl::pair<ItemM1, ItemM2> p2(0, 0);
|
||||
|
||||
#include "etl/private/diagnostic_pessimizing-move_push.h"
|
||||
p2 = etl::make_pair(std::move(ItemM1(1)), std::move(ItemM2(2.3)));
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
CHECK_EQUAL(p1.first, p2.first);
|
||||
CHECK_EQUAL(p1.second, p2.second);
|
||||
|
||||
@ -443,7 +443,9 @@ namespace
|
||||
test_variant_3a variant;
|
||||
|
||||
variant = 1;
|
||||
#include "etl/private/diagnostic_self_assign_overloaded_push.h"
|
||||
variant = variant;
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
CHECK_EQUAL(1, variant.get<int>());
|
||||
}
|
||||
|
||||
@ -673,7 +673,9 @@ namespace
|
||||
test_variant_etl_3 variant_etl;
|
||||
|
||||
variant_etl = 1;
|
||||
#include "etl/private/diagnostic_self_assign_overloaded_push.h"
|
||||
variant_etl = variant_etl;
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
CHECK_EQUAL(1, etl::get<int>(variant_etl));
|
||||
}
|
||||
|
||||
@ -248,7 +248,9 @@ namespace
|
||||
Data data(initial_data.begin(), initial_data.end());
|
||||
Data other_data(data);
|
||||
|
||||
#include "etl/private/diagnostic_self_assign_overloaded_push.h"
|
||||
other_data = other_data;
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
bool is_equal = std::equal(data.begin(),
|
||||
data.end(),
|
||||
|
||||
@ -241,7 +241,9 @@ namespace
|
||||
Data data(initial_data.begin(), initial_data.end(), buffer1, SIZE);
|
||||
Data other_data(data, buffer1, SIZE);
|
||||
|
||||
#include "etl/private/diagnostic_self_assign_overloaded_push.h"
|
||||
other_data = other_data;
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
bool is_equal = std::equal(data.begin(),
|
||||
data.end(),
|
||||
|
||||
@ -339,7 +339,9 @@ namespace
|
||||
DataNDC data(initial_data.begin(), initial_data.end());
|
||||
DataNDC other_data(data);
|
||||
|
||||
#include "etl/private/diagnostic_self_assign_overloaded_push.h"
|
||||
other_data = other_data;
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
bool is_equal = std::equal(data.begin(),
|
||||
data.end(),
|
||||
|
||||
@ -408,7 +408,9 @@ namespace
|
||||
Data data(initial_data.begin(), initial_data.end());
|
||||
Data other_data(data);
|
||||
|
||||
#include "etl/private/diagnostic_self_assign_overloaded_push.h"
|
||||
other_data = other_data;
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
bool is_equal = std::equal(data.begin(), data.end(), other_data.begin());
|
||||
|
||||
@ -421,7 +423,9 @@ namespace
|
||||
CData data(initial_data.begin(), initial_data.end());
|
||||
CData other_data(data);
|
||||
|
||||
#include "etl/private/diagnostic_self_assign_overloaded_push.h"
|
||||
other_data = other_data;
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
bool is_equal = std::equal(data.begin(), data.end(), other_data.begin());
|
||||
|
||||
|
||||
@ -394,7 +394,9 @@ namespace
|
||||
Data data(initial_data.begin(), initial_data.end(), buffer1, SIZE);
|
||||
Data other_data(data, buffer2, SIZE);
|
||||
|
||||
#include "etl/private/diagnostic_self_assign_overloaded_push.h"
|
||||
other_data = other_data;
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
bool is_equal = std::equal(data.begin(), data.end(), other_data.begin());
|
||||
|
||||
@ -407,7 +409,9 @@ namespace
|
||||
CData data(initial_data.begin(), initial_data.end(), buffer1, SIZE);
|
||||
CData other_data(data, buffer2, SIZE);
|
||||
|
||||
#include "etl/private/diagnostic_self_assign_overloaded_push.h"
|
||||
other_data = other_data;
|
||||
#include "etl/private/diagnostic_pop.h"
|
||||
|
||||
bool is_equal = std::equal(data.begin(), data.end(), other_data.begin());
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user