mirror of
https://github.com/ETLCPP/etl.git
synced 2026-06-20 02:46:44 +08:00
Re-enabled ETL_IN_UNIT_TEST macros
This commit is contained in:
parent
6779f87562
commit
03f9f05a76
12
src/deque.h
12
src/deque.h
@ -1797,9 +1797,17 @@ namespace etl
|
||||
//*********************************************************************
|
||||
void initialise()
|
||||
{
|
||||
while (current_size > 0)
|
||||
if (etl::is_trivially_destructible<T>::value)
|
||||
{
|
||||
destroy_element_back();
|
||||
current_size = 0;
|
||||
construct_count.clear();
|
||||
}
|
||||
else
|
||||
{
|
||||
while (current_size > 0)
|
||||
{
|
||||
destroy_element_back();
|
||||
}
|
||||
}
|
||||
|
||||
_begin = iterator(0, *this, p_buffer);
|
||||
|
||||
20
src/list.h
20
src/list.h
@ -1442,13 +1442,21 @@ namespace etl
|
||||
{
|
||||
if (!empty())
|
||||
{
|
||||
node_t* p_first = terminal_node.next;
|
||||
node_t* p_last = &terminal_node;
|
||||
|
||||
while (p_first != p_last)
|
||||
if (etl::is_trivially_destructible<T>::value)
|
||||
{
|
||||
destroy_data_node(static_cast<data_node_t&>(*p_first)); // Destroy the current node.
|
||||
p_first = p_first->next; // Move to the next node.
|
||||
p_node_pool->release_all();
|
||||
construct_count.clear();
|
||||
}
|
||||
else
|
||||
{
|
||||
node_t* p_first = terminal_node.next;
|
||||
node_t* p_last = &terminal_node;
|
||||
|
||||
while (p_first != p_last)
|
||||
{
|
||||
destroy_data_node(static_cast<data_node_t&>(*p_first)); // Destroy the current node.
|
||||
p_first = p_first->next; // Move to the next node.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -269,14 +269,14 @@ namespace etl
|
||||
/// is_pod
|
||||
/// For C++03, only fundamental and pointers types are recognised.
|
||||
///\ingroup type_traits
|
||||
#if (ETL_CPP11_SUPPORTED && !defined(ARDUINO))// && !defined(ETL_IN_UNIT_TEST)
|
||||
#if (ETL_CPP11_SUPPORTED && !defined(ARDUINO)) && !defined(ETL_IN_UNIT_TEST)
|
||||
// For compilers that support C++11
|
||||
template <typename T> struct is_pod : std::is_pod<T> {};
|
||||
#else
|
||||
template <typename T> struct is_pod : etl::integral_constant<bool, etl::is_fundamental<T>::value || etl::is_pointer<T>::value> {};
|
||||
#endif
|
||||
|
||||
#if (ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED) // && !defined(ETL_IN_UNIT_TEST)
|
||||
#if (ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED) && !defined(ETL_IN_UNIT_TEST)
|
||||
/// is_trivially_constructible
|
||||
///\ingroup type_traits
|
||||
template <typename T> struct is_trivially_constructible : std::is_trivially_constructible<T> {};
|
||||
|
||||
@ -281,14 +281,14 @@ namespace etl
|
||||
/// is_pod
|
||||
/// For C++03, only fundamental and pointers types are recognised.
|
||||
///\ingroup type_traits
|
||||
#if (ETL_CPP11_SUPPORTED && !defined(ARDUINO))// && !defined(ETL_IN_UNIT_TEST)
|
||||
#if (ETL_CPP11_SUPPORTED && !defined(ARDUINO)) && !defined(ETL_IN_UNIT_TEST)
|
||||
// For compilers that support C++11
|
||||
template <typename T> struct is_pod : std::is_pod<T> {};
|
||||
#else
|
||||
template <typename T> struct is_pod : etl::integral_constant<bool, etl::is_fundamental<T>::value || etl::is_pointer<T>::value> {};
|
||||
#endif
|
||||
|
||||
#if (ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED) // && !defined(ETL_IN_UNIT_TEST)
|
||||
#if (ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED) && !defined(ETL_IN_UNIT_TEST)
|
||||
/// is_trivially_constructible
|
||||
///\ingroup type_traits
|
||||
template <typename T> struct is_trivially_constructible : std::is_trivially_constructible<T> {};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user