diff --git a/include/etl/algorithm.h b/include/etl/algorithm.h index 8c759ac4..3a98c041 100644 --- a/include/etl/algorithm.h +++ b/include/etl/algorithm.h @@ -41,7 +41,6 @@ SOFTWARE. #include "platform.h" #include "type_traits.h" -#include "container.h" #include "iterator.h" #include "functional.h" #include "utility.h" diff --git a/include/etl/array_wrapper.h b/include/etl/array_wrapper.h index c6265673..b116c88a 100644 --- a/include/etl/array_wrapper.h +++ b/include/etl/array_wrapper.h @@ -36,7 +36,6 @@ SOFTWARE. #include "error_handler.h" #include "exception.h" #include "hash.h" -#include "container.h" #include "parameter_type.h" #include "algorithm.h" diff --git a/include/etl/basic_string.h b/include/etl/basic_string.h index 16dc4c62..7130606a 100644 --- a/include/etl/basic_string.h +++ b/include/etl/basic_string.h @@ -41,7 +41,6 @@ SOFTWARE. #include "iterator.h" #include "functional.h" #include "char_traits.h" -#include "container.h" #include "alignment.h" #include "array.h" #include "algorithm.h" diff --git a/include/etl/byte_stream.h b/include/etl/byte_stream.h index b25f0791..aebf998c 100644 --- a/include/etl/byte_stream.h +++ b/include/etl/byte_stream.h @@ -320,10 +320,6 @@ namespace etl template size_t available() const { - size_t cap = capacity(); - size_t size_b = size_bytes(); - size_t size_of_T = sizeof(T); - return (capacity() - size_bytes()) / sizeof(T); } diff --git a/include/etl/container.h b/include/etl/container.h index efdea919..369eee45 100644 --- a/include/etl/container.h +++ b/include/etl/container.h @@ -36,248 +36,5 @@ SOFTWARE. #include "platform.h" #include "iterator.h" -///\defgroup container container -///\ingroup utilities - -namespace etl -{ - //***************************************************************************** - /// Get the 'begin' iterator. - ///\ingroup container - //***************************************************************************** - template - ETL_CONSTEXPR typename TContainer::iterator begin(TContainer& container) - { - return container.begin(); - } - - //***************************************************************************** - /// Get the 'begin' const_iterator for a container. - ///\ingroup container - //***************************************************************************** - template - ETL_CONSTEXPR typename TContainer::const_iterator begin(const TContainer& container) - { - return container.begin(); - } - - //***************************************************************************** - /// Get the 'begin' const_iterator for a container. - ///\ingroup container - //***************************************************************************** - template - ETL_CONSTEXPR typename TContainer::const_iterator cbegin(const TContainer& container) - { - return container.cbegin(); - } - - //***************************************************************************** - /// Get the 'begin' reverse_iterator for a container. - ///\ingroup container - //***************************************************************************** - template - ETL_CONSTEXPR typename TContainer::reverse_iterator rbegin(const TContainer& container) - { - return container.rbegin(); - } - - //***************************************************************************** - /// Get the 'begin' reverse_iterator for a container. - ///\ingroup container - //***************************************************************************** - template - ETL_CONSTEXPR typename TContainer::reverse_iterator crbegin(const TContainer& container) - { - return container.crbegin(); - } - - //***************************************************************************** - /// Get the 'end' iterator for a container. - ///\ingroup container - //***************************************************************************** - template - ETL_CONSTEXPR typename TContainer::iterator end(TContainer& container) - { - return container.end(); - } - - //***************************************************************************** - /// Get the 'end' const_iterator for a container. - ///\ingroup container - //***************************************************************************** - template - ETL_CONSTEXPR typename TContainer::const_iterator end(const TContainer& container) - { - return container.end(); - } - - //***************************************************************************** - /// Get the 'end' const_iterator for a container. - ///\ingroup container - //***************************************************************************** - template - ETL_CONSTEXPR typename TContainer::const_iterator cend(const TContainer& container) - { - return container.cend(); - } - - //***************************************************************************** - /// Get the 'end' reverse_iterator for a container. - ///\ingroup container - //***************************************************************************** - template - ETL_CONSTEXPR typename TContainer::const_iterator rend(const TContainer& container) - { - return container.rend(); - } - - //***************************************************************************** - /// Get the 'end' reverse_iterator for a container. - ///\ingroup container - //***************************************************************************** - template - ETL_CONSTEXPR typename TContainer::reverse_iterator crend(const TContainer& container) - { - return container.crend(); - } - - //***************************************************************************** - /// Get the 'begin' pointer for an array. - ///\ingroup container - //***************************************************************************** - template - ETL_CONSTEXPR TValue* begin(TValue(&data)[ARRAY_SIZE]) - { - return &data[0]; - } - - //***************************************************************************** - /// Get the 'begin' const iterator for an array. - ///\ingroup container - //***************************************************************************** - template - ETL_CONSTEXPR const TValue* begin(const TValue(&data)[ARRAY_SIZE]) - { - return &data[0]; - } - - //***************************************************************************** - /// Get the 'begin' const iterator for an array. - ///\ingroup container - //***************************************************************************** - template - ETL_CONSTEXPR const TValue* cbegin(const TValue(&data)[ARRAY_SIZE]) - { - return &data[0]; - } - - //***************************************************************************** - /// Get the 'begin' reverse_iterator for an array. - ///\ingroup container - //***************************************************************************** - template - ETL_OR_STD::reverse_iterator rbegin(const TValue(&data)[ARRAY_SIZE]) - { - return ETL_OR_STD::reverse_iterator(&data[ARRAY_SIZE]); - } - - //***************************************************************************** - /// Get the 'begin' const reverse_iterator for an array. - ///\ingroup container - //***************************************************************************** - template - ETL_CONSTEXPR ETL_OR_STD::reverse_iterator crbegin(const TValue(&data)[ARRAY_SIZE]) - { - return ETL_OR_STD::reverse_iterator(&data[ARRAY_SIZE]); - } - - //***************************************************************************** - /// Get the 'end' iterator for an array. - ///\ingroup container - //***************************************************************************** - template - ETL_CONSTEXPR TValue* end(TValue(&data)[ARRAY_SIZE]) - { - return &data[ARRAY_SIZE]; - } - - //***************************************************************************** - /// Get the 'end' const iterator for an array. - ///\ingroup container - //***************************************************************************** - template - ETL_CONSTEXPR const TValue* end(const TValue(&data)[ARRAY_SIZE]) - { - return &data[ARRAY_SIZE]; - } - - //***************************************************************************** - /// Get the 'end' const iterator for an array. - ///\ingroup container - //***************************************************************************** - template - ETL_CONSTEXPR const TValue* cend(const TValue(&data)[ARRAY_SIZE]) - { - return &data[ARRAY_SIZE]; - } - - //***************************************************************************** - /// Get the 'end' reverse_iterator for an array. - ///\ingroup container - //***************************************************************************** - template - ETL_CONSTEXPR ETL_OR_STD::reverse_iterator rend(const TValue(&data)[ARRAY_SIZE]) - { - return ETL_OR_STD::reverse_iterator(&data[0]); - } - - //***************************************************************************** - /// Get the 'end' const reverse_iterator for an array. - ///\ingroup container - //***************************************************************************** - template - ETL_CONSTEXPR ETL_OR_STD::reverse_iterator crend(const TValue(&data)[ARRAY_SIZE]) - { - return ETL_OR_STD::reverse_iterator(&data[0]); - } - - ///************************************************************************** - /// Get the size of a container. - /// Expects the container to have defined 'size_type'. - ///\ingroup container - ///************************************************************************** - template - ETL_CONSTEXPR typename TContainer::size_type size(const TContainer& container) - { - return container.size(); - } - - ///************************************************************************** - /// Get the size of an array in elements at run time, or compile time if C++11 or above. - ///\ingroup container - ///************************************************************************** - template - ETL_CONSTEXPR size_t size(TValue(&)[ARRAY_SIZE]) - { - return ARRAY_SIZE; - } - - ///************************************************************************** - /// Get the size of an array in elements at compile time for C++03 - ///\code - /// sizeof(array_size(array)) - ///\endcode - ///\ingroup container - ///************************************************************************** - template - char(&array_size(T(&array)[ARRAY_SIZE]))[ARRAY_SIZE]; -} - -#if ETL_CPP11_SUPPORTED && !defined(ETL_FORCE_NO_ADVANCED_CPP) - #define ETL_ARRAY_SIZE(a) (etl::size(a)) -#else - #define ETL_ARRAY_SIZE(a) sizeof(etl::array_size(a)) -#endif - #endif diff --git a/include/etl/deque.h b/include/etl/deque.h index bea20faa..7fe74a0d 100644 --- a/include/etl/deque.h +++ b/include/etl/deque.h @@ -38,7 +38,6 @@ SOFTWARE. #include "algorithm.h" #include "iterator.h" #include "utility.h" -#include "container.h" #include "memory.h" #include "exception.h" #include "error_handler.h" diff --git a/include/etl/forward_list.h b/include/etl/forward_list.h index f370d124..6919e856 100644 --- a/include/etl/forward_list.h +++ b/include/etl/forward_list.h @@ -39,7 +39,6 @@ SOFTWARE. #include "functional.h" #include "utility.h" #include "pool.h" -#include "container.h" #include "exception.h" #include "error_handler.h" #include "debug_count.h" diff --git a/include/etl/iterator.h b/include/etl/iterator.h index d582ffa8..5fb8c080 100644 --- a/include/etl/iterator.h +++ b/include/etl/iterator.h @@ -686,7 +686,244 @@ namespace etl { static ETL_CONSTANT bool value = etl::is_random_access_iterator::value; }; + +#if ETL_NOT_USING_STL || ETL_CPP11_NOT_SUPPORTED + //***************************************************************************** + /// Get the 'begin' iterator. + ///\ingroup container + //***************************************************************************** + template + ETL_CONSTEXPR typename TContainer::iterator begin(TContainer& container) + { + return container.begin(); + } + + //***************************************************************************** + /// Get the 'begin' const_iterator for a container. + ///\ingroup container + //***************************************************************************** + template + ETL_CONSTEXPR typename TContainer::const_iterator begin(const TContainer& container) + { + return container.begin(); + } + + //***************************************************************************** + /// Get the 'begin' const_iterator for a container. + ///\ingroup container + //***************************************************************************** + template + ETL_CONSTEXPR typename TContainer::const_iterator cbegin(const TContainer& container) + { + return container.cbegin(); + } + + //***************************************************************************** + /// Get the 'begin' reverse_iterator for a container. + ///\ingroup container + //***************************************************************************** + template + ETL_CONSTEXPR typename TContainer::reverse_iterator rbegin(const TContainer& container) + { + return container.rbegin(); + } + + //***************************************************************************** + /// Get the 'begin' reverse_iterator for a container. + ///\ingroup container + //***************************************************************************** + template + ETL_CONSTEXPR typename TContainer::reverse_iterator crbegin(const TContainer& container) + { + return container.crbegin(); + } + + //***************************************************************************** + /// Get the 'end' iterator for a container. + ///\ingroup container + //***************************************************************************** + template + ETL_CONSTEXPR typename TContainer::iterator end(TContainer& container) + { + return container.end(); + } + + //***************************************************************************** + /// Get the 'end' const_iterator for a container. + ///\ingroup container + //***************************************************************************** + template + ETL_CONSTEXPR typename TContainer::const_iterator end(const TContainer& container) + { + return container.end(); + } + + //***************************************************************************** + /// Get the 'end' const_iterator for a container. + ///\ingroup container + //***************************************************************************** + template + ETL_CONSTEXPR typename TContainer::const_iterator cend(const TContainer& container) + { + return container.cend(); + } + + //***************************************************************************** + /// Get the 'end' reverse_iterator for a container. + ///\ingroup container + //***************************************************************************** + template + ETL_CONSTEXPR typename TContainer::const_iterator rend(const TContainer& container) + { + return container.rend(); + } + + //***************************************************************************** + /// Get the 'end' reverse_iterator for a container. + ///\ingroup container + //***************************************************************************** + template + ETL_CONSTEXPR typename TContainer::reverse_iterator crend(const TContainer& container) + { + return container.crend(); + } + + //***************************************************************************** + /// Get the 'begin' pointer for an array. + ///\ingroup container + //***************************************************************************** + template + ETL_CONSTEXPR TValue* begin(TValue(&data)[ARRAY_SIZE]) + { + return &data[0]; + } + + //***************************************************************************** + /// Get the 'begin' const iterator for an array. + ///\ingroup container + //***************************************************************************** + template + ETL_CONSTEXPR const TValue* begin(const TValue(&data)[ARRAY_SIZE]) + { + return &data[0]; + } + + //***************************************************************************** + /// Get the 'begin' const iterator for an array. + ///\ingroup container + //***************************************************************************** + template + ETL_CONSTEXPR const TValue* cbegin(const TValue(&data)[ARRAY_SIZE]) + { + return &data[0]; + } + + //***************************************************************************** + /// Get the 'begin' reverse_iterator for an array. + ///\ingroup container + //***************************************************************************** + template + ETL_OR_STD::reverse_iterator rbegin(const TValue(&data)[ARRAY_SIZE]) + { + return ETL_OR_STD::reverse_iterator(&data[ARRAY_SIZE]); + } + + //***************************************************************************** + /// Get the 'begin' const reverse_iterator for an array. + ///\ingroup container + //***************************************************************************** + template + ETL_CONSTEXPR ETL_OR_STD::reverse_iterator crbegin(const TValue(&data)[ARRAY_SIZE]) + { + return ETL_OR_STD::reverse_iterator(&data[ARRAY_SIZE]); + } + + //***************************************************************************** + /// Get the 'end' iterator for an array. + ///\ingroup container + //***************************************************************************** + template + ETL_CONSTEXPR TValue* end(TValue(&data)[ARRAY_SIZE]) + { + return &data[ARRAY_SIZE]; + } + + //***************************************************************************** + /// Get the 'end' const iterator for an array. + ///\ingroup container + //***************************************************************************** + template + ETL_CONSTEXPR const TValue* end(const TValue(&data)[ARRAY_SIZE]) + { + return &data[ARRAY_SIZE]; + } + + //***************************************************************************** + /// Get the 'end' const iterator for an array. + ///\ingroup container + //***************************************************************************** + template + ETL_CONSTEXPR const TValue* cend(const TValue(&data)[ARRAY_SIZE]) + { + return &data[ARRAY_SIZE]; + } + + //***************************************************************************** + /// Get the 'end' reverse_iterator for an array. + ///\ingroup container + //***************************************************************************** + template + ETL_CONSTEXPR ETL_OR_STD::reverse_iterator rend(const TValue(&data)[ARRAY_SIZE]) + { + return ETL_OR_STD::reverse_iterator(&data[0]); + } + + //***************************************************************************** + /// Get the 'end' const reverse_iterator for an array. + ///\ingroup container + //***************************************************************************** + template + ETL_CONSTEXPR ETL_OR_STD::reverse_iterator crend(const TValue(&data)[ARRAY_SIZE]) + { + return ETL_OR_STD::reverse_iterator(&data[0]); + } +#endif + +#if ETL_NOT_USING_STL || ETL_CPP17_NOT_SUPPORTED + ///************************************************************************** + /// Get the size of a container. + /// Expects the container to have defined 'size_type'. + ///\ingroup container + ///************************************************************************** + template + ETL_CONSTEXPR typename TContainer::size_type size(const TContainer& container) + { + return container.size(); + } + + ///************************************************************************** + /// Get the size of an array in elements at run time, or compile time if C++11 or above. + ///\ingroup container + ///************************************************************************** + template + ETL_CONSTEXPR size_t size(TValue(&)[ARRAY_SIZE]) + { + return ARRAY_SIZE; + } +#endif + + ///************************************************************************** + /// Get the size of an array in elements at compile time for C++03 + ///\code + /// sizeof(array_size(array)) + ///\endcode + ///\ingroup container + ///************************************************************************** + template + char(&array_size(T(&array)[ARRAY_SIZE]))[ARRAY_SIZE]; } +#define ETL_ARRAY_SIZE(a) sizeof(etl::array_size(a)) + #endif diff --git a/include/etl/list.h b/include/etl/list.h index fec826d2..406bb9fe 100644 --- a/include/etl/list.h +++ b/include/etl/list.h @@ -37,7 +37,6 @@ SOFTWARE. #include "algorithm.h" #include "iterator.h" #include "functional.h" -#include "container.h" #include "pool.h" #include "exception.h" #include "error_handler.h" diff --git a/include/etl/map.h b/include/etl/map.h index 1b56358d..5ab89fe5 100644 --- a/include/etl/map.h +++ b/include/etl/map.h @@ -37,7 +37,6 @@ SOFTWARE. #include "algorithm.h" #include "iterator.h" #include "functional.h" -#include "container.h" #include "pool.h" #include "exception.h" #include "error_handler.h" diff --git a/include/etl/multimap.h b/include/etl/multimap.h index 0b61482e..14c8a905 100644 --- a/include/etl/multimap.h +++ b/include/etl/multimap.h @@ -37,7 +37,6 @@ SOFTWARE. #include "algorithm.h" #include "iterator.h" #include "functional.h" -#include "container.h" #include "pool.h" #include "exception.h" #include "error_handler.h" diff --git a/include/etl/multiset.h b/include/etl/multiset.h index faa1f9af..21e32a2d 100644 --- a/include/etl/multiset.h +++ b/include/etl/multiset.h @@ -38,7 +38,6 @@ SOFTWARE. #include "iterator.h" #include "functional.h" #include "parameter_type.h" -#include "container.h" #include "pool.h" #include "exception.h" #include "error_handler.h" diff --git a/include/etl/pearson.h b/include/etl/pearson.h index c2592937..f9571c73 100644 --- a/include/etl/pearson.h +++ b/include/etl/pearson.h @@ -38,7 +38,7 @@ SOFTWARE. #include "type_traits.h" #include "ihash.h" #include "array.h" -#include "container.h" +#include "iterator.h" ETL_STATIC_ASSERT(ETL_8BIT_SUPPORT, "This file does not currently support targets with no 8bit type"); diff --git a/include/etl/priority_queue.h b/include/etl/priority_queue.h index df06d3ef..9734df70 100644 --- a/include/etl/priority_queue.h +++ b/include/etl/priority_queue.h @@ -38,7 +38,7 @@ SOFTWARE. #include "algorithm.h" #include "utility.h" #include "functional.h" -#include "container.h" +#include "iterator.h" #include "vector.h" #include "type_traits.h" #include "parameter_type.h" diff --git a/include/etl/private/choose_namespace.h b/include/etl/private/choose_namespace.h index d594abee..922228a3 100644 --- a/include/etl/private/choose_namespace.h +++ b/include/etl/private/choose_namespace.h @@ -32,6 +32,7 @@ SOFTWARE. #define ETL_CHOOSE_NAMESPACE_INCLUDED #undef ETL_OR_STD +#undef ETL_OR_STD11 #if ETL_NOT_USING_STL && !defined(ETL_IN_UNIT_TEST) // If we're not using the STL and we are not unit testing, then use the ETL's definitions under the etl namespace @@ -41,4 +42,12 @@ SOFTWARE. #define ETL_OR_STD std #endif +#if (ETL_NOT_USING_STL && !defined(ETL_IN_UNIT_TEST)) || ETL_CPP11_NOT_SUPPORTED + // If we're not using the STL and we are not unit testing or C++11 is not supported, then use the ETL's definitions under the etl namespace +#define ETL_OR_STD11 etl +#else + // We will use the STL's definitions under the std namespace +#define ETL_OR_STD11 std +#endif + #endif diff --git a/include/etl/private/to_string_helper.h b/include/etl/private/to_string_helper.h index 496d56d0..65782b34 100644 --- a/include/etl/private/to_string_helper.h +++ b/include/etl/private/to_string_helper.h @@ -46,6 +46,10 @@ SOFTWARE. #include "../iterator.h" #include "../limits.h" +#if ETL_USING_STL && ETL_CPP11_SUPPORTED + #include // For std::begin, std::end and std::size +#endif + namespace etl { namespace private_to_string @@ -107,11 +111,11 @@ namespace etl { if (value) { - str.insert(str.end(), etl::begin(t), etl::end(t)); + str.insert(str.end(), ETL_OR_STD11::begin(t), ETL_OR_STD11::end(t)); } else { - str.insert(str.end(), etl::begin(f), etl::end(f)); + str.insert(str.end(), ETL_OR_STD11::begin(f), ETL_OR_STD11::end(f)); } } else @@ -228,11 +232,11 @@ namespace etl if (not_a_number) { - str.insert(str.end(), etl::begin(n), etl::end(n)); + str.insert(str.end(), ETL_OR_STD11::begin(n), ETL_OR_STD11::end(n)); } else if (infinity) { - str.insert(str.end(), etl::begin(i), etl::end(i)); + str.insert(str.end(), ETL_OR_STD11::begin(i), ETL_OR_STD11::end(i)); } } diff --git a/include/etl/queue.h b/include/etl/queue.h index 3c797954..40236523 100644 --- a/include/etl/queue.h +++ b/include/etl/queue.h @@ -35,7 +35,7 @@ SOFTWARE. #include #include "platform.h" -#include "container.h" +#include "iterator.h" #include "alignment.h" #include "array.h" #include "exception.h" diff --git a/include/etl/set.h b/include/etl/set.h index d202600b..88f8bc5f 100644 --- a/include/etl/set.h +++ b/include/etl/set.h @@ -34,7 +34,6 @@ SOFTWARE. #include #include "platform.h" -#include "container.h" #include "pool.h" #include "exception.h" #include "error_handler.h" diff --git a/include/etl/stack.h b/include/etl/stack.h index 95095730..b6c61e72 100644 --- a/include/etl/stack.h +++ b/include/etl/stack.h @@ -37,7 +37,7 @@ SOFTWARE. #include "platform.h" #include "algorithm.h" #include "utility.h" -#include "container.h" +#include "iterator.h" #include "alignment.h" #include "array.h" #include "exception.h" diff --git a/include/etl/unordered_map.h b/include/etl/unordered_map.h index 553bfd42..13171efa 100644 --- a/include/etl/unordered_map.h +++ b/include/etl/unordered_map.h @@ -38,7 +38,6 @@ SOFTWARE. #include "iterator.h" #include "functional.h" #include "utility.h" -#include "container.h" #include "pool.h" #include "array.h" #include "intrusive_forward_list.h" diff --git a/include/etl/unordered_multimap.h b/include/etl/unordered_multimap.h index 77bb2794..a2714b8d 100644 --- a/include/etl/unordered_multimap.h +++ b/include/etl/unordered_multimap.h @@ -38,7 +38,6 @@ SOFTWARE. #include "iterator.h" #include "functional.h" #include "utility.h" -#include "container.h" #include "pool.h" #include "vector.h" #include "intrusive_forward_list.h" diff --git a/include/etl/unordered_multiset.h b/include/etl/unordered_multiset.h index f8d6e4a6..b0b0e2bf 100644 --- a/include/etl/unordered_multiset.h +++ b/include/etl/unordered_multiset.h @@ -38,7 +38,6 @@ SOFTWARE. #include "iterator.h" #include "functional.h" #include "utility.h" -#include "container.h" #include "pool.h" #include "vector.h" #include "intrusive_forward_list.h" diff --git a/include/etl/unordered_set.h b/include/etl/unordered_set.h index e0baa4f3..d7df5d33 100644 --- a/include/etl/unordered_set.h +++ b/include/etl/unordered_set.h @@ -38,7 +38,6 @@ SOFTWARE. #include "iterator.h" #include "functional.h" #include "utility.h" -#include "container.h" #include "pool.h" #include "vector.h" #include "intrusive_forward_list.h" diff --git a/include/etl/vector.h b/include/etl/vector.h index 86ef4053..cab5bb3a 100644 --- a/include/etl/vector.h +++ b/include/etl/vector.h @@ -42,7 +42,6 @@ SOFTWARE. #include "type_traits.h" #include "error_handler.h" #include "memory.h" -#include "container.h" #include "alignment.h" #include "array.h" #include "exception.h" diff --git a/test/runsanitychecks.sh b/test/runsanitychecks.sh index e3579bd1..3ca8d4b7 100755 --- a/test/runsanitychecks.sh +++ b/test/runsanitychecks.sh @@ -468,5 +468,5 @@ fi { echo "" echo "-----------------------------------------------" -echo " Completed" +echo " All Checks Completed OK" echo "-----------------------------------------------"; } | tee -a ../log.txt diff --git a/test/runtests.sh b/test/runtests.sh index a1040d61..01e488a3 100755 --- a/test/runtests.sh +++ b/test/runtests.sh @@ -174,5 +174,5 @@ else fi echo "" echo "-----------------------------------------------" | tee -a log.txt -echo " Tests Completed" | tee -a log.txt +echo " All Tests Completed OK" | tee -a log.txt echo "-----------------------------------------------" | tee -a log.txt diff --git a/test/test_algorithm.cpp b/test/test_algorithm.cpp index 0a38faf0..8c30281a 100644 --- a/test/test_algorithm.cpp +++ b/test/test_algorithm.cpp @@ -274,7 +274,7 @@ namespace int* p1 = std::is_sorted_until(std::begin(data), std::end(data), std::greater()); int* p2 = etl::is_sorted_until(std::begin(data), std::end(data), std::greater()); - CHECK_EQUAL(std::distance(etl::begin(data), p1), std::distance(std::begin(data), p2)); + CHECK_EQUAL(std::distance(std::begin(data), p1), std::distance(std::begin(data), p2)); } //************************************************************************* @@ -1601,7 +1601,7 @@ namespace etl::transform_s(std::begin(input), std::end(input), std::begin(output), - std::begin(output) + (etl::size(output) / 2), + std::begin(output) + (std::size(output) / 2), std::bind(std::multiplies(), std::placeholders::_1, 2)); bool is_same = std::equal(std::begin(output), std::end(output), std::begin(compare)); @@ -1610,7 +1610,7 @@ namespace std::fill(std::begin(output), std::end(output), 0); etl::transform_s(std::begin(input), - std::begin(input) + (etl::size(input) / 2), + std::begin(input) + (std::size(input) / 2), std::begin(output), std::end(output), std::bind(std::multiplies(), std::placeholders::_1, 2)); diff --git a/test/test_container.cpp b/test/test_container.cpp index 34955c98..bebcf2fa 100644 --- a/test/test_container.cpp +++ b/test/test_container.cpp @@ -32,6 +32,8 @@ SOFTWARE. #include +#if ETL_NOT_USING_STL + namespace { SUITE(test_container) @@ -145,3 +147,5 @@ namespace } }; } + +#endif diff --git a/test/test_fsm.cpp b/test/test_fsm.cpp index 5e22d5a0..4ffb55af 100644 --- a/test/test_fsm.cpp +++ b/test/test_fsm.cpp @@ -341,7 +341,7 @@ namespace CHECK(motorControl.is_producer()); CHECK(motorControl.is_consumer()); - motorControl.Initialise(stateList, etl::size(stateList)); + motorControl.Initialise(stateList, std::size(stateList)); motorControl.reset(); motorControl.ClearStatistics(); @@ -480,7 +480,7 @@ namespace { etl::null_message_router nmr; - motorControl.Initialise(stateList, etl::size(stateList)); + motorControl.Initialise(stateList, std::size(stateList)); motorControl.reset(); motorControl.ClearStatistics(); @@ -529,7 +529,7 @@ namespace { etl::null_message_router nmr; - motorControl.Initialise(stateList, etl::size(stateList)); + motorControl.Initialise(stateList, std::size(stateList)); motorControl.reset(); motorControl.ClearStatistics(); diff --git a/test/test_hfsm.cpp b/test/test_hfsm.cpp index 3042fe82..b95c1779 100644 --- a/test/test_hfsm.cpp +++ b/test/test_hfsm.cpp @@ -424,9 +424,9 @@ namespace CHECK(motorControl.is_producer()); CHECK(motorControl.is_consumer()); - running.set_child_states(childStates, etl::size(childStates)); + running.set_child_states(childStates, std::size(childStates)); - motorControl.Initialise(stateList, etl::size(stateList)); + motorControl.Initialise(stateList, std::size(stateList)); motorControl.reset(); motorControl.ClearStatistics(); @@ -597,7 +597,7 @@ namespace { etl::null_message_router nmr; - motorControl.Initialise(stateList, etl::size(stateList)); + motorControl.Initialise(stateList, std::size(stateList)); motorControl.reset(); motorControl.ClearStatistics(); @@ -650,7 +650,7 @@ namespace { etl::null_message_router nmr; - motorControl.Initialise(stateList, etl::size(stateList)); + motorControl.Initialise(stateList, std::size(stateList)); motorControl.reset(); motorControl.ClearStatistics(); @@ -704,7 +704,7 @@ namespace { etl::null_message_router nmr; - motorControl.Initialise(stateList, etl::size(stateList)); + motorControl.Initialise(stateList, std::size(stateList)); motorControl.reset(); motorControl.ClearStatistics(); diff --git a/test/test_string_char_external_buffer.cpp b/test/test_string_char_external_buffer.cpp index c8bed91b..d767f1fe 100644 --- a/test/test_string_char_external_buffer.cpp +++ b/test/test_string_char_external_buffer.cpp @@ -152,12 +152,12 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_default_constructor_use_array_buffer) { - Text text(array_text, etl::size(array_text)); + Text text(array_text, std::size(array_text)); CHECK_EQUAL(0U, text.size()); CHECK(text.empty()); - CHECK_EQUAL(etl::size(array_text) - 1, text.capacity()); - CHECK_EQUAL(etl::size(array_text) - 1, text.max_size()); + CHECK_EQUAL(std::size(array_text) - 1, text.capacity()); + CHECK_EQUAL(std::size(array_text) - 1, text.max_size()); CHECK(text.begin() == text.end()); #if ETL_STRING_TRUNCATION_CHECKS_ENABLED CHECK(!text.is_truncated()); @@ -167,12 +167,12 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_default_constructor_use_array_buffer_text) { - Text text(array_text, array_text, etl::size(array_text)); + Text text(array_text, array_text, std::size(array_text)); CHECK_EQUAL(text.size(), etl::strlen(array_text)); CHECK(!text.empty()); - CHECK_EQUAL(etl::size(array_text) - 1, text.capacity()); - CHECK_EQUAL(etl::size(array_text) - 1, text.max_size()); + CHECK_EQUAL(std::size(array_text) - 1, text.capacity()); + CHECK_EQUAL(std::size(array_text) - 1, text.max_size()); CHECK(text.begin() != text.end()); #if ETL_STRING_TRUNCATION_CHECKS_ENABLED CHECK(!text.is_truncated()); diff --git a/test/test_string_u16_external_buffer.cpp b/test/test_string_u16_external_buffer.cpp index 7752ebff..4b5ff2f6 100644 --- a/test/test_string_u16_external_buffer.cpp +++ b/test/test_string_u16_external_buffer.cpp @@ -152,12 +152,12 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_default_constructor_use_array_buffer) { - Text text(array_text, etl::size(array_text)); + Text text(array_text, std::size(array_text)); CHECK_EQUAL(0U, text.size()); CHECK(text.empty()); - CHECK_EQUAL(etl::size(array_text) - 1, text.capacity()); - CHECK_EQUAL(etl::size(array_text) - 1, text.max_size()); + CHECK_EQUAL(std::size(array_text) - 1, text.capacity()); + CHECK_EQUAL(std::size(array_text) - 1, text.max_size()); CHECK(text.begin() == text.end()); #if ETL_STRING_TRUNCATION_CHECKS_ENABLED CHECK(!text.is_truncated()); @@ -167,12 +167,12 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_default_constructor_use_array_buffer_text) { - Text text(array_text, array_text, etl::size(array_text)); + Text text(array_text, array_text, std::size(array_text)); CHECK_EQUAL(text.size(), etl::strlen(array_text)); CHECK(!text.empty()); - CHECK_EQUAL(etl::size(array_text) - 1, text.capacity()); - CHECK_EQUAL(etl::size(array_text) - 1, text.max_size()); + CHECK_EQUAL(std::size(array_text) - 1, text.capacity()); + CHECK_EQUAL(std::size(array_text) - 1, text.max_size()); CHECK(text.begin() != text.end()); #if ETL_STRING_TRUNCATION_CHECKS_ENABLED CHECK(!text.is_truncated()); diff --git a/test/test_string_u32_external_buffer.cpp b/test/test_string_u32_external_buffer.cpp index fa070d2a..e1c23071 100644 --- a/test/test_string_u32_external_buffer.cpp +++ b/test/test_string_u32_external_buffer.cpp @@ -152,12 +152,12 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_default_constructor_use_array_buffer) { - Text text(array_text, etl::size(array_text)); + Text text(array_text, std::size(array_text)); CHECK_EQUAL(0U, text.size()); CHECK(text.empty()); - CHECK_EQUAL(etl::size(array_text) - 1, text.capacity()); - CHECK_EQUAL(etl::size(array_text) - 1, text.max_size()); + CHECK_EQUAL(std::size(array_text) - 1, text.capacity()); + CHECK_EQUAL(std::size(array_text) - 1, text.max_size()); CHECK(text.begin() == text.end()); #if ETL_STRING_TRUNCATION_CHECKS_ENABLED CHECK(!text.is_truncated()); @@ -167,12 +167,12 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_default_constructor_use_array_buffer_text) { - Text text(array_text, array_text, etl::size(array_text)); + Text text(array_text, array_text, std::size(array_text)); CHECK_EQUAL(text.size(), etl::strlen(array_text)); CHECK(!text.empty()); - CHECK_EQUAL(etl::size(array_text) - 1, text.capacity()); - CHECK_EQUAL(etl::size(array_text) - 1, text.max_size()); + CHECK_EQUAL(std::size(array_text) - 1, text.capacity()); + CHECK_EQUAL(std::size(array_text) - 1, text.max_size()); CHECK(text.begin() != text.end()); #if ETL_STRING_TRUNCATION_CHECKS_ENABLED CHECK(!text.is_truncated()); diff --git a/test/test_string_utilities.cpp b/test/test_string_utilities.cpp index e7b72b2b..3b736d67 100644 --- a/test/test_string_utilities.cpp +++ b/test/test_string_utilities.cpp @@ -33,6 +33,8 @@ SOFTWARE. #include "etl/string_utilities.h" #include "etl/vector.h" +#include + #undef STR #define STR(x) x @@ -910,7 +912,7 @@ namespace { STR(':'), STR('_') } }; - etl::replace_characters(text, etl::begin(lookup), etl::end(lookup)); + etl::replace_characters(text, ETL_OR_STD11::begin(lookup), ETL_OR_STD11::end(lookup)); CHECK(expected == text); } @@ -930,7 +932,7 @@ namespace { STR(':'), STR('_') } }; - etl::replace_characters(text, etl::begin(lookup), etl::end(lookup)); + etl::replace_characters(text, ETL_OR_STD11::begin(lookup), ETL_OR_STD11::end(lookup)); CHECK(expected == text); } @@ -950,7 +952,7 @@ namespace { STR(":"), STR(".txt") } }; - etl::replace_strings(text, etl::begin(lookup), etl::end(lookup)); + etl::replace_strings(text, ETL_OR_STD11::begin(lookup), ETL_OR_STD11::end(lookup)); CHECK(expected == text); } @@ -970,7 +972,7 @@ namespace { STR(":"), STR(".txt") } }; - etl::replace_strings(text, etl::begin(lookup), etl::end(lookup)); + etl::replace_strings(text, ETL_OR_STD11::begin(lookup), ETL_OR_STD11::end(lookup)); CHECK(expected == text); } diff --git a/test/test_string_utilities_std.cpp b/test/test_string_utilities_std.cpp index a5f7a8a7..b3bdbd90 100644 --- a/test/test_string_utilities_std.cpp +++ b/test/test_string_utilities_std.cpp @@ -35,6 +35,8 @@ SOFTWARE. #include "etl/string_utilities.h" +#include + #undef STR #define STR(x) x @@ -909,7 +911,7 @@ namespace { STR(':'), STR('_') } }; - etl::replace_characters(text, etl::begin(lookup), etl::end(lookup)); + etl::replace_characters(text, ETL_OR_STD11::begin(lookup), ETL_OR_STD11::end(lookup)); CHECK(expected == text); } @@ -929,7 +931,7 @@ namespace { STR(':'), STR('_') } }; - etl::replace_characters(text, etl::begin(lookup), etl::end(lookup)); + etl::replace_characters(text, ETL_OR_STD11::begin(lookup), ETL_OR_STD11::end(lookup)); CHECK(expected == text); } @@ -949,7 +951,7 @@ namespace { STR(":"), STR(".txt") } }; - etl::replace_strings(text, etl::begin(lookup), etl::end(lookup)); + etl::replace_strings(text, ETL_OR_STD11::begin(lookup), ETL_OR_STD11::end(lookup)); CHECK(expected == text); } @@ -969,7 +971,7 @@ namespace { STR(":"), STR(".txt") } }; - etl::replace_strings(text, etl::begin(lookup), etl::end(lookup)); + etl::replace_strings(text, ETL_OR_STD11::begin(lookup), ETL_OR_STD11::end(lookup)); CHECK(expected == text); } diff --git a/test/test_string_utilities_std_u16.cpp b/test/test_string_utilities_std_u16.cpp index a92ae88e..3c2d1d14 100644 --- a/test/test_string_utilities_std_u16.cpp +++ b/test/test_string_utilities_std_u16.cpp @@ -909,7 +909,7 @@ namespace { STR(':'), STR('_') } }; - etl::replace_characters(text, etl::begin(lookup), etl::end(lookup)); + etl::replace_characters(text, ETL_OR_STD11::begin(lookup), ETL_OR_STD11::end(lookup)); CHECK(expected == text); } @@ -929,7 +929,7 @@ namespace { STR(':'), STR('_') } }; - etl::replace_characters(text, etl::begin(lookup), etl::end(lookup)); + etl::replace_characters(text, ETL_OR_STD11::begin(lookup), ETL_OR_STD11::end(lookup)); CHECK(expected == text); } @@ -949,7 +949,7 @@ namespace { STR(":"), STR(".txt") } }; - etl::replace_strings(text, etl::begin(lookup), etl::end(lookup)); + etl::replace_strings(text, ETL_OR_STD11::begin(lookup), ETL_OR_STD11::end(lookup)); CHECK(expected == text); } @@ -969,7 +969,7 @@ namespace { STR(":"), STR(".txt") } }; - etl::replace_strings(text, etl::begin(lookup), etl::end(lookup)); + etl::replace_strings(text, ETL_OR_STD11::begin(lookup), ETL_OR_STD11::end(lookup)); CHECK(expected == text); } diff --git a/test/test_string_utilities_std_u32.cpp b/test/test_string_utilities_std_u32.cpp index db00f4fc..b56ed472 100644 --- a/test/test_string_utilities_std_u32.cpp +++ b/test/test_string_utilities_std_u32.cpp @@ -909,7 +909,7 @@ namespace { STR(':'), STR('_') } }; - etl::replace_characters(text, etl::begin(lookup), etl::end(lookup)); + etl::replace_characters(text, ETL_OR_STD11::begin(lookup), ETL_OR_STD11::end(lookup)); CHECK(expected == text); } @@ -929,7 +929,7 @@ namespace { STR(':'), STR('_') } }; - etl::replace_characters(text, etl::begin(lookup), etl::end(lookup)); + etl::replace_characters(text, ETL_OR_STD11::begin(lookup), ETL_OR_STD11::end(lookup)); CHECK(expected == text); } @@ -949,7 +949,7 @@ namespace { STR(":"), STR(".txt") } }; - etl::replace_strings(text, etl::begin(lookup), etl::end(lookup)); + etl::replace_strings(text, ETL_OR_STD11::begin(lookup), ETL_OR_STD11::end(lookup)); CHECK(expected == text); } @@ -969,7 +969,7 @@ namespace { STR(":"), STR(".txt") } }; - etl::replace_strings(text, etl::begin(lookup), etl::end(lookup)); + etl::replace_strings(text, ETL_OR_STD11::begin(lookup), ETL_OR_STD11::end(lookup)); CHECK(expected == text); } diff --git a/test/test_string_utilities_std_wchar_t.cpp b/test/test_string_utilities_std_wchar_t.cpp index b2d3e81d..6ef1e6df 100644 --- a/test/test_string_utilities_std_wchar_t.cpp +++ b/test/test_string_utilities_std_wchar_t.cpp @@ -909,7 +909,7 @@ namespace { STR(':'), STR('_') } }; - etl::replace_characters(text, etl::begin(lookup), etl::end(lookup)); + etl::replace_characters(text, ETL_OR_STD11::begin(lookup), ETL_OR_STD11::end(lookup)); CHECK(expected == text); } @@ -929,7 +929,7 @@ namespace { STR(':'), STR('_') } }; - etl::replace_characters(text, etl::begin(lookup), etl::end(lookup)); + etl::replace_characters(text, ETL_OR_STD11::begin(lookup), ETL_OR_STD11::end(lookup)); CHECK(expected == text); } @@ -949,7 +949,7 @@ namespace { STR(":"), STR(".txt") } }; - etl::replace_strings(text, etl::begin(lookup), etl::end(lookup)); + etl::replace_strings(text, ETL_OR_STD11::begin(lookup), ETL_OR_STD11::end(lookup)); CHECK(expected == text); } @@ -969,7 +969,7 @@ namespace { STR(":"), STR(".txt") } }; - etl::replace_strings(text, etl::begin(lookup), etl::end(lookup)); + etl::replace_strings(text, ETL_OR_STD11::begin(lookup), ETL_OR_STD11::end(lookup)); CHECK(expected == text); } diff --git a/test/test_string_utilities_u16.cpp b/test/test_string_utilities_u16.cpp index 68db161f..9d26a3fa 100644 --- a/test/test_string_utilities_u16.cpp +++ b/test/test_string_utilities_u16.cpp @@ -909,7 +909,7 @@ namespace { STR(':'), STR('_') } }; - etl::replace_characters(text, etl::begin(lookup), etl::end(lookup)); + etl::replace_characters(text, ETL_OR_STD11::begin(lookup), ETL_OR_STD11::end(lookup)); CHECK(expected == text); } @@ -929,7 +929,7 @@ namespace { STR(':'), STR('_') } }; - etl::replace_characters(text, etl::begin(lookup), etl::end(lookup)); + etl::replace_characters(text, ETL_OR_STD11::begin(lookup), ETL_OR_STD11::end(lookup)); CHECK(expected == text); } @@ -949,7 +949,7 @@ namespace { STR(":"), STR(".txt") } }; - etl::replace_strings(text, etl::begin(lookup), etl::end(lookup)); + etl::replace_strings(text, ETL_OR_STD11::begin(lookup), ETL_OR_STD11::end(lookup)); CHECK(expected == text); } @@ -969,7 +969,7 @@ namespace { STR(":"), STR(".txt") } }; - etl::replace_strings(text, etl::begin(lookup), etl::end(lookup)); + etl::replace_strings(text, ETL_OR_STD11::begin(lookup), ETL_OR_STD11::end(lookup)); CHECK(expected == text); } diff --git a/test/test_string_utilities_u32.cpp b/test/test_string_utilities_u32.cpp index 9b8968a7..d71f543d 100644 --- a/test/test_string_utilities_u32.cpp +++ b/test/test_string_utilities_u32.cpp @@ -909,7 +909,7 @@ namespace { STR(':'), STR('_') } }; - etl::replace_characters(text, etl::begin(lookup), etl::end(lookup)); + etl::replace_characters(text, ETL_OR_STD11::begin(lookup), ETL_OR_STD11::end(lookup)); CHECK(expected == text); } @@ -929,7 +929,7 @@ namespace { STR(':'), STR('_') } }; - etl::replace_characters(text, etl::begin(lookup), etl::end(lookup)); + etl::replace_characters(text, ETL_OR_STD11::begin(lookup), ETL_OR_STD11::end(lookup)); CHECK(expected == text); } @@ -949,7 +949,7 @@ namespace { STR(":"), STR(".txt") } }; - etl::replace_strings(text, etl::begin(lookup), etl::end(lookup)); + etl::replace_strings(text, ETL_OR_STD11::begin(lookup), ETL_OR_STD11::end(lookup)); CHECK(expected == text); } @@ -969,7 +969,7 @@ namespace { STR(":"), STR(".txt") } }; - etl::replace_strings(text, etl::begin(lookup), etl::end(lookup)); + etl::replace_strings(text, ETL_OR_STD11::begin(lookup), ETL_OR_STD11::end(lookup)); CHECK(expected == text); } diff --git a/test/test_string_utilities_wchar_t.cpp b/test/test_string_utilities_wchar_t.cpp index 1bae082f..c4a55833 100644 --- a/test/test_string_utilities_wchar_t.cpp +++ b/test/test_string_utilities_wchar_t.cpp @@ -909,7 +909,7 @@ namespace { STR(':'), STR('_') } }; - etl::replace_characters(text, etl::begin(lookup), etl::end(lookup)); + etl::replace_characters(text, ETL_OR_STD11::begin(lookup), ETL_OR_STD11::end(lookup)); CHECK(expected == text); } @@ -929,7 +929,7 @@ namespace { STR(':'), STR('_') } }; - etl::replace_characters(text, etl::begin(lookup), etl::end(lookup)); + etl::replace_characters(text, ETL_OR_STD11::begin(lookup), ETL_OR_STD11::end(lookup)); CHECK(expected == text); } @@ -949,7 +949,7 @@ namespace { STR(":"), STR(".txt") } }; - etl::replace_strings(text, etl::begin(lookup), etl::end(lookup)); + etl::replace_strings(text, ETL_OR_STD11::begin(lookup), ETL_OR_STD11::end(lookup)); CHECK(expected == text); } @@ -969,7 +969,7 @@ namespace { STR(":"), STR(".txt") } }; - etl::replace_strings(text, etl::begin(lookup), etl::end(lookup)); + etl::replace_strings(text, ETL_OR_STD11::begin(lookup), ETL_OR_STD11::end(lookup)); CHECK(expected == text); } diff --git a/test/test_string_wchar_t_external_buffer.cpp b/test/test_string_wchar_t_external_buffer.cpp index 325a7c89..5194c7a4 100644 --- a/test/test_string_wchar_t_external_buffer.cpp +++ b/test/test_string_wchar_t_external_buffer.cpp @@ -152,12 +152,12 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_default_constructor_use_array_buffer) { - Text text(array_text, etl::size(array_text)); + Text text(array_text, std::size(array_text)); CHECK_EQUAL(0U, text.size()); CHECK(text.empty()); - CHECK_EQUAL(etl::size(array_text) - 1, text.capacity()); - CHECK_EQUAL(etl::size(array_text) - 1, text.max_size()); + CHECK_EQUAL(std::size(array_text) - 1, text.capacity()); + CHECK_EQUAL(std::size(array_text) - 1, text.max_size()); CHECK(text.begin() == text.end()); #if ETL_STRING_TRUNCATION_CHECKS_ENABLED CHECK(!text.is_truncated()); @@ -167,12 +167,12 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_default_constructor_use_array_buffer_text) { - Text text(array_text, array_text, etl::size(array_text)); + Text text(array_text, array_text, std::size(array_text)); CHECK_EQUAL(text.size(), etl::strlen(array_text)); CHECK(!text.empty()); - CHECK_EQUAL(etl::size(array_text) - 1, text.capacity()); - CHECK_EQUAL(etl::size(array_text) - 1, text.max_size()); + CHECK_EQUAL(std::size(array_text) - 1, text.capacity()); + CHECK_EQUAL(std::size(array_text) - 1, text.max_size()); CHECK(text.begin() != text.end()); #if ETL_STRING_TRUNCATION_CHECKS_ENABLED CHECK(!text.is_truncated()); diff --git a/test/test_task_scheduler.cpp b/test/test_task_scheduler.cpp index bb3e7cd6..eae40399 100644 --- a/test/test_task_scheduler.cpp +++ b/test/test_task_scheduler.cpp @@ -181,7 +181,7 @@ namespace common.Clear(); - s.add_task_list(taskList, etl::size(taskList)); + s.add_task_list(taskList, std::size(taskList)); CHECK(task1.task_added); CHECK(task2.task_added); @@ -204,7 +204,7 @@ namespace s.set_idle_callback(common.idle_callback); s.set_watchdog_callback(common.watchdog_callback); - s.add_task_list(taskList, etl::size(taskList)); + s.add_task_list(taskList, std::size(taskList)); s.start(); // If 'start' returns then the idle callback was sucessfully called. WorkList_t expected = { "T3W1", "T2W1", "T1W1", "T3W2", "T2W2", "T1W2", "T3W3", "T2W3", "T1W3", "T2W4" }; @@ -229,7 +229,7 @@ namespace s.set_idle_callback(common.idle_callback); s.set_watchdog_callback(common.watchdog_callback); - s.add_task_list(taskList, etl::size(taskList)); + s.add_task_list(taskList, std::size(taskList)); s.start(); // If 'start' returns then the idle callback was sucessfully called. WorkList_t expected = { "T3W1", "T3W2", "T2W1", "T2W2", "T2W3", "T2W4", "T1W1", "T1W2", "T1W3", "T3W3" }; @@ -254,7 +254,7 @@ namespace s.set_idle_callback(common.idle_callback); s.set_watchdog_callback(common.watchdog_callback); - s.add_task_list(taskList, etl::size(taskList)); + s.add_task_list(taskList, std::size(taskList)); s.start(); // If 'start' returns then the idle callback was sucessfully called. WorkList_t expected = { "T3W1", "T3W2", "T2W1", "T2W2", "T3W3", "T2W3", "T2W4", "T1W1", "T1W2", "T1W3" }; @@ -279,7 +279,7 @@ namespace s.set_idle_callback(common.idle_callback); s.set_watchdog_callback(common.watchdog_callback); - s.add_task_list(taskList, etl::size(taskList)); + s.add_task_list(taskList, std::size(taskList)); s.start(); // If 'start' returns then the idle callback was sucessfully called. WorkList_t expected = { "T2W1", "T2W2", "T1W1", "T3W1", "T2W3", "T3W2", "T1W2", "T3W3", "T2W4", "T1W3" }; diff --git a/test/test_vector.cpp b/test/test_vector.cpp index 0c4f1676..daffb823 100644 --- a/test/test_vector.cpp +++ b/test/test_vector.cpp @@ -1221,7 +1221,7 @@ namespace const S raw[6] = { 1, 2, 3, 4, 5, 6 }; - etl::vector dest(etl::begin(raw), etl::end(raw)); + etl::vector dest(ETL_OR_STD11::begin(raw), ETL_OR_STD11::end(raw)); etl::vector src((size_t) 2, S(8)); dest.insert(dest.begin(), src.begin(), src.end()); @@ -1254,7 +1254,7 @@ namespace const S raw[6] = { 1, 2, 3, 4, 5, 6 }; - etl::vector dest(etl::begin(raw), etl::end(raw)); + etl::vector dest(ETL_OR_STD11::begin(raw), ETL_OR_STD11::end(raw)); dest.insert(dest.begin(), 2, S(8)); @@ -1280,7 +1280,7 @@ namespace TEST(remove) { const int raw[10] = { 1, 8, 2, 7, 7, 7, 4, 5, 10, 9 }; - etl::vector data(etl::begin(raw), etl::end(raw)); + etl::vector data(ETL_OR_STD11::begin(raw), ETL_OR_STD11::end(raw)); std::array expected = { 1, 8, 2, 4, 5, 10, 9 }; etl::erase(data, 7); @@ -1295,7 +1295,7 @@ namespace TEST(remove_if) { const int raw[10] = { 1, 8, 2, 7, 7, 7, 4, 5, 10, 9 }; - etl::vector data(etl::begin(raw), etl::end(raw)); + etl::vector data(ETL_OR_STD11::begin(raw), ETL_OR_STD11::end(raw)); std::array expected = { 1, 2, 4, 5 }; etl::erase_if(data, [](int value) { return value >= 7; }); diff --git a/test/test_vector_external_buffer.cpp b/test/test_vector_external_buffer.cpp index c245d15f..e0ecd8f1 100644 --- a/test/test_vector_external_buffer.cpp +++ b/test/test_vector_external_buffer.cpp @@ -1149,7 +1149,7 @@ namespace const S raw[6] = { 1, 2, 3, 4, 5, 6 }; - etl::vector_ext dest(etl::begin(raw), etl::end(raw), sbuffer1, SIZE); + etl::vector_ext dest(std::begin(raw), std::end(raw), sbuffer1, SIZE); etl::vector_ext src((size_t) 2, S(8), sbuffer2, SIZE); dest.insert(dest.begin(), src.begin(), src.end()); @@ -1184,7 +1184,7 @@ namespace const S raw[6] = { 1, 2, 3, 4, 5, 6 }; - etl::vector_ext dest(etl::begin(raw), etl::end(raw), sbuffer1, SIZE); + etl::vector_ext dest(ETL_OR_STD11::begin(raw), ETL_OR_STD11::end(raw), sbuffer1, SIZE); dest.insert(dest.begin(), 2, S(8));