#787 etl::expected doesn't compile with ETL_LOG_ERRORS

Updated CI scripts
#786 u8string
#783 Cannot insert existing value to full set
#781 etl::multi_span::iterator::operator *() fails if first span is empty
#780 endian enum_type produces useless-cast warnings
#779 hash.h: warnings produced with -Wfloat-equal
This commit is contained in:
John Wellbelove 2023-11-24 09:59:35 +00:00
parent f5879a757a
commit 63d1a64e6c
82 changed files with 4035 additions and 3902 deletions

View File

@ -76,9 +76,8 @@ namespace etl
//*****************************************************************************
inline bool is_aligned(void* p, size_t required_alignment)
{
uintptr_t alignment = static_cast<uintptr_t>(required_alignment);
uintptr_t address = reinterpret_cast<uintptr_t>(p);
return (address % alignment) == 0U;
return (address % required_alignment) == 0U;
}
//*****************************************************************************
@ -88,7 +87,7 @@ namespace etl
bool is_aligned(void* p)
{
uintptr_t address = reinterpret_cast<uintptr_t>(p);
return (address % static_cast<uintptr_t>(Alignment)) == 0U;
return (address % Alignment) == 0U;
}
//*****************************************************************************

View File

@ -350,7 +350,8 @@ namespace etl
{
unsigned char mask_width = static_cast<unsigned char>(etl::min(nbits, bits_available_in_char));
nbits -= mask_width;
uint32_t mask = ((uint32_t(1U) << mask_width) - 1U) << nbits;
uint32_t mask = ((1U << mask_width) - 1U) << nbits;
//uint32_t mask = ((uint32_t(1U) << mask_width) - 1U) << nbits;
// Move chunk to lowest char bits.
// Chunks are never larger than one char.
@ -628,7 +629,7 @@ namespace etl
void write_unchecked(bool value)
{
unsigned char chunk = value ? 1 : 0;
write_data<unsigned char>(static_cast<unsigned char>(chunk), 1);
write_data<unsigned char>(chunk, 1);
}
//***************************************************************************

View File

@ -261,7 +261,7 @@ namespace etl
//***************************************************************************
void restart(size_t n = 0U)
{
pcurrent = const_cast<char*>(pdata + n);
pcurrent = pdata + n;
}
//***************************************************************************

View File

@ -56,6 +56,24 @@ namespace etl
typedef char state_type;
};
template<> struct char_traits_types<signed char>
{
typedef signed char char_type;
typedef int int_type;
typedef long long off_type;
typedef size_t pos_type;
typedef signed char state_type;
};
template<> struct char_traits_types<unsigned char>
{
typedef unsigned char char_type;
typedef int int_type;
typedef long long off_type;
typedef size_t pos_type;
typedef unsigned char state_type;
};
template<> struct char_traits_types<wchar_t>
{
typedef wchar_t char_type;
@ -65,6 +83,7 @@ namespace etl
typedef char state_type;
};
#if ETL_USING_CPP20
template<> struct char_traits_types<char8_t>
{
typedef char8_t char_type;
@ -73,6 +92,7 @@ namespace etl
typedef size_t pos_type;
typedef char state_type;
};
#endif
template<> struct char_traits_types<char16_t>
{

View File

@ -55,7 +55,7 @@ namespace etl
void add_sample(bool sample)
{
// Changed from last time?
if (sample != bool((flags & Sample) != 0))
if (sample != ((flags & Sample) != 0))
{
count = 0;
flags = (flags & ~Sample) | (sample ? Sample : 0);

View File

@ -49,9 +49,9 @@ SOFTWARE.
#if !defined(ETL_ENDIAN_NATIVE)
// Can we use the C++20 definitions?
#if ETL_USING_CPP20 && ETL_USING_STL
#define ETL_ENDIAN_LITTLE std::endian::little
#define ETL_ENDIAN_BIG std::endian::big
#define ETL_ENDIAN_NATIVE std::endian::native
#define ETL_ENDIAN_LITTLE static_cast<int>(std::endian::little)
#define ETL_ENDIAN_BIG static_cast<int>(std::endian::big)
#define ETL_ENDIAN_NATIVE static_cast<int>(std::endian::native)
// Is this the IAR compiler?
#elif defined(ETL_COMPILER_IAR) && defined(__LITTLE_ENDIAN__)
#define ETL_ENDIAN_LITTLE 0
@ -100,14 +100,14 @@ namespace etl
{
enum enum_type
{
little = static_cast<int>(ETL_ENDIAN_LITTLE),
big = static_cast<int>(ETL_ENDIAN_BIG),
native = static_cast<int>(ETL_ENDIAN_NATIVE),
little = ETL_ENDIAN_LITTLE,
big = ETL_ENDIAN_BIG,
native = ETL_ENDIAN_NATIVE
};
ETL_DECLARE_ENUM_TYPE(endian, int)
ETL_ENUM_TYPE(little, "little")
ETL_ENUM_TYPE(big, "big")
ETL_ENUM_TYPE(little, "little")
ETL_ENUM_TYPE(big, "big")
ETL_END_ENUM_TYPE
};

View File

@ -313,7 +313,7 @@ namespace etl
/// is_signed
template <typename T> struct is_signed : false_type {};
template <> struct is_signed<char> : etl::bool_constant<(char(255) < 0)> {};
template <> struct is_signed<wchar_t> : public etl::bool_constant<static_cast<bool>(wchar_t(-1) < wchar_t(0))> {};
template <> struct is_signed<wchar_t> : public etl::bool_constant<wchar_t(-1) < wchar_t(0)> {};
template <> struct is_signed<signed char> : true_type {};
template <> struct is_signed<short> : true_type {};
template <> struct is_signed<int> : true_type {};

View File

@ -47,6 +47,8 @@ SOFTWARE.
///\defgroup hash Standard hash calculations
///\ingroup maths
#include "private/diagnostic_useless_cast_push.h"
namespace etl
{
namespace private_hash
@ -433,7 +435,7 @@ namespace etl
double v;
} u;
if (!(v < 0.0) && !(v > 0.0))
if (etl::is_zero(v))
{ // -0.0 and 0.0 are represented differently at bit level
v = 0.0;
}
@ -467,7 +469,7 @@ namespace etl
long double v;
} u;
if (!(v < 0.0L) && !(v > 0.0L))
if (etl::is_zero(v))
{ // -0.0 and 0.0 are represented differently at bit level
v = 0.0L;
}
@ -536,6 +538,8 @@ namespace etl
}
}
#include "private/diagnostic_pop.h"
#endif // ETL_USING_8BIT_TYPES
#endif

View File

@ -54,7 +54,7 @@ SOFTWARE.
#endif
#if ETL_NOT_USING_STL
#define ETL_LOG10_OF_2(x) (((x) * 301) / 1000)
#define ETL_LOG10_OF_2(x) (((x) * 301) / 1000)
#if !defined(LDBL_MIN) && defined(DBL_MIN)
// Looks like we don't have these macros defined.
@ -80,20 +80,24 @@ SOFTWARE.
#if defined(ETL_NO_CPP_NAN_SUPPORT)
#if defined(NAN)
#define ETL_NAN (double)NAN
#define ETL_NANF (float)NAN
#define ETL_NANL (long double)NAN
#include "etl/private/diagnostic_useless_cast_push.h"
#define ETL_NANF NAN
#define ETL_NAN static_cast<double>(NAN)
#define ETL_NANL static_cast<long double>(NAN)
#define ETL_HAS_NAN true
#include "etl/private/diagnostic_pop.h"
#else
#define ETL_NAN (double)0.0
#define ETL_NANF (float)0.0
#define ETL_NANL (long double)0.0
#include "etl/private/diagnostic_useless_cast_push.h"
#define ETL_NANF HUGE_VALF
#define ETL_NAN HUGE_VAL
#define ETL_NANL HUGE_VALL
#define ETL_HAS_NAN false
#include "etl/private/diagnostic_pop.h"
#endif
#else
#define ETL_NAN nan("")
#define ETL_NANF nanf("")
#define ETL_NANL nanl("")
#define ETL_NANF nanf("")
#define ETL_NAN nan("")
#define ETL_NANL nanl("")
#define ETL_HAS_NAN true
#endif
@ -101,18 +105,18 @@ namespace etl
{
enum float_round_style
{
round_indeterminate = -1,
round_toward_zero = 0,
round_to_nearest = 1,
round_toward_infinity = 2,
round_indeterminate = -1,
round_toward_zero = 0,
round_to_nearest = 1,
round_toward_infinity = 2,
round_toward_neg_infinity = 3,
};
enum float_denorm_style
{
denorm_indeterminate = -1,
denorm_absent = 0,
denorm_present = 1
denorm_absent = 0,
denorm_present = 1
};
namespace private_limits

View File

@ -33,6 +33,10 @@ SOFTWARE.
* This file is intended to evaluated multiple times by design.
*/
#if defined(__GNUC__) && !defined(__clang__) && !defined(__llvm__)
#pragma GCC diagnostic push
#endif
#if defined(__clang__) || defined(__llvm__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wself-assign-overloaded"

View File

@ -0,0 +1,43 @@
///\file
/******************************************************************************
The MIT License(MIT)
Embedded Template Library.
https://github.com/ETLCPP/etl
https://www.etlcpp.com
Copyright(c) 2023 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 "-Wuseless-cast"
#endif
#if defined(__clang__) || defined(__llvm__)
#pragma clang diagnostic push
#endif

View File

@ -43,6 +43,7 @@ SOFTWARE.
#include "../algorithm.h"
#include "../iterator.h"
#include "../math.h"
#include "../limits.h"
#include <math.h>
@ -307,9 +308,9 @@ namespace etl
iterator start = str.end();
if (etl::is_nan(value) || etl::is_infinity(value))
if (isnan(value) || isinf(value))
{
etl::private_to_string::add_nan_inf(etl::is_nan(value), etl::is_infinity(value), str);
etl::private_to_string::add_nan_inf(isnan(value), isinf(value), str);
}
else
{

View File

@ -462,10 +462,12 @@ namespace etl
random_pcg()
{
#include "etl/private/diagnostic_useless_cast_push.h"
// An attempt to come up with a unique non-zero seed,
// based on the address of the instance.
uintptr_t n = reinterpret_cast<uintptr_t>(this);
value = static_cast<uint64_t>(n);
#include "etl/private/diagnostic_pop.h"
}
//***************************************************************************

View File

@ -171,7 +171,7 @@ namespace etl
//***************************************************************************
ETL_NODISCARD virtual int32_t decrement_reference_count() ETL_OVERRIDE
{
return int32_t(1);
return 1;
}
//***************************************************************************
@ -179,7 +179,7 @@ namespace etl
//***************************************************************************
ETL_NODISCARD virtual int32_t get_reference_count() const ETL_OVERRIDE
{
return int32_t(1);
return 1;
}
};

View File

@ -301,7 +301,7 @@ namespace etl
/// is_signed
template <typename T> struct is_signed : false_type {};
template <> struct is_signed<char> : etl::bool_constant<(char(255) < 0)> {};
template <> struct is_signed<wchar_t> : public etl::bool_constant<static_cast<bool>(wchar_t(-1) < wchar_t(0))> {};
template <> struct is_signed<wchar_t> : public etl::bool_constant<wchar_t(-1) < wchar_t(0)> {};
template <> struct is_signed<signed char> : true_type {};
template <> struct is_signed<short> : true_type {};
template <> struct is_signed<int> : true_type {};

View File

@ -337,7 +337,7 @@ namespace etl
inline bool operator ==(const pair<T1, T2>& a, const pair<T1, T2>& b)
{
#include "private/diagnostic_float_equal_push.h"
return (a.first == b.first) && (a.second == b.second);
return (a.first == b.first) && !(a.second < b.second) && !(a.second > b.second);
#include "private/diagnostic_pop.h"
}

View File

@ -371,7 +371,20 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
message(STATUS "Using Clang compiler")
endif ()
if ((CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
target_compile_options(etl_tests
PRIVATE
-fno-omit-frame-pointer
-fno-common
-Wall
-Wextra
-Werror
-Wfloat-equal
-Wuseless-cast
)
endif ()
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
target_compile_options(etl_tests
PRIVATE
-fno-omit-frame-pointer
@ -381,7 +394,9 @@ if ((CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "Cla
-Werror
-Wfloat-equal
)
endif ()
if ((CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
if (ETL_ENABLE_SANITIZER)
message(STATUS "Compiling with Sanitizer enabled")
# MinGW doesn't presently support sanitization

View File

@ -31,8 +31,6 @@ SOFTWARE.
#include <stdio.h>
#include <iostream>
etl::error_handler eh;
//*****************************************************************************
struct ErrorLog
{
@ -124,7 +122,7 @@ int main()
{
static ErrorLog error_log;
etl::error_handler::set_callback<ErrorLog, &ErrorLog::Log>(error_log);
etl::error_handler::set_callback<ErrorLog, error_log, &ErrorLog::Log>();
Assert(false);
Assert(true);

View File

@ -132,7 +132,7 @@ void MurmurHash3_x86_32(const void * key, int len, uint32_t seed, void * out)
//----------
// tail
const uint8_t * tail = (const uint8_t*)(data + nblocks * 4);
const uint8_t * tail = data + nblocks * 4;
uint32_t k1 = 0U;
@ -204,7 +204,7 @@ void MurmurHash3_x86_128(const void * key, const int len,
//----------
// tail
const uint8_t * tail = (const uint8_t*)(data + nblocks * 16);
const uint8_t * tail = data + nblocks * 16;
uint32_t k1 = 0U;
uint32_t k2 = 0U;
@ -296,7 +296,7 @@ void MurmurHash3_x64_128(const void * key, const int len,
//----------
// tail
const uint8_t * tail = (const uint8_t*)(data + nblocks * 16);
const uint8_t * tail = data + nblocks * 16;
uint64_t k1 = 0ULL;
uint64_t k2 = 0ULL;

View File

@ -3,7 +3,7 @@ clear
echo -e
testname="Test Name Not Set"
configuration_name="Configuration Name Not Set"
FailColour='\033[38;2;255;128;128m'
PassColour='\033[38;2;128;255;128m'
@ -20,19 +20,21 @@ SetCxxStandard()
cxx_standard=$1
}
SetTestName()
SetConfigurationName()
{
testname=$1
configuration_name=$1
}
PrintHeader()
{
echo "$TitleColour"
echo "============================================================================" | tee -a log.txt
echo " $testname " | tee -a log.txt
echo " Configuration : $configuration_name " | tee -a log.txt
echo " Compiler : $compiler " | tee -a log.txt
echo " Language standard : C++$cxx_standard " | tee -a log.txt
echo -n " ETL version : " | cat - ../../../version.txt | tee -a log.txt
echo " Git branch : "$(ParseGitBranch) | tee -a log.txt
echo " ETL Version : $etl_version " | tee -a log.txt
echo " Git branch : $(ParseGitBranch) " | tee -a log.txt
echo " Processes : ${CMAKE_BUILD_PARALLEL_LEVEL} " | tee -a log.txt
echo "============================================================================" | tee -a log.txt
echo "$NoColour"
}
@ -76,20 +78,29 @@ else
export CMAKE_BUILD_PARALLEL_LEVEL=$1
fi
echo ""
echo "Using "$CMAKE_BUILD_PARALLEL_LEVEL" concurrent processes"
#******************************************************************************
# Get the ETL version
#******************************************************************************
etl_version_raw=$(cat ../../version.txt)
etl_version=$(echo $etl_version_raw | sed -e 's/\r//g') # Remove trailing \r
#******************************************************************************
# Get the compiler versions
#******************************************************************************
gcc_compiler=$(g++ --version | grep g++)
clang_compiler=$(clang++ --version | grep clang)
###############################################################################
cd c++03 || exit 1
SetCxxStandard "03 (98)"
SetTestName "GCC - STL"
SetConfigurationName "STL"
compiler=$gcc_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
g++ --version | head --lines=1 | tee -a ../log.txt
CC=gcc CXX=g++ cmake -E chdir bgcc cmake -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
cmake --build bgcc
if [ $? -eq 0 ]; then
@ -99,12 +110,12 @@ else
exit $?
fi
SetTestName "GCC - No STL"
SetConfigurationName "No STL"
compiler=$gcc_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
g++ --version | head --lines=1 | tee -a ../log.txt
CC=gcc CXX=g++ cmake -E chdir bgcc cmake -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
cmake --build bgcc
if [ $? -eq 0 ]; then
@ -114,12 +125,12 @@ else
exit $?
fi
##SetTestName "GCC - No STL - User defined traits"
##SetConfigurationName "No STL - User defined traits"
#compiler=$gcc_compiler
# PrintHeader
#rm -rdf bgcc
#rm -rdf bclang
#cmake -E make_directory bgcc bclang
#g++ --version | head --lines=1 | tee -a ../log.txt
#CC=gcc CXX=g++ cmake -E chdir bgcc cmake -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=ON -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
#cmake --build bgcc
#if [ $? -eq 0 ]; then
@ -129,12 +140,12 @@ fi
# exit $?
#fi
SetTestName "GCC - STL - Built-in traits"
SetConfigurationName "STL - Built-in traits"
compiler=$gcc_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
g++ --version | head --lines=1 | tee -a ../log.txt
CC=gcc CXX=g++ cmake -E chdir bgcc cmake -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=ON -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
cmake --build bgcc
if [ $? -eq 0 ]; then
@ -144,12 +155,12 @@ else
exit $?
fi
SetTestName "GCC - No STL - Built-in traits"
SetConfigurationName "No STL - Built-in traits"
compiler=$gcc_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
g++ --version | head --lines=1 | tee -a ../log.txt
CC=gcc CXX=g++ cmake -E chdir bgcc cmake -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=ON -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
cmake --build bgcc
if [ $? -eq 0 ]; then
@ -159,12 +170,12 @@ else
exit $?
fi
SetTestName "Clang - STL"
SetConfigurationName "STL"
compiler=$clang_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
clang++ --version | head --lines=1 | tee -a ../log.txt
CC=clang CXX=clang++ cmake -E chdir bclang cmake -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
cmake --build bclang
if [ $? -eq 0 ]; then
@ -174,12 +185,12 @@ else
exit $?
fi
SetTestName "Clang - No STL"
SetConfigurationName "No STL"
compiler=$clang_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
clang++ --version | head --lines=1 | tee -a ../log.txt
CC=clang CXX=clang++ cmake -E chdir bclang cmake -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
cmake --build bclang
if [ $? -eq 0 ]; then
@ -189,12 +200,12 @@ else
exit $?
fi
#SetTestName "Clang - No STL - User defined traits"
#SetConfigurationName "No STL - User defined traits"
#compiler=$clang_compiler
#PrintHeader
#rm -rdf bgcc
#rm -rdf bclang
#cmake -E make_directory bgcc bclang
#clang++ --version | head --lines=1 | tee -a ../log.txt
#CC=clang CXX=clang++ cmake -E chdir bclang cmake -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=ON -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
#cmake --build bclang
#if [ $? -eq 0 ]; then
@ -204,12 +215,12 @@ fi
# exit $?
#fi
SetTestName "Clang - STL - Built-in traits"
SetConfigurationName "STL - Built-in traits"
compiler=$clang_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
g++ --version | head --lines=1 | tee -a ../log.txt
CC=clang CXX=clang++ cmake -E chdir bgcc cmake -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=ON -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
cmake --build bgcc
if [ $? -eq 0 ]; then
@ -219,12 +230,12 @@ else
exit $?
fi
SetTestName "Clang - No STL - Built-in traits"
SetConfigurationName "No STL - Built-in traits"
compiler=$clang_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
g++ --version | head --lines=1 | tee -a ../log.txt
CC=clang CXX=clang++ cmake -E chdir bgcc cmake -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=ON -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
cmake --build bgcc
if [ $? -eq 0 ]; then
@ -239,12 +250,12 @@ cd ../c++11 || exit 1
SetCxxStandard "11"
SetTestName "GCC - STL"
SetConfigurationName "STL"
compiler=$gcc_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
g++ --version | head --lines=1 | tee -a ../log.txt
CC=gcc CXX=g++ cmake -E chdir bgcc cmake -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
cmake --build bgcc
if [ $? -eq 0 ]; then
@ -254,12 +265,12 @@ else
exit $?
fi
SetTestName "GCC - STL - Force C++03"
SetConfigurationName "STL - Force C++03"
compiler=$gcc_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
g++ --version | head --lines=1 | tee -a ../log.txt
CC=gcc CXX=g++ cmake -E chdir bgcc cmake -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=ON ..
cmake --build bgcc
if [ $? -eq 0 ]; then
@ -269,12 +280,12 @@ else
exit $?
fi
SetTestName "GCC - No STL"
SetConfigurationName "No STL"
compiler=$gcc_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
g++ --version | head --lines=1 | tee -a ../log.txt
CC=gcc CXX=g++ cmake -E chdir bgcc cmake -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
cmake --build bgcc
if [ $? -eq 0 ]; then
@ -284,12 +295,12 @@ else
exit $?
fi
SetTestName "GCC - No STL - Force C++03"
SetConfigurationName "No STL - Force C++03"
compiler=$gcc_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
g++ --version | head --lines=1 | tee -a ../log.txt
CC=gcc CXX=g++ cmake -E chdir bgcc cmake -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=ON ..
cmake --build bgcc
if [ $? -eq 0 ]; then
@ -299,12 +310,12 @@ else
exit $?
fi
#SetTestName "GCC - No STL - User defined traits"
#SetConfigurationName "No STL - User defined traits"
#compiler=$gcc_compiler
#PrintHeader
#rm -rdf bgcc
#rm -rdf bclang
#cmake -E make_directory bgcc bclang
#g++ --version | head --lines=1 | tee -a ../log.txt
#CC=gcc CXX=g++ cmake -E chdir bgcc cmake -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=ON -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
#cmake --build bgcc
#if [ $? -eq 0 ]; then
@ -314,12 +325,12 @@ fi
# exit $?
#fi
SetTestName "GCC - STL - Built-in traits"
SetConfigurationName "STL - Built-in traits"
compiler=$gcc_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
g++ --version | head --lines=1 | tee -a ../log.txt
CC=gcc CXX=g++ cmake -E chdir bgcc cmake -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=ON -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
cmake --build bgcc
if [ $? -eq 0 ]; then
@ -329,12 +340,12 @@ else
exit $?
fi
SetTestName "GCC - No STL - Built-in traits"
SetConfigurationName "No STL - Built-in traits"
compiler=$gcc_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
g++ --version | head --lines=1 | tee -a ../log.txt
CC=gcc CXX=g++ cmake -E chdir bgcc cmake -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=ON -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
cmake --build bgcc
if [ $? -eq 0 ]; then
@ -344,12 +355,12 @@ else
exit $?
fi
SetTestName "Clang - STL"
SetConfigurationName "STL"
compiler=$clang_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
clang++ --version | head --lines=1 | tee -a ../log.txt
CC=clang CXX=clang++ cmake -E chdir bclang cmake -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
cmake --build bclang
if [ $? -eq 0 ]; then
@ -359,12 +370,12 @@ else
exit $?
fi
SetTestName "Clang - STL - Force C++03"
SetConfigurationName "STL - Force C++03"
compiler=$clang_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
clang++ --version | head --lines=1 | tee -a ../log.txt
CC=clang CXX=clang++ cmake -E chdir bclang cmake -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=ON ..
cmake --build bclang
if [ $? -eq 0 ]; then
@ -374,12 +385,12 @@ else
exit $?
fi
SetTestName "Clang - No STL"
SetConfigurationName "No STL"
compiler=$clang_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
clang++ --version | head --lines=1 | tee -a ../log.txt
CC=clang CXX=clang++ cmake -E chdir bclang cmake -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
cmake --build bclang
if [ $? -eq 0 ]; then
@ -389,12 +400,12 @@ else
exit $?
fi
SetTestName "Clang - No STL - Force C++03"
SetConfigurationName "No STL - Force C++03"
compiler=$clang_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
clang++ --version | head --lines=1 | tee -a ../log.txt
CC=clang CXX=clang++ cmake -E chdir bclang cmake -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=ON ..
cmake --build bclang
if [ $? -eq 0 ]; then
@ -404,13 +415,13 @@ else
exit $?
fi
#SetTestName "Clang - No STL - User defined traits"
#SetConfigurationName "No STL - User defined traits"
#compiler=$clang_compiler
#PrintHeader
#rm -rdf bgcc
#rm -rdf bclang
#cmake -E make_directory bgcc bclang
#clang++ --version | head --lines=1 | tee -a ../log.txt
#CC=clang CXX=clang++ cmake -E chdir bclang cmake -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=ON -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
##CC=clang CXX=clang++ cmake -E chdir bclang cmake -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=ON -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
#cmake --build bclang
#if [ $? -eq 0 ]; then
# PassedCompilation
@ -419,12 +430,12 @@ fi
# exit $?
#fi
SetTestName "Clang - STL - Built-in traits"
SetConfigurationName "STL - Built-in traits"
compiler=$clang_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
g++ --version | head --lines=1 | tee -a ../log.txt
CC=clang CXX=clang++ cmake -E chdir bgcc cmake -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=ON -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
cmake --build bgcc
if [ $? -eq 0 ]; then
@ -434,12 +445,12 @@ else
exit $?
fi
SetTestName "Clang - No STL - Built-in traits"
SetConfigurationName "No STL - Built-in traits"
compiler=$clang_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
g++ --version | head --lines=1 | tee -a ../log.txt
CC=clang CXX=clang++ cmake -E chdir bgcc cmake -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=ON -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
cmake --build bgcc
if [ $? -eq 0 ]; then
@ -454,12 +465,12 @@ cd ../c++14 || exit 1
SetCxxStandard "14"
SetTestName "GCC - STL"
SetConfigurationName "STL"
compiler=$gcc_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
g++ --version | head --lines=1 | tee -a ../log.txt
CC=gcc CXX=g++ cmake -E chdir bgcc cmake -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
cmake --build bgcc
if [ $? -eq 0 ]; then
@ -469,12 +480,12 @@ else
exit $?
fi
SetTestName "GCC - STL - Force C++03"
SetConfigurationName "STL - Force C++03"
compiler=$gcc_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
g++ --version | head --lines=1 | tee -a ../log.txt
CC=gcc CXX=g++ cmake -E chdir bgcc cmake -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=ON ..
cmake --build bgcc
if [ $? -eq 0 ]; then
@ -484,12 +495,12 @@ else
exit $?
fi
SetTestName "GCC - No STL"
SetConfigurationName "No STL"
compiler=$gcc_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
g++ --version | head --lines=1 | tee -a ../log.txt
CC=gcc CXX=g++ cmake -E chdir bgcc cmake -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
cmake --build bgcc
if [ $? -eq 0 ]; then
@ -499,12 +510,12 @@ else
exit $?
fi
SetTestName "GCC - No STL - Force C++03"
SetConfigurationName "No STL - Force C++03"
compiler=$gcc_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
g++ --version | head --lines=1 | tee -a ../log.txt
CC=gcc CXX=g++ cmake -E chdir bgcc cmake -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=ON ..
cmake --build bgcc
if [ $? -eq 0 ]; then
@ -514,12 +525,12 @@ else
exit $?
fi
#SetTestName "GCC - No STL - User defined traits"
#SetConfigurationName "No STL - User defined traits"
#compiler=$gcc_compiler
#PrintHeader
#rm -rdf bgcc
#rm -rdf bclang
#cmake -E make_directory bgcc bclang
#g++ --version | head --lines=1 | tee -a ../log.txt
#CC=gcc CXX=g++ cmake -E chdir bgcc cmake -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=ON -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
#cmake --build bgcc
#if [ $? -eq 0 ]; then
@ -529,12 +540,12 @@ fi
# exit $?
#fi
SetTestName "GCC - STL - Built-in traits"
SetConfigurationName "STL - Built-in traits"
compiler=$gcc_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
g++ --version | head --lines=1 | tee -a ../log.txt
CC=gcc CXX=g++ cmake -E chdir bgcc cmake -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=ON -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
cmake --build bgcc
if [ $? -eq 0 ]; then
@ -544,12 +555,12 @@ else
exit $?
fi
SetTestName "GCC - No STL - Built-in traits"
SetConfigurationName "No STL - Built-in traits"
compiler=$gcc_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
g++ --version | head --lines=1 | tee -a ../log.txt
CC=gcc CXX=g++ cmake -E chdir bgcc cmake -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=ON -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
cmake --build bgcc
if [ $? -eq 0 ]; then
@ -559,12 +570,12 @@ else
exit $?
fi
SetTestName "Clang - STL"
SetConfigurationName "STL"
compiler=$clang_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
clang++ --version | head --lines=1 | tee -a ../log.txt
CC=clang CXX=clang++ cmake -E chdir bclang cmake -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
cmake --build bclang
if [ $? -eq 0 ]; then
@ -574,12 +585,12 @@ else
exit $?
fi
SetTestName "Clang - STL - Force C++03"
SetConfigurationName "STL - Force C++03"
compiler=$clang_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
clang++ --version | head --lines=1 | tee -a ../log.txt
CC=clang CXX=clang++ cmake -E chdir bclang cmake -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=ON ..
cmake --build bclang
if [ $? -eq 0 ]; then
@ -589,12 +600,12 @@ else
exit $?
fi
SetTestName "Clang - No STL"
SetConfigurationName "No STL"
compiler=$clang_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
clang++ --version | head --lines=1 | tee -a ../log.txt
CC=clang CXX=clang++ cmake -E chdir bclang cmake -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
cmake --build bclang
if [ $? -eq 0 ]; then
@ -604,12 +615,12 @@ else
exit $?
fi
SetTestName "Clang - No STL - Force C++03"
SetConfigurationName "No STL - Force C++03"
compiler=$clang_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
clang++ --version | head --lines=1 | tee -a ../log.txt
CC=clang CXX=clang++ cmake -E chdir bclang cmake -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=ON ..
cmake --build bclang
if [ $? -eq 0 ]; then
@ -619,13 +630,13 @@ else
exit $?
fi
#SetTestName "Clang - No STL - User defined traits"
#SetConfigurationName "No STL - User defined traits"
#compiler=$clang_compiler
#PrintHeader
#rm -rdf bgcc
#rm -rdf bclang
#cmake -E make_directory bgcc bclang
#clang++ --version | head --lines=1 | tee -a ../log.txt
#CC=clang CXX=clang++ cmake -E chdir bclang cmake -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=ON -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
##CC=clang CXX=clang++ cmake -E chdir bclang cmake -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=ON -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
#cmake --build bclang
#if [ $? -eq 0 ]; then
# PassedCompilation
@ -634,12 +645,12 @@ fi
# exit $?
#fi
SetTestName "Clang - STL - Built-in traits"
SetConfigurationName "STL - Built-in traits"
compiler=$clang_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
g++ --version | head --lines=1 | tee -a ../log.txt
CC=clang CXX=clang++ cmake -E chdir bgcc cmake -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=ON -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
cmake --build bgcc
if [ $? -eq 0 ]; then
@ -649,12 +660,12 @@ else
exit $?
fi
SetTestName "Clang - No STL - Built-in traits"
SetConfigurationName "No STL - Built-in traits"
compiler=$clang_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
g++ --version | head --lines=1 | tee -a ../log.txt
CC=clang CXX=clang++ cmake -E chdir bgcc cmake -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=ON -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
cmake --build bgcc
if [ $? -eq 0 ]; then
@ -669,12 +680,12 @@ cd ../c++17 || exit 1
SetCxxStandard "17"
SetTestName "GCC - STL"
SetConfigurationName "STL"
compiler=$gcc_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
g++ --version | head --lines=1 | tee -a ../log.txt
CC=gcc CXX=g++ cmake -E chdir bgcc cmake -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
cmake --build bgcc
if [ $? -eq 0 ]; then
@ -684,12 +695,12 @@ else
exit $?
fi
SetTestName "GCC - STL - Force C++03"
SetConfigurationName "STL - Force C++03"
compiler=$gcc_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
g++ --version | head --lines=1 | tee -a ../log.txt
CC=gcc CXX=g++ cmake -E chdir bgcc cmake -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=ON ..
cmake --build bgcc
if [ $? -eq 0 ]; then
@ -699,12 +710,12 @@ else
exit $?
fi
SetTestName "GCC - No STL"
SetConfigurationName "No STL"
compiler=$gcc_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
g++ --version | head --lines=1 | tee -a ../log.txt
CC=gcc CXX=g++ cmake -E chdir bgcc cmake -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
cmake --build bgcc
if [ $? -eq 0 ]; then
@ -714,12 +725,12 @@ else
exit $?
fi
SetTestName "GCC - No STL - Force C++03"
SetConfigurationName "No STL - Force C++03"
compiler=$gcc_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
g++ --version | head --lines=1 | tee -a ../log.txt
CC=gcc CXX=g++ cmake -E chdir bgcc cmake -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=ON ..
cmake --build bgcc
if [ $? -eq 0 ]; then
@ -729,12 +740,12 @@ else
exit $?
fi
#SetTestName "GCC - No STL - User defined traits"
#SetConfigurationName "No STL - User defined traits"
#compiler=$gcc_compiler
#PrintHeader
#rm -rdf bgcc
#rm -rdf bclang
#cmake -E make_directory bgcc bclang
#g++ --version | head --lines=1 | tee -a ../log.txt
#CC=gcc CXX=g++ cmake -E chdir bgcc cmake -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=ON -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
#cmake --build bgcc
#if [ $? -eq 0 ]; then
@ -744,12 +755,12 @@ fi
# exit $?
#fi
SetTestName "GCC - STL - Built-in traits"
SetConfigurationName "STL - Built-in traits"
compiler=$gcc_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
g++ --version | head --lines=1 | tee -a ../log.txt
CC=gcc CXX=g++ cmake -E chdir bgcc cmake -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=ON -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
cmake --build bgcc
if [ $? -eq 0 ]; then
@ -759,12 +770,12 @@ else
exit $?
fi
SetTestName "GCC - No STL - Built-in traits"
SetConfigurationName "No STL - Built-in traits"
compiler=$gcc_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
g++ --version | head --lines=1 | tee -a ../log.txt
CC=gcc CXX=g++ cmake -E chdir bgcc cmake -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=ON -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
cmake --build bgcc
if [ $? -eq 0 ]; then
@ -774,12 +785,12 @@ else
exit $?
fi
SetTestName "Clang - STL"
SetConfigurationName "STL"
compiler=$clang_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
clang++ --version | head --lines=1 | tee -a ../log.txt
CC=clang CXX=clang++ cmake -E chdir bclang cmake -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
cmake --build bclang
if [ $? -eq 0 ]; then
@ -789,12 +800,12 @@ else
exit $?
fi
SetTestName "Clang - STL - Force C++03"
SetConfigurationName "STL - Force C++03"
compiler=$clang_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
clang++ --version | head --lines=1 | tee -a ../log.txt
CC=clang CXX=clang++ cmake -E chdir bclang cmake -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=ON ..
cmake --build bclang
if [ $? -eq 0 ]; then
@ -804,12 +815,12 @@ else
exit $?
fi
SetTestName "Clang - No STL"
SetConfigurationName "No STL"
compiler=$clang_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
clang++ --version | head --lines=1 | tee -a ../log.txt
CC=clang CXX=clang++ cmake -E chdir bclang cmake -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
cmake --build bclang
if [ $? -eq 0 ]; then
@ -819,12 +830,12 @@ else
exit $?
fi
SetTestName "Clang - No STL - Force C++03"
SetConfigurationName "No STL - Force C++03"
compiler=$clang_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
clang++ --version | head --lines=1 | tee -a ../log.txt
CC=clang CXX=clang++ cmake -E chdir bclang cmake -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=ON ..
cmake --build bclang
if [ $? -eq 0 ]; then
@ -834,12 +845,12 @@ else
exit $?
fi
#SetTestName "Clang - No STL - User defined traits"
#SetConfigurationName "No STL - User defined traits"
#compiler=$clang_compiler
#PrintHeader
#rm -rdf bgcc
#rm -rdf bclang
#cmake -E make_directory bgcc bclang
#clang++ --version | head --lines=1 | tee -a ../log.txt
#CC=clang CXX=clang++ cmake -E chdir bclang cmake -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=ON -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
#cmake --build bclang
#if [ $? -eq 0 ]; then
@ -849,12 +860,12 @@ fi
# exit $?
#fi
SetTestName "Clang - STL - Built-in traits"
SetConfigurationName "STL - Built-in traits"
compiler=$clang_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
g++ --version | head --lines=1 | tee -a ../log.txt
CC=clang CXX=clang++ cmake -E chdir bgcc cmake -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=ON -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
cmake --build bgcc
if [ $? -eq 0 ]; then
@ -864,12 +875,12 @@ else
exit $?
fi
SetTestName "Clang - No STL - Built-in traits"
SetConfigurationName "No STL - Built-in traits"
compiler=$clang_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
g++ --version | head --lines=1 | tee -a ../log.txt
CC=clang CXX=clang++ cmake -E chdir bgcc cmake -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=ON -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
cmake --build bgcc
if [ $? -eq 0 ]; then
@ -884,12 +895,12 @@ cd ../c++20 || exit 1
SetCxxStandard "20"
SetTestName "GCC - STL"
SetConfigurationName "STL"
compiler=$gcc_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
g++ --version | head --lines=1 | tee -a ../log.txt
CC=gcc CXX=g++ cmake -E chdir bgcc cmake -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
cmake --build bgcc
if [ $? -eq 0 ]; then
@ -899,12 +910,12 @@ else
exit $?
fi
SetTestName "GCC - STL - Force C++03"
SetConfigurationName "STL - Force C++03"
compiler=$gcc_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
g++ --version | head --lines=1 | tee -a ../log.txt
CC=gcc CXX=g++ cmake -E chdir bgcc cmake -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=ON ..
cmake --build bgcc
if [ $? -eq 0 ]; then
@ -914,12 +925,12 @@ else
exit $?
fi
SetTestName "GCC - No STL"
SetConfigurationName "No STL"
compiler=$gcc_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
g++ --version | head --lines=1 | tee -a ../log.txt
CC=gcc CXX=g++ cmake -E chdir bgcc cmake -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
cmake --build bgcc
if [ $? -eq 0 ]; then
@ -929,12 +940,12 @@ else
exit $?
fi
SetTestName "GCC - No STL - Force C++03"
SetConfigurationName "No STL - Force C++03"
compiler=$gcc_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
g++ --version | head --lines=1 | tee -a ../log.txt
CC=gcc CXX=g++ cmake -E chdir bgcc cmake -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=ON ..
cmake --build bgcc
if [ $? -eq 0 ]; then
@ -944,12 +955,12 @@ else
exit $?
fi
#SetTestName "GCC - No STL - User defined traits"
#SetConfigurationName "No STL - User defined traits"
#compiler=$gcc_compiler
#PrintHeader
#rm -rdf bgcc
#rm -rdf bclang
#cmake -E make_directory bgcc bclang
#g++ --version | head --lines=1 | tee -a ../log.txt
#CC=gcc CXX=g++ cmake -E chdir bgcc cmake -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=ON -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
#cmake --build bgcc
#if [ $? -eq 0 ]; then
@ -959,12 +970,12 @@ fi
# exit $?
#fi
SetTestName "GCC - STL - Built-in traits"
SetConfigurationName "STL - Built-in traits"
compiler=$gcc_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
g++ --version | head --lines=1 | tee -a ../log.txt
CC=gcc CXX=g++ cmake -E chdir bgcc cmake -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=ON -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
cmake --build bgcc
if [ $? -eq 0 ]; then
@ -974,12 +985,12 @@ else
exit $?
fi
SetTestName "GCC - No STL - Built-in traits"
SetConfigurationName "No STL - Built-in traits"
compiler=$gcc_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
g++ --version | head --lines=1 | tee -a ../log.txt
CC=gcc CXX=g++ cmake -E chdir bgcc cmake -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=ON -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
cmake --build bgcc
if [ $? -eq 0 ]; then
@ -989,12 +1000,12 @@ else
exit $?
fi
SetTestName "Clang - STL"
SetConfigurationName "STL"
compiler=$clang_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
clang++ --version | head --lines=1 | tee -a ../log.txt
CC=clang CXX=clang++ cmake -E chdir bclang cmake -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
cmake --build bclang
if [ $? -eq 0 ]; then
@ -1004,12 +1015,12 @@ else
exit $?
fi
SetTestName "Clang - STL - Force C++03"
SetConfigurationName "STL - Force C++03"
compiler=$clang_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
clang++ --version | head --lines=1 | tee -a ../log.txt
CC=clang CXX=clang++ cmake -E chdir bclang cmake -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=ON ..
cmake --build bclang
if [ $? -eq 0 ]; then
@ -1019,12 +1030,12 @@ else
exit $?
fi
SetTestName "Clang - No STL"
SetConfigurationName "No STL"
compiler=$clang_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
clang++ --version | head --lines=1 | tee -a ../log.txt
CC=clang CXX=clang++ cmake -E chdir bclang cmake -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
cmake --build bclang
if [ $? -eq 0 ]; then
@ -1034,12 +1045,12 @@ else
exit $?
fi
SetTestName "Clang - No STL - Force C++03"
SetConfigurationName "No STL - Force C++03"
compiler=$clang_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
clang++ --version | head --lines=1 | tee -a ../log.txt
CC=clang CXX=clang++ cmake -E chdir bclang cmake -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=ON ..
cmake --build bclang
if [ $? -eq 0 ]; then
@ -1049,12 +1060,12 @@ else
exit $?
fi
#SetTestName "Clang - No STL - User defined traits"
#SetConfigurationName "No STL - User defined traits"
#compiler=$clang_compiler
#PrintHeader
#rm -rdf bgcc
#rm -rdf bclang
#cmake -E make_directory bgcc bclang
#clang++ --version | head --lines=1 | tee -a ../log.txt
#CC=clang CXX=clang++ cmake -E chdir bclang cmake -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=ON -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
#cmake --build bclang
#if [ $? -eq 0 ]; then
@ -1064,12 +1075,12 @@ fi
# exit $?
#fi
SetTestName "Clang - STL - Built-in traits"
SetConfigurationName "STL - Built-in traits"
compiler=$clang_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
g++ --version | head --lines=1 | tee -a ../log.txt
CC=clang CXX=clang++ cmake -E chdir bgcc cmake -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=ON -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
cmake --build bgcc
if [ $? -eq 0 ]; then
@ -1079,12 +1090,12 @@ else
exit $?
fi
SetTestName "Clang - No STL - Built-in traits"
SetConfigurationName "No STL - Built-in traits"
compiler=$clang_compiler
PrintHeader
rm -rdf bgcc
rm -rdf bclang
cmake -E make_directory bgcc bclang
g++ --version | head --lines=1 | tee -a ../log.txt
CC=clang CXX=clang++ cmake -E chdir bgcc cmake -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=ON -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF ..
cmake --build bgcc
if [ $? -eq 0 ]; then

View File

@ -11,7 +11,7 @@ export ASAN_SYMBOLIZER_PATH=/usr/lib/llvm-14/bin//llvm-symbolizer
echo -e
testname="Test Name Not Set"
configuration_name="Configuration Name Not Set"
FailColour='\033[38;2;255;128;128m'
PassColour='\033[38;2;128;255;128m'
@ -24,9 +24,9 @@ ParseGitBranch()
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
SetTestName()
SetConfigurationName()
{
testname=$1
configuration_name=$1
}
Bell()
@ -38,12 +38,14 @@ PrintHeader()
{
echo "$TitleColour"
echo "============================================================================" | tee -a log.txt
echo " $testname " | tee -a log.txt
echo " Configuration : $configuration_name " | tee -a log.txt
echo " Compiler : $compiler " | tee -a log.txt
echo " Language standard : C++$cxx_standard " | tee -a log.txt
echo " Optimisation : $opt " | tee -a log.txt
echo " Sanitizer : $sanitize " | tee -a log.txt
echo -n " ETL version : " | cat - ../../version.txt | tee -a log.txt
echo " Git branch : "$(ParseGitBranch) | tee -a log.txt
echo " ETL Version : $etl_version " | tee -a log.txt
echo " Git branch : $(ParseGitBranch) " | tee -a log.txt
echo " Processes : ${CMAKE_BUILD_PARALLEL_LEVEL} " | tee -a log.txt
echo "============================================================================" | tee -a log.txt
echo "$NoColour"
}
@ -144,9 +146,6 @@ else
export CMAKE_BUILD_PARALLEL_LEVEL=$3
fi
echo ""
echo "Using "${CMAKE_BUILD_PARALLEL_LEVEL}" concurrent processes"
#******************************************************************************
# Set the sanitizer enable. Default OFF
#******************************************************************************
@ -156,14 +155,26 @@ else
sanitize="OFF"
fi
#******************************************************************************
# Get the ETL version
#******************************************************************************
etl_version_raw=$(cat ../../version.txt)
etl_version=$(echo $etl_version_raw | sed -e 's/\r//g') # Remove trailing \r
#******************************************************************************
# Get the compiler versions
#******************************************************************************
gcc_compiler=$(g++ --version | grep g++)
clang_compiler=$(clang++ --version | grep clang++)
#******************************************************************************
# GCC
#******************************************************************************
SetTestName "GCC - STL"
compiler=$gcc_compiler
SetConfigurationName "STL"
PrintHeader
rm * -rf
gcc --version | grep gcc | tee -a log.txt
cmake -DCMAKE_CXX_COMPILER="g++" -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard -DETL_ENABLE_SANITIZER=$sanitize -DETL_MESSAGES_ARE_NOT_VIRTUAL=OFF ..
cmake -DCMAKE_C_COMPILER="gcc" -DCMAKE_CXX_COMPILER="g++" -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard -DETL_ENABLE_SANITIZER=$sanitize -DETL_MESSAGES_ARE_NOT_VIRTUAL=OFF ..
cmake --build .
if [ $? -eq 0 ]; then
PassedCompilation
@ -180,11 +191,11 @@ else
fi
#******************************************************************************
SetTestName "GCC - STL - Non-virtual messages"
compiler=$gcc_compiler
SetConfigurationName "STL - Non-virtual messages"
PrintHeader
rm * -rf
gcc --version | grep gcc | tee -a log.txt
cmake -DCMAKE_CXX_COMPILER="g++" -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard -DETL_ENABLE_SANITIZER=$sanitize -DETL_MESSAGES_ARE_NOT_VIRTUAL=ON ..
cmake -DCMAKE_C_COMPILER="gcc" -DCMAKE_CXX_COMPILER="g++" -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard -DETL_ENABLE_SANITIZER=$sanitize -DETL_MESSAGES_ARE_NOT_VIRTUAL=ON ..
cmake --build .
if [ $? -eq 0 ]; then
PassedCompilation
@ -201,11 +212,11 @@ else
fi
#******************************************************************************
SetTestName "GCC - STL - Force C++03"
compiler=$gcc_compiler
SetConfigurationName "STL - Force C++03"
PrintHeader
rm * -rf
gcc --version | grep gcc | tee -a log.txt
cmake -DCMAKE_CXX_COMPILER="g++" -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=ON -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard -DETL_ENABLE_SANITIZER=$sanitize -DETL_MESSAGES_ARE_NOT_VIRTUAL=OFF ..
cmake -DCMAKE_C_COMPILER="gcc" -DCMAKE_CXX_COMPILER="g++" -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=ON -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard -DETL_ENABLE_SANITIZER=$sanitize -DETL_MESSAGES_ARE_NOT_VIRTUAL=OFF ..
cmake --build .
if [ $? -eq 0 ]; then
PassedCompilation
@ -222,11 +233,11 @@ else
fi
#******************************************************************************
SetTestName "GCC - No STL"
compiler=$gcc_compiler
SetConfigurationName "No STL"
PrintHeader
rm * -rf
gcc --version | grep gcc | tee -a log.txt
cmake -DCMAKE_CXX_COMPILER="g++" -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard -DETL_ENABLE_SANITIZER=$sanitize -DETL_MESSAGES_ARE_NOT_VIRTUAL=OFF ..
cmake -DCMAKE_C_COMPILER="gcc" -DCMAKE_CXX_COMPILER="g++" -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard -DETL_ENABLE_SANITIZER=$sanitize -DETL_MESSAGES_ARE_NOT_VIRTUAL=OFF ..
cmake --build .
if [ $? -eq 0 ]; then
PassedCompilation
@ -243,11 +254,11 @@ else
fi
#******************************************************************************
SetTestName "GCC - No STL - Force C++03"
compiler=$gcc_compiler
SetConfigurationName "No STL - Force C++03"
PrintHeader
rm * -rf
gcc --version | grep gcc | tee -a log.txt
cmake -DCMAKE_CXX_COMPILER="g++" -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=ON -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard -DETL_ENABLE_SANITIZER=$sanitize -DETL_MESSAGES_ARE_NOT_VIRTUAL=OFF ..
cmake -DCMAKE_C_COMPILER="gcc" -DCMAKE_CXX_COMPILER="g++" -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=ON -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard -DETL_ENABLE_SANITIZER=$sanitize -DETL_MESSAGES_ARE_NOT_VIRTUAL=OFF ..
cmake --build .
if [ $? -eq 0 ]; then
PassedCompilation
@ -266,11 +277,11 @@ fi
#******************************************************************************
# CLANG
#******************************************************************************
SetTestName "Clang - STL"
compiler=$clang_compiler
SetConfigurationName "STL"
PrintHeader
rm * -rf
clang --version | grep clang | tee -a log.txt
cmake -DCMAKE_CXX_COMPILER="clang++" -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard -DETL_ENABLE_SANITIZER=$sanitize -DETL_MESSAGES_ARE_NOT_VIRTUAL=OFF ..
cmake -DCMAKE_C_COMPILER="gcc" -DCMAKE_CXX_COMPILER="clang++" -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard -DETL_ENABLE_SANITIZER=$sanitize -DETL_MESSAGES_ARE_NOT_VIRTUAL=OFF ..
cmake --build .
if [ $? -eq 0 ]; then
PassedCompilation
@ -287,11 +298,11 @@ else
fi
#******************************************************************************
SetTestName "Clang - STL - Force C++03"
compiler=$clang_compiler
SetConfigurationName "STL - Force C++03"
PrintHeader
rm * -rf
clang --version | grep clang | tee -a log.txt
cmake -DCMAKE_CXX_COMPILER="clang++" -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=ON -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard -DETL_ENABLE_SANITIZER=$sanitize -DETL_MESSAGES_ARE_NOT_VIRTUAL=OFF ..
cmake -DCMAKE_C_COMPILER="clang" -DCMAKE_CXX_COMPILER="clang++" -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=ON -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard -DETL_ENABLE_SANITIZER=$sanitize -DETL_MESSAGES_ARE_NOT_VIRTUAL=OFF ..
cmake --build .
if [ $? -eq 0 ]; then
PassedCompilation
@ -308,11 +319,11 @@ else
fi
#******************************************************************************
SetTestName "Clang - No STL"
compiler=$clang_compiler
SetConfigurationName "No STL"
PrintHeader
rm * -rf
clang --version | grep clang | tee -a log.txt
cmake -DCMAKE_CXX_COMPILER="clang++" -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard -DETL_ENABLE_SANITIZER=$sanitize -DETL_MESSAGES_ARE_NOT_VIRTUAL=OFF ..
cmake -DCMAKE_C_COMPILER="clang" -DCMAKE_CXX_COMPILER="clang++" -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard -DETL_ENABLE_SANITIZER=$sanitize -DETL_MESSAGES_ARE_NOT_VIRTUAL=OFF ..
cmake --build .
if [ $? -eq 0 ]; then
PassedCompilation
@ -329,11 +340,11 @@ else
fi
#******************************************************************************
SetTestName "Clang - No STL - Force C++03"
compiler=$clang_compiler
SetConfigurationName "No STL - Force C++03"
PrintHeader
rm * -rf
clang --version | grep clang | tee -a log.txt
cmake -DCMAKE_CXX_COMPILER="clang++" -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=ON -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard -DETL_ENABLE_SANITIZER=$sanitize -DETL_MESSAGES_ARE_NOT_VIRTUAL=OFF ..
cmake -DCMAKE_C_COMPILER="clang" -DCMAKE_CXX_COMPILER="clang++" -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=ON -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard -DETL_ENABLE_SANITIZER=$sanitize -DETL_MESSAGES_ARE_NOT_VIRTUAL=OFF ..
cmake --build .
if [ $? -eq 0 ]; then
PassedCompilation
@ -350,14 +361,14 @@ else
fi
#******************************************************************************
SetTestName "GCC - Initializer list test"
compiler=$gcc_compiler
SetConfigurationName "Initializer list test"
PrintHeader
cd ../etl_initializer_list/
mkdir -p build-make || exit 1
cd build-make || exit 1
rm * -rf
gcc --version | grep gcc | tee -a log.txt
cmake -DCMAKE_CXX_COMPILER="g++" -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard -DETL_ENABLE_SANITIZER=$sanitize ..
cmake -DCMAKE_C_COMPILER="gcc" -DCMAKE_C_COMPILER="gcc" -DCMAKE_CXX_COMPILER="g++" -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard -DETL_ENABLE_SANITIZER=$sanitize ..
cmake --build .
if [ $? -eq 0 ]; then
PassedCompilation
@ -374,11 +385,11 @@ else
fi
#******************************************************************************
SetTestName "Clang - Initializer list test"
compiler=$clang_compiler
SetConfigurationName "Initializer list test"
PrintHeader
rm * -rf
clang --version | grep clang | tee -a log.txt
cmake -DCMAKE_CXX_COMPILER="clang++" -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard -DETL_ENABLE_SANITIZER=$sanitize ..
cmake -DCMAKE_C_COMPILER="clang" -DCMAKE_CXX_COMPILER="clang++" -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard -DETL_ENABLE_SANITIZER=$sanitize ..
cmake --build .
if [ $? -eq 0 ]; then
PassedCompilation
@ -395,14 +406,14 @@ else
fi
#******************************************************************************
SetTestName "GCC - Error macros 'log_errors' test"
compiler=$gcc_compiler
SetConfigurationName "Error macros 'log_errors' test"
PrintHeader
cd ../../etl_error_handler/log_errors
mkdir -p build-make || exit 1
cd build-make || exit 1
rm * -rf
gcc --version | grep gcc | tee -a log.txt
cmake -DCMAKE_CXX_COMPILER="g++" -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard -DETL_ENABLE_SANITIZER=$sanitize ..
cmake -DCMAKE_C_COMPILER="gcc" -DCMAKE_CXX_COMPILER="g++" -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard -DETL_ENABLE_SANITIZER=$sanitize ..
cmake --build .
if [ $? -eq 0 ]; then
PassedCompilation
@ -419,14 +430,14 @@ else
fi
#******************************************************************************
SetTestName "GCC - Error macros 'exceptions' test"
compiler=$gcc_compiler
SetConfigurationName "Error macros 'exceptions' test"
PrintHeader
cd ../../../etl_error_handler/exceptions
mkdir -p build-make || exit 1
cd build-make || exit 1
rm * -rf
gcc --version | grep gcc | tee -a log.txt
cmake -DCMAKE_CXX_COMPILER="g++" -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard -DETL_ENABLE_SANITIZER=$sanitize ..
cmake -DCMAKE_C_COMPILER="gcc" -DCMAKE_CXX_COMPILER="g++" -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard -DETL_ENABLE_SANITIZER=$sanitize ..
cmake --build .
if [ $? -eq 0 ]; then
PassedCompilation
@ -443,14 +454,14 @@ else
fi
#******************************************************************************
SetTestName "GCC - Error macros 'log_errors and exceptions' test"
compiler=$gcc_compiler
SetConfigurationName "Error macros 'log_errors and exceptions' test"
PrintHeader
cd ../../../etl_error_handler/log_errors_and_exceptions
mkdir -p build-make || exit 1
cd build-make || exit 1
rm * -rf
gcc --version | grep gcc | tee -a log.txt
cmake -DCMAKE_CXX_COMPILER="g++" -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard -DETL_ENABLE_SANITIZER=$sanitize ..
cmake -DCMAKE_C_COMPILER="gcc" -DCMAKE_CXX_COMPILER="g++" -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard -DETL_ENABLE_SANITIZER=$sanitize ..
cmake --build .
if [ $? -eq 0 ]; then
PassedCompilation
@ -467,14 +478,14 @@ else
fi
#******************************************************************************
SetTestName "Clang - Error macros 'log_errors' test"
compiler=$clang_compiler
SetConfigurationName "Error macros 'log_errors' test"
PrintHeader
cd ../../../etl_error_handler/log_errors
mkdir -p build-make || exit 1
cd build-make || exit 1
rm * -rf
clang --version | grep clang | tee -a log.txt
cmake -DCMAKE_CXX_COMPILER="clang++" -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard -DETL_ENABLE_SANITIZER=$sanitize ..
cmake -DCMAKE_C_COMPILER="clang" -DCMAKE_CXX_COMPILER="clang++" -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard -DETL_ENABLE_SANITIZER=$sanitize ..
cmake --build .
if [ $? -eq 0 ]; then
PassedCompilation
@ -491,14 +502,14 @@ else
fi
#******************************************************************************
SetTestName "Clang - Error macros 'exceptions' test"
compiler=$clang_compiler
SetConfigurationName "Error macros 'exceptions' test"
PrintHeader
cd ../../../etl_error_handler/exceptions
mkdir -p build-make || exit 1
cd build-make || exit 1
rm * -rf
clang --version | grep clang | tee -a log.txt
cmake -DCMAKE_CXX_COMPILER="clang++" -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard -DETL_ENABLE_SANITIZER=$sanitize ..
cmake -DCMAKE_C_COMPILER="clang" -DCMAKE_CXX_COMPILER="clang++" -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard -DETL_ENABLE_SANITIZER=$sanitize ..
cmake --build .
if [ $? -eq 0 ]; then
PassedCompilation
@ -515,14 +526,14 @@ else
fi
#******************************************************************************
SetTestName "Clang - Error macros 'log_errors and exceptions' test"
compiler=$clang_compiler
SetConfigurationName "Error macros 'log_errors and exceptions' test"
PrintHeader
cd ../../../etl_error_handler/log_errors_and_exceptions
mkdir -p build-make || exit 1
cd build-make || exit 1
rm * -rf
clang --version | grep clang | tee -a log.txt
cmake -DCMAKE_CXX_COMPILER="clang++" -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard -DETL_ENABLE_SANITIZER=$sanitize ..
cmake -DCMAKE_C_COMPILER="clang" -DCMAKE_CXX_COMPILER="clang++" -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard -DETL_ENABLE_SANITIZER=$sanitize ..
cmake --build .
if [ $? -eq 0 ]; then
PassedCompilation

View File

@ -654,7 +654,7 @@ namespace
#if ETL_USING_CPP17 && ETL_HAS_INITIALIZER_LIST && !defined(ETL_TEMPLATE_DEDUCTION_GUIDE_TESTS_DISABLED)
TEST(test_array_template_deduction)
{
etl::array data{ char(0), short(1), int(2), long(3), 4, 5, 6, 7, 8, 9 };
etl::array data{ char(0), short(1), 2, long(3), 4, 5, 6, 7, 8, 9 };
using Type = std::remove_reference_t<decltype(data[0])>;
CHECK((std::is_same_v<long, Type>));

View File

@ -92,7 +92,7 @@ namespace
std::atomic<int> compare(1);
etl::atomic<int> test(1);
CHECK_EQUAL((int)compare.load(), (int)test.load());
CHECK_EQUAL(compare.load(), test.load());
}
//*************************************************************************
@ -101,7 +101,7 @@ namespace
std::atomic<Enum> compare(Enum::One);
etl::atomic<Enum> test(Enum::One);
CHECK_EQUAL((Enum)compare.load(), (Enum::value_type)test.load());
CHECK_EQUAL(compare.load(), test.load());
}
//*************************************************************************
@ -112,7 +112,7 @@ namespace
std::atomic<int*> compare(&i);
etl::atomic<int*> test(&i);
CHECK_EQUAL((int*)compare.load(), (int*)test.load());
CHECK_EQUAL(compare.load(), test.load());
}
//*************************************************************************
@ -121,7 +121,7 @@ namespace
std::atomic<bool> compare(true);
etl::atomic<bool> test(true);
CHECK_EQUAL((bool)compare.load(), (bool)test.load());
CHECK_EQUAL(compare.load(), test.load());
}
//*************************************************************************
@ -132,7 +132,7 @@ namespace
compare.store(2);
test.store(2);
CHECK_EQUAL((int)compare.load(), (int)test.load());
CHECK_EQUAL(compare.load(), test.load());
}
//*************************************************************************
@ -143,7 +143,7 @@ namespace
compare.store(Enum::Two);
test.store(Enum::Two);
CHECK_EQUAL((Enum::value_type)compare.load(), (Enum::value_type)test.load());
CHECK_EQUAL(compare.load(), test.load());
}
//*************************************************************************
@ -157,7 +157,7 @@ namespace
compare.store(&j);
test.store(&j);
CHECK_EQUAL((int*)compare.load(), (int*)test.load());
CHECK_EQUAL(compare.load(), test.load());
}
//*************************************************************************
@ -168,7 +168,7 @@ namespace
compare.store(true);
test.store(true);
CHECK_EQUAL((bool)compare.load(), (bool)test.load());
CHECK_EQUAL(compare.load(), test.load());
}
//*************************************************************************
@ -179,7 +179,7 @@ namespace
compare = 2;
test = 2;
CHECK_EQUAL((int)compare.load(), (int)test.load());
CHECK_EQUAL(compare.load(), test.load());
}
//*************************************************************************
@ -190,7 +190,7 @@ namespace
compare = Enum::Two;
test = Enum::Two;
CHECK_EQUAL((Enum::value_type)compare.load(), (Enum::value_type)test.load());
CHECK_EQUAL(compare.load(), test.load());
}
//*************************************************************************
@ -204,7 +204,7 @@ namespace
compare = &j;
test = &j;
CHECK_EQUAL((int*)compare.load(), (int*)test.load());
CHECK_EQUAL(compare.load(), test.load());
}
//*************************************************************************
@ -215,7 +215,7 @@ namespace
compare = true;
test = true;
CHECK_EQUAL((bool)compare.load(), (bool)test.load());
CHECK_EQUAL(compare.load(), test.load());
}
//*************************************************************************
@ -224,8 +224,8 @@ namespace
std::atomic<int> compare(1);
etl::atomic<int> test(1);
CHECK_EQUAL((int)++compare, (int)++test);
CHECK_EQUAL((int)++compare, (int)++test);
CHECK_EQUAL(++compare, ++test);
CHECK_EQUAL(++compare, ++test);
}
//*************************************************************************
@ -234,8 +234,8 @@ namespace
std::atomic<int> compare(1);
etl::atomic<int> test(1);
CHECK_EQUAL((int)compare++, (int)test++);
CHECK_EQUAL((int)compare++, (int)test++);
CHECK_EQUAL(compare++, test++);
CHECK_EQUAL(compare++, test++);
}
//*************************************************************************
@ -244,8 +244,8 @@ namespace
std::atomic<int> compare(1);
etl::atomic<int> test(1);
CHECK_EQUAL((int)--compare, (int)--test);
CHECK_EQUAL((int)--compare, (int)--test);
CHECK_EQUAL(--compare, --test);
CHECK_EQUAL(--compare, --test);
}
//*************************************************************************
@ -254,8 +254,8 @@ namespace
std::atomic<int> compare(1);
etl::atomic<int> test(1);
CHECK_EQUAL((int)compare--, (int)test--);
CHECK_EQUAL((int)compare--, (int)test--);
CHECK_EQUAL(compare--, test--);
CHECK_EQUAL(compare--, test--);
}
//*************************************************************************
@ -266,8 +266,8 @@ namespace
std::atomic<int*> compare(&data[0]);
etl::atomic<int*> test(&data[0]);
CHECK_EQUAL((int*)++compare, (int*)++test);
CHECK_EQUAL((int*)++compare, (int*)++test);
CHECK_EQUAL(++compare, ++test);
CHECK_EQUAL(++compare, ++test);
}
//*************************************************************************
@ -278,8 +278,8 @@ namespace
std::atomic<int*> compare(&data[0]);
etl::atomic<int*> test(&data[0]);
CHECK_EQUAL((int*)compare++, (int*)test++);
CHECK_EQUAL((int*)compare++, (int*)test++);
CHECK_EQUAL(compare++, test++);
CHECK_EQUAL(compare++, test++);
}
//*************************************************************************
@ -290,8 +290,8 @@ namespace
std::atomic<int*> compare(&data[3]);
etl::atomic<int*> test(&data[3]);
CHECK_EQUAL((int*)--compare, (int*)--test);
CHECK_EQUAL((int*)--compare, (int*)--test);
CHECK_EQUAL(--compare, --test);
CHECK_EQUAL(--compare, --test);
}
//*************************************************************************
@ -302,8 +302,8 @@ namespace
std::atomic<int*> compare(&data[3]);
etl::atomic<int*> test(&data[3]);
CHECK_EQUAL((int*)compare--, (int*)test--);
CHECK_EQUAL((int*)compare--, (int*)test--);
CHECK_EQUAL(compare--, test--);
CHECK_EQUAL(compare--, test--);
}
//*************************************************************************
@ -312,7 +312,7 @@ namespace
std::atomic<int> compare(1);
etl::atomic<int> test(1);
CHECK_EQUAL((int)compare.fetch_add(2), (int)test.fetch_add(2));
CHECK_EQUAL(compare.fetch_add(2), test.fetch_add(2));
}
//*************************************************************************
@ -323,7 +323,7 @@ namespace
std::atomic<int*> compare(&data[0]);
etl::atomic<int*> test(&data[0]);
CHECK_EQUAL((int*)compare.fetch_add(ptrdiff_t(10)), (int*)test.fetch_add(ptrdiff_t(10)));
CHECK_EQUAL(compare.fetch_add(ptrdiff_t(10)), test.fetch_add(ptrdiff_t(10)));
}
//*************************************************************************
@ -335,7 +335,7 @@ namespace
compare += 2;
test += 2;
CHECK_EQUAL((int)compare, (int)test);
CHECK_EQUAL(compare, test);
}
//*************************************************************************
@ -349,7 +349,7 @@ namespace
compare += 2;
test += 2;
CHECK_EQUAL((int*)compare, (int*)test);
CHECK_EQUAL(compare, test);
}
//*************************************************************************
@ -361,7 +361,7 @@ namespace
compare -= 2;
test -= 2;
CHECK_EQUAL((int)compare, (int)test);
CHECK_EQUAL(compare, test);
}
//*************************************************************************
@ -375,7 +375,7 @@ namespace
compare -= 2;
test -= 2;
CHECK_EQUAL((int*)compare, (int*)test);
CHECK_EQUAL(compare, test);
}
//*************************************************************************
@ -387,7 +387,7 @@ namespace
compare &= 0x55AA55AAUL;
test &= 0x55AA55AAUL;
CHECK_EQUAL((int)compare, (int)test);
CHECK_EQUAL(compare, test);
}
//*************************************************************************
@ -399,7 +399,7 @@ namespace
compare |= 0x55AA55AAUL;
test |= 0x55AA55AAUL;
CHECK_EQUAL((int)compare, (int)test);
CHECK_EQUAL(compare, test);
}
//*************************************************************************
@ -411,7 +411,7 @@ namespace
compare ^= 0x55AA55AAUL;
test ^= 0x55AA55AAUL;
CHECK_EQUAL((int)compare, (int)test);
CHECK_EQUAL(compare, test);
}
//*************************************************************************
@ -420,7 +420,7 @@ namespace
std::atomic<int> compare(1);
etl::atomic<int> test(1);
CHECK_EQUAL((int)compare.fetch_sub(2), (int)test.fetch_sub(2));
CHECK_EQUAL(compare.fetch_sub(2), test.fetch_sub(2));
}
//*************************************************************************
@ -431,7 +431,7 @@ namespace
std::atomic<int*> compare(&data[0]);
etl::atomic<int*> test(&data[0]);
CHECK_EQUAL((int*)compare.fetch_add(ptrdiff_t(10)), (int*)test.fetch_add(ptrdiff_t(10)));
CHECK_EQUAL(compare.fetch_add(ptrdiff_t(10)), test.fetch_add(ptrdiff_t(10)));
}
//*************************************************************************
@ -440,7 +440,7 @@ namespace
std::atomic<int> compare(0xFFFFFFFFUL);
etl::atomic<int> test(0xFFFFFFFFUL);
CHECK_EQUAL((int)compare.fetch_and(0x55AA55AAUL), (int)test.fetch_and(0x55AA55AAUL));
CHECK_EQUAL(compare.fetch_and(0x55AA55AAUL), test.fetch_and(0x55AA55AAUL));
}
//*************************************************************************
@ -449,7 +449,7 @@ namespace
std::atomic<int> compare(0x0000FFFFUL);
etl::atomic<int> test(0x0000FFFFUL);
CHECK_EQUAL((int)compare.fetch_or(0x55AA55AAUL), (int)test.fetch_or(0x55AA55AAUL));
CHECK_EQUAL(compare.fetch_or(0x55AA55AAUL), test.fetch_or(0x55AA55AAUL));
}
//*************************************************************************
@ -458,7 +458,7 @@ namespace
std::atomic<int> compare(0x0000FFFFUL);
etl::atomic<int> test(0x0000FFFFUL);
CHECK_EQUAL((int)compare.fetch_xor(0x55AA55AAUL), (int)test.fetch_xor(0x55AA55AAUL));
CHECK_EQUAL(compare.fetch_xor(0x55AA55AAUL), test.fetch_xor(0x55AA55AAUL));
}
//*************************************************************************
@ -467,7 +467,7 @@ namespace
std::atomic<int> compare(1);
etl::atomic<int> test(1);
CHECK_EQUAL((int)compare.exchange(2), (int)test.exchange(2));
CHECK_EQUAL(compare.exchange(2), test.exchange(2));
}
//*************************************************************************
@ -476,7 +476,7 @@ namespace
std::atomic<Enum> compare(Enum::One);
etl::atomic<Enum> test(Enum::One);
CHECK_EQUAL((Enum)compare.exchange(Enum::Two), (Enum)test.exchange(Enum::Two));
CHECK_EQUAL(compare.exchange(Enum::Two), test.exchange(Enum::Two));
}
//*************************************************************************
@ -488,7 +488,7 @@ namespace
std::atomic<int*> compare(&i);
etl::atomic<int*> test(&i);
CHECK_EQUAL((int*)compare.exchange(&j), (int*)test.exchange(&j));
CHECK_EQUAL(compare.exchange(&j), test.exchange(&j));
}
//*************************************************************************
@ -497,7 +497,7 @@ namespace
std::atomic<bool> compare(false);
etl::atomic<bool> test(false);
CHECK_EQUAL((bool)compare.exchange(true), (bool)test.exchange(true));
CHECK_EQUAL(compare.exchange(true), test.exchange(true));
}
//*************************************************************************

View File

@ -38,6 +38,8 @@ SOFTWARE.
#include "etl/integral_limits.h"
#include "etl/type_traits.h"
#include "etl/private/diagnostic_useless_cast_push.h"
namespace
{
//***********************************
@ -2759,3 +2761,5 @@ namespace
};
}
#include "etl/private/diagnostic_pop.h"

View File

@ -34,6 +34,8 @@ SOFTWARE.
#include "etl/bit.h"
#include "etl/fnv_1.h"
#include "etl/private/diagnostic_useless_cast_push.h"
namespace
{
//***********************************
@ -1525,3 +1527,4 @@ namespace
};
}
#include "etl/private/diagnostic_pop.h"

View File

@ -34,6 +34,8 @@ SOFTWARE.
#include <array>
#include <numeric>
#include "etl/private/diagnostic_useless_cast_push.h"
namespace
{
//***********************************
@ -1072,3 +1074,5 @@ namespace
}
};
}
#include "etl/private/diagnostic_pop.h"

View File

@ -34,6 +34,7 @@ SOFTWARE.
#include <numeric>
#include "etl/private/diagnostic_unused_function_push.h"
#include "etl/private/diagnostic_useless_cast_push.h"
namespace
{
@ -1507,3 +1508,4 @@ namespace
}
#include "etl/private/diagnostic_pop.h"
#include "etl/private/diagnostic_pop.h"

View File

@ -33,6 +33,8 @@ SOFTWARE.
#include <array>
#include <numeric>
#include "etl/private/diagnostic_useless_cast_push.h"
namespace
{
//***********************************
@ -1193,3 +1195,5 @@ namespace
};
}
#include "etl/private/diagnostic_pop.h"

View File

@ -34,6 +34,8 @@ SOFTWARE.
#include <vector>
#include <numeric>
#include "etl/private/diagnostic_useless_cast_push.h"
namespace
{
//***********************************
@ -794,3 +796,5 @@ namespace
};
}
#include "etl/private/diagnostic_pop.h"

View File

@ -34,6 +34,8 @@ SOFTWARE.
#include <vector>
#include <numeric>
#include "etl/private/diagnostic_useless_cast_push.h"
namespace
{
//***********************************
@ -881,3 +883,5 @@ namespace
}
};
}
#include "etl/private/diagnostic_pop.h"

View File

@ -37,6 +37,8 @@ SOFTWARE.
#include <numeric>
#include <vector>
#include "etl/private/diagnostic_useless_cast_push.h"
namespace
{
//***********************************
@ -1346,3 +1348,5 @@ namespace
}
};
}
#include "etl/private/diagnostic_pop.h"

View File

@ -32,6 +32,8 @@ SOFTWARE.
#include "etl/char_traits.h"
#include "etl/private/diagnostic_useless_cast_push.h"
namespace
{
template <typename T>
@ -724,3 +726,5 @@ namespace
}
};
}
#include "etl/private/diagnostic_pop.h"

File diff suppressed because it is too large Load Diff

View File

@ -330,7 +330,7 @@ namespace
{
DataDC data;
CHECK(data.size()== size_t(0UL));
CHECK(data.size()== 0UL);
CHECK(data.empty());
CHECK(data.capacity()== SIZE);
CHECK(data.max_size()== SIZE);
@ -1182,13 +1182,13 @@ namespace
DataNDC data(compare_data.begin(), compare_data.end());
data.clear();
CHECK(data.size() == size_t(0UL));
CHECK(data.size() == 0UL);
// Do it again to check that clear() didn't screw up the internals.
data.assign(compare_data.begin(), compare_data.end());
CHECK(data.size() == compare_data.size());
data.clear();
CHECK(data.size() == size_t(0UL));
CHECK(data.size() == 0UL);
}
//*************************************************************************
@ -1196,13 +1196,13 @@ namespace
{
DataInt data(int_data.begin(), int_data.end());
data.clear();
CHECK(data.size() == size_t(0UL));
CHECK(data.size() == 0UL);
// Do it again to check that clear() didn't screw up the internals.
data.assign(int_data.begin(), int_data.end());
CHECK(data.size() == int_data.size());
data.clear();
CHECK(data.size() == size_t(0UL));
CHECK(data.size() == 0UL);
}
//*************************************************************************

View File

@ -290,7 +290,7 @@ namespace
{
DataDC data;
CHECK(data.size() == size_t(0UL));
CHECK(data.size() == 0UL);
CHECK(data.empty());
CHECK(data.capacity() == SIZE);
CHECK(data.max_size() == SIZE);
@ -917,13 +917,13 @@ namespace
DataNDC data(compare_data.begin(), compare_data.end());
data.clear();
CHECK(data.size() == size_t(0UL));
CHECK(data.size() == 0UL);
// Do it again to check that clear() didn't screw up the internals.
data.assign(compare_data.begin(), compare_data.end());
CHECK(data.size() == compare_data.size());
data.clear();
CHECK(data.size() == size_t(0UL));
CHECK(data.size() == 0UL);
}
//*************************************************************************
@ -932,13 +932,13 @@ namespace
DataInt data(int_data.begin(), int_data.end());
data.clear();
CHECK(data.size() == size_t(0UL));
CHECK(data.size() == 0UL);
// Do it again to check that clear() didn't screw up the internals.
data.assign(int_data.begin(), int_data.end());
CHECK(data.size() == int_data.size());
data.clear();
CHECK(data.size() == size_t(0UL));
CHECK(data.size() == 0UL);
}
//*************************************************************************

View File

@ -284,7 +284,7 @@ namespace
{
DataDC data;
CHECK_EQUAL(data.size(), size_t(0UL));
CHECK_EQUAL(data.size(), 0UL);
CHECK(data.empty());
CHECK_EQUAL(data.capacity(), SIZE);
CHECK_EQUAL(data.max_size(), SIZE);
@ -917,13 +917,13 @@ namespace
DataNDC data(compare_data.begin(), compare_data.end());
data.clear();
CHECK_EQUAL(data.size(), size_t(0UL));
CHECK_EQUAL(data.size(), 0UL);
// Do it again to check that clear() didn't screw up the internals.
data.assign(compare_data.begin(), compare_data.end());
CHECK_EQUAL(data.size(), compare_data.size());
data.clear();
CHECK_EQUAL(data.size(), size_t(0UL));
CHECK_EQUAL(data.size(), 0UL);
}
//*************************************************************************
@ -932,13 +932,13 @@ namespace
DataInt data(int_data.begin(), int_data.end());
data.clear();
CHECK_EQUAL(data.size(), size_t(0UL));
CHECK_EQUAL(data.size(), 0UL);
// Do it again to check that clear() didn't screw up the internals.
data.assign(int_data.begin(), int_data.end());
CHECK_EQUAL(data.size(), int_data.size());
data.clear();
CHECK_EQUAL(data.size(), size_t(0UL));
CHECK_EQUAL(data.size(), 0UL);
}
//*************************************************************************

View File

@ -187,7 +187,7 @@ namespace
//bool operator == (const D4& lhs, const D4& rhs)
//{
// return (lhs.a == rhs.a) && (lhs.b == rhs.b) && (lhs.c == rhs.c) && (lhs.d == rhs.d);
// return (lhs.a == rhs.a) && (lhs.b == rhs.b) && (lhs.c == rhs.c) && (lhs.d == rhs.d);
//}
//bool operator != (const D1& lhs, const D1& rhs)
@ -297,7 +297,7 @@ namespace
{
DataDC data;
CHECK_EQUAL(data.size(), size_t(0UL));
CHECK_EQUAL(data.size(), 0UL);
CHECK(data.empty());
CHECK_EQUAL(data.capacity(), SIZE);
CHECK_EQUAL(data.max_size(), SIZE);
@ -907,13 +907,13 @@ namespace
DataNDC data(compare_data.begin(), compare_data.end());
data.clear();
CHECK_EQUAL(data.size(), size_t(0UL));
CHECK_EQUAL(data.size(), 0UL);
// Do it again to check that clear() didn't screw up the internals.
data.assign(compare_data.begin(), compare_data.end());
CHECK_EQUAL(data.size(), compare_data.size());
data.clear();
CHECK_EQUAL(data.size(), size_t(0UL));
CHECK_EQUAL(data.size(), 0UL);
}
//*************************************************************************
@ -921,13 +921,13 @@ namespace
{
DataInt data(int_data.begin(), int_data.end());
data.clear();
CHECK_EQUAL(data.size(), size_t(0UL));
CHECK_EQUAL(data.size(), 0UL);
// Do it again to check that clear() didn't screw up the internals.
data.assign(int_data.begin(), int_data.end());
CHECK_EQUAL(data.size(), int_data.size());
data.clear();
CHECK_EQUAL(data.size(), size_t(0UL));
CHECK_EQUAL(data.size(), 0UL);
}
//*************************************************************************

View File

@ -425,7 +425,7 @@ namespace
data.assign(sorted_data.begin(), sorted_data.end());
CHECK_EQUAL(SIZE, data.size());
data.clear();
CHECK_EQUAL(size_t(0UL), data.size());
CHECK_EQUAL(0UL, data.size());
}
//*************************************************************************
@ -440,7 +440,7 @@ namespace
data.resize(SIZE);
CHECK_EQUAL(SIZE, data.size());
data.clear();
CHECK_EQUAL(size_t(0UL), data.size());
CHECK_EQUAL(0UL, data.size());
}
//*************************************************************************

View File

@ -96,7 +96,7 @@ namespace
PoolDC pool;
DataDC data(pool);
CHECK_EQUAL(data.size(), size_t(0UL));
CHECK_EQUAL(data.size(), 0UL);
CHECK(data.empty());
CHECK(!data.full());
CHECK_EQUAL(data.available(), SIZE);
@ -496,9 +496,9 @@ namespace
data2.assign(sorted_data.begin(), sorted_data.end());
CHECK_EQUAL(sorted_data.size(), data2.size());
data1.clear();
CHECK_EQUAL(size_t(0UL), data1.size());
CHECK_EQUAL(0UL, data1.size());
data2.clear();
CHECK_EQUAL(size_t(0UL), data2.size());
CHECK_EQUAL(0UL, data2.size());
}
//*************************************************************************
@ -520,12 +520,12 @@ namespace
data1.resize(SIZE);
CHECK_EQUAL(SIZE, data1.size());
data1.clear();
CHECK_EQUAL(size_t(0UL), data1.size());
CHECK_EQUAL(0UL, data1.size());
data2.resize(SIZE);
CHECK_EQUAL(SIZE, data2.size());
data2.clear();
CHECK_EQUAL(size_t(0UL), data2.size());
CHECK_EQUAL(0UL, data2.size());
}
//*************************************************************************

View File

@ -49,8 +49,6 @@ namespace etl
namespace
{
SUITE(test_hash)
{
//*************************************************************************
@ -66,7 +64,7 @@ namespace
//*************************************************************************
TEST(test_hash_char)
{
size_t hash = etl::hash<char>()((char)(0x5A));
size_t hash = etl::hash<char>()(0x5A);
CHECK_EQUAL(0x5AU, hash);
}
@ -74,7 +72,7 @@ namespace
//*************************************************************************
TEST(test_hash_signed_char)
{
size_t hash = etl::hash<signed char>()((signed char)(0x5A));
size_t hash = etl::hash<signed char>()(0x5A);
CHECK_EQUAL(0x5AU, hash);
}
@ -82,7 +80,7 @@ namespace
//*************************************************************************
TEST(test_hash_unsigned_char)
{
size_t hash = etl::hash<unsigned char>()((unsigned char)(0x5AU));
size_t hash = etl::hash<unsigned char>()(0x5AU);
CHECK_EQUAL(0x5AU, hash);
}
@ -90,7 +88,7 @@ namespace
//*************************************************************************
TEST(test_hash_short)
{
size_t hash = etl::hash<short>()((short)(0x5AA5));
size_t hash = etl::hash<short>()(0x5AA5);
CHECK_EQUAL(0x5AA5U, hash);
}
@ -98,7 +96,7 @@ namespace
//*************************************************************************
TEST(test_hash_unsigned_short)
{
size_t hash = etl::hash<unsigned short>()((unsigned short)(0x5AA5U));
size_t hash = etl::hash<unsigned short>()(0x5AA5U);
CHECK_EQUAL(0x5AA5U, hash);
}
@ -106,7 +104,7 @@ namespace
//*************************************************************************
TEST(test_hash_int)
{
size_t hash = etl::hash<int>()((int)(0x5AA555AAL));
size_t hash = etl::hash<int>()(0x5AA555AA);
CHECK_EQUAL(0x5AA555AAUL, hash);
}
@ -114,7 +112,7 @@ namespace
//*************************************************************************
TEST(test_hash_unsigned_int)
{
size_t hash = etl::hash<unsigned int>()((unsigned int)(0x5AA555AAUL));
size_t hash = etl::hash<unsigned int>()(0x5AA555AAU);
CHECK_EQUAL(0x5AA555AAUL, hash);
}
@ -122,7 +120,7 @@ namespace
//*************************************************************************
TEST(test_hash_long)
{
size_t hash = etl::hash<long>()((long)(0x5AA555AAL));
size_t hash = etl::hash<long>()(0x5AA555AAL);
CHECK_EQUAL(0x5AA555AAUL, hash);
}
@ -130,7 +128,7 @@ namespace
//*************************************************************************
TEST(test_hash_unsigned_long)
{
size_t hash = etl::hash<unsigned long>()((unsigned long)(0x5AA555AAUL));
size_t hash = etl::hash<unsigned long>()(0x5AA555AAUL);
CHECK_EQUAL(0x5AA555AAUL, hash);
}
@ -138,7 +136,7 @@ namespace
//*************************************************************************
TEST(test_hash_long_long)
{
size_t hash = etl::hash<long long>()((long long)(0x5AA555AA3CC333CCULL));
size_t hash = etl::hash<long long>()(0x5AA555AA3CC333CCLL);
if (ETL_PLATFORM_32BIT)
{
@ -154,7 +152,7 @@ namespace
//*************************************************************************
TEST(test_hash_unsigned_long_long)
{
size_t hash = etl::hash<unsigned long long>()((unsigned long long)(0x5AA555AA3CC333CCULL));
size_t hash = etl::hash<unsigned long long>()(0x5AA555AA3CC333CCULL);
if (ETL_PLATFORM_32BIT)
{
@ -186,7 +184,7 @@ namespace
//*************************************************************************
TEST(test_hash_double)
{
size_t hash = etl::hash<double>()((double)(1.2345));
size_t hash = etl::hash<double>()(1.2345);
if (ETL_PLATFORM_32BIT)
{

View File

@ -1222,7 +1222,7 @@ namespace
DataNDC data(compare_data.begin(), compare_data.end());
data.clear();
CHECK_EQUAL(data.size(), size_t(0UL));
CHECK_EQUAL(data.size(), 0UL);
}
//*************************************************************************

View File

@ -149,7 +149,7 @@ namespace
DataDC data(lookup, pool);
CHECK_EQUAL(data.size(), size_t(0UL));
CHECK_EQUAL(data.size(), 0UL);
CHECK(data.empty());
CHECK_EQUAL(data.capacity(), SIZE);
CHECK_EQUAL(data.max_size(), SIZE);
@ -223,7 +223,7 @@ namespace
const NDC INITIAL_VALUE("1");
std::vector<NDC> compare_data(INITIAL_SIZE, INITIAL_VALUE);
DataNDC data(size_t(5UL), NDC("1"), lookup, pool);
DataNDC data(5UL, NDC("1"), lookup, pool);
CHECK(data.size() == INITIAL_SIZE);
CHECK(!data.empty());
@ -1256,7 +1256,7 @@ namespace
DataNDC data(compare_data.begin(), compare_data.end(), lookup, pool);
data.clear();
CHECK_EQUAL(data.size(), size_t(0UL));
CHECK_EQUAL(data.size(), 0UL);
}
//*************************************************************************

View File

@ -99,7 +99,7 @@ namespace
{
DataNDC data;
CHECK_EQUAL(data.size(), size_t(0UL));
CHECK_EQUAL(data.size(), 0UL);
CHECK(data.empty());
CHECK_EQUAL(data.max_size(), SIZE);
CHECK(data.begin() == data.end());
@ -404,7 +404,7 @@ namespace
data.assign(sorted_data.begin(), sorted_data.end());
CHECK_EQUAL(SIZE, data.size());
data.clear();
CHECK_EQUAL(size_t(0UL), data.size());
CHECK_EQUAL(0UL, data.size());
}
//*************************************************************************
@ -419,7 +419,7 @@ namespace
data.resize(SIZE);
CHECK_EQUAL(SIZE, data.size());
data.clear();
CHECK_EQUAL(size_t(0UL), data.size());
CHECK_EQUAL(0UL, data.size());
}
//*************************************************************************

View File

@ -126,7 +126,7 @@ namespace
Pool pool;
DataNDC data(pool);
CHECK_EQUAL(data.size(), size_t(0UL));
CHECK_EQUAL(data.size(), 0UL);
CHECK(data.empty());
CHECK(!data.full());
CHECK_EQUAL(data.available(), SIZE);
@ -143,12 +143,12 @@ namespace
DataNDC data1(pool);
DataNDC data2(pool);
CHECK_EQUAL(data1.size(), size_t(0UL));
CHECK_EQUAL(data1.size(), 0UL);
CHECK(data1.empty());
CHECK_EQUAL(data1.max_size(), SIZE);
CHECK(data1.begin() == data1.end());
CHECK_EQUAL(data2.size(), size_t(0UL));
CHECK_EQUAL(data2.size(), 0UL);
CHECK(data2.empty());
CHECK_EQUAL(data2.max_size(), SIZE);
CHECK(data2.begin() == data2.end());
@ -509,7 +509,7 @@ namespace
DataInt data2(SIZE / 2UL, 2, pool);
data1.clear();
CHECK_EQUAL(size_t(0UL), data1.size());
CHECK_EQUAL(0UL, data1.size());
CHECK_EQUAL(SIZE / 2UL, data2.size());
// Do it again to check that clear() didn't screw up the internals.
@ -517,7 +517,7 @@ namespace
CHECK_EQUAL(SIZE / 2UL, data1.size());
CHECK_EQUAL(SIZE / 2UL, data2.size());
data1.clear();
CHECK_EQUAL(size_t(0UL), data1.size());
CHECK_EQUAL(0UL, data1.size());
CHECK_EQUAL(SIZE / 2UL, data2.size());
}

View File

@ -206,7 +206,7 @@ namespace
{
Data data;
CHECK(data.size() == size_t(0UL));
CHECK(data.size() == 0UL);
CHECK(data.empty());
CHECK(data.capacity() == MAX_SIZE);
CHECK(data.max_size() == MAX_SIZE);
@ -1058,7 +1058,7 @@ namespace
Data data(compare_data.begin(), compare_data.end());
data.clear();
CHECK(data.size() == size_t(0UL));
CHECK(data.size() == 0UL);
}
//*************************************************************************
@ -1066,9 +1066,9 @@ namespace
{
const Data data(initial_data.begin(), initial_data.end());
CHECK(data.count("3") == size_t(1UL));
CHECK(data.count("3") == 1UL);
CHECK(data.count("A") == size_t(0UL));
CHECK(data.count("A") == 0UL);
}
//*************************************************************************
@ -1078,9 +1078,9 @@ namespace
const EMap data(initial_data.begin(), initial_data.end());
CHECK(data.count(Key("3")) == size_t(1UL));
CHECK(data.count(Key("3")) == 1UL);
CHECK(data.count(Key("A")) == size_t(0UL));
CHECK(data.count(Key("A")) == 0UL);
}
//*************************************************************************

View File

@ -208,7 +208,7 @@ namespace
{
Data data;
CHECK(data.size() == size_t(0UL));
CHECK(data.size() == 0UL);
CHECK(data.empty());
CHECK(data.capacity() == MAX_SIZE);
CHECK(data.max_size() == MAX_SIZE);
@ -888,7 +888,7 @@ namespace
Data data(compare_data.begin(), compare_data.end());
data.clear();
CHECK(data.size() == size_t(0UL));
CHECK(data.size() == 0UL);
}
//*************************************************************************

View File

@ -223,7 +223,7 @@ namespace
{
Data data;
CHECK_EQUAL(data.size(), size_t(0UL));
CHECK_EQUAL(data.size(), 0UL);
CHECK(data.empty());
CHECK_EQUAL(data.capacity(), MAX_SIZE);
CHECK_EQUAL(data.max_size(), MAX_SIZE);
@ -552,16 +552,16 @@ namespace
// Check that elements in multiset are the same
bool isEqual = Check_Equal(data.begin(),
data.end(),
compare_data.begin());
data.end(),
compare_data.begin());
CHECK(isEqual);
data.insert(Data::const_iterator(data_result), 1);
compare_data.insert(Compare_Data::const_iterator(compare_result), 1);
compare_data.insert(compare_result, 1);
isEqual = Check_Equal(data.begin(),
data.end(),
compare_data.begin());
data.end(),
compare_data.begin());
CHECK(isEqual);
}
@ -834,7 +834,7 @@ namespace
Data data(compare_data.begin(), compare_data.end());
data.clear();
CHECK_EQUAL(data.size(), size_t(0UL));
CHECK_EQUAL(data.size(), 0UL);
}
//*************************************************************************
@ -1551,7 +1551,7 @@ namespace
for (int eltNum = 0; eltNum != 10; ++eltNum)
{
data.insert(Data::value_type(keys[eltNum]));
data.insert(keys[eltNum]);
}
data.erase(2);

View File

@ -60,23 +60,23 @@ namespace
//*************************************************************************
TEST(test_midpoint_signed_integral)
{
CHECK_EQUAL(int32_t(0), (etl::midpoint(int32_t(0), int32_t(0))));
CHECK_EQUAL(int32_t(0), (etl::midpoint(int32_t(0), int32_t(1))));
CHECK_EQUAL(int32_t(1), (etl::midpoint(int32_t(1), int32_t(0))));
CHECK_EQUAL(0, (etl::midpoint(0, 0)));
CHECK_EQUAL(0, (etl::midpoint(0, 1)));
CHECK_EQUAL(1, (etl::midpoint(1, 0)));
CHECK_EQUAL(std::numeric_limits<int32_t>::max() / 2, (etl::midpoint(0, std::numeric_limits<int32_t>::max())));
CHECK_EQUAL((std::numeric_limits<int32_t>::max() / 2) + 1, (etl::midpoint(std::numeric_limits<int32_t>::max(), 0)));
CHECK_EQUAL(int32_t(-1), (etl::midpoint(std::numeric_limits<int32_t>::min(), std::numeric_limits<int32_t>::max())));
CHECK_EQUAL(int32_t(0), (etl::midpoint(std::numeric_limits<int32_t>::max(), std::numeric_limits<int32_t>::min())));
CHECK_EQUAL(-1, (etl::midpoint(std::numeric_limits<int32_t>::min(), std::numeric_limits<int32_t>::max())));
CHECK_EQUAL(0, (etl::midpoint(std::numeric_limits<int32_t>::max(), std::numeric_limits<int32_t>::min())));
}
//*************************************************************************
TEST(test_midpoint_unsigned_integral)
{
CHECK_EQUAL(uint32_t(0), (etl::midpoint(uint32_t(0), uint32_t(0))));
CHECK_EQUAL(uint32_t(0), (etl::midpoint(uint32_t(0), uint32_t(1))));
CHECK_EQUAL(uint32_t(1), (etl::midpoint(uint32_t(1), uint32_t(0))));
CHECK_EQUAL(0, (etl::midpoint(0U, 0U)));
CHECK_EQUAL(0, (etl::midpoint(0U, 1U)));
CHECK_EQUAL(1, (etl::midpoint(1U, 0U)));
CHECK_EQUAL((std::numeric_limits<uint32_t>::max() / 2U), (etl::midpoint(std::numeric_limits<uint32_t>::min(), std::numeric_limits<uint32_t>::max())));
CHECK_EQUAL((std::numeric_limits<uint32_t>::max() / 2U) + 1, (etl::midpoint(std::numeric_limits<uint32_t>::max(), std::numeric_limits<uint32_t>::min())));

View File

@ -460,31 +460,31 @@ namespace
Observer observer5;
observable.add_observer(observer1);
CHECK_EQUAL(size_t(1UL), observable.number_of_observers());
CHECK_EQUAL(1UL, observable.number_of_observers());
observable.add_observer(observer2);
CHECK_EQUAL(size_t(2UL), observable.number_of_observers());
CHECK_EQUAL(2UL, observable.number_of_observers());
observable.add_observer(observer3);
CHECK_EQUAL(size_t(3UL), observable.number_of_observers());
CHECK_EQUAL(3UL, observable.number_of_observers());
observable.add_observer(observer2);
CHECK_EQUAL(size_t(3UL), observable.number_of_observers());
CHECK_EQUAL(3UL, observable.number_of_observers());
observable.add_observer(observer4);
CHECK_EQUAL(size_t(4UL), observable.number_of_observers());
CHECK_EQUAL(4UL, observable.number_of_observers());
CHECK_THROW(observable.add_observer(observer5), etl::observer_list_full);
CHECK(observable.remove_observer(observer3));
CHECK_EQUAL(size_t(3UL), observable.number_of_observers());
CHECK_EQUAL(3UL, observable.number_of_observers());
// Try again.
CHECK(!observable.remove_observer(observer3));
CHECK_EQUAL(size_t(3UL), observable.number_of_observers());
CHECK_EQUAL(3UL, observable.number_of_observers());
observable.clear_observers();
CHECK_EQUAL(size_t(0UL), observable.number_of_observers());
CHECK_EQUAL(0UL, observable.number_of_observers());
}
}
}

View File

@ -132,7 +132,7 @@ namespace
result.emplace();
CHECK_TRUE(result.has_value());
CHECK_EQUAL(int(0), int(result.value()));
CHECK_EQUAL(0, int(result.value()));
}
//*************************************************************************

View File

@ -89,7 +89,7 @@ namespace
{
etl::priority_queue<int, SIZE> priority_queue;
CHECK_EQUAL(priority_queue.size(), size_t(0UL));
CHECK_EQUAL(priority_queue.size(), 0UL);
CHECK_EQUAL(priority_queue.available(), SIZE);
CHECK_EQUAL(priority_queue.max_size(), SIZE);
}

View File

@ -198,7 +198,7 @@ namespace
{
DataDC data;
CHECK_EQUAL(data.size(), size_t(0UL));
CHECK_EQUAL(data.size(), 0UL);
CHECK(data.empty());
CHECK_EQUAL(data.capacity(), SIZE);
CHECK_EQUAL(data.max_size(), SIZE);
@ -680,7 +680,7 @@ namespace
DataNDC data(initial_data.begin(), initial_data.end());
data.clear();
CHECK_EQUAL(data.size(), size_t(0UL));
CHECK_EQUAL(data.size(), 0UL);
}
//*************************************************************************

View File

@ -157,7 +157,7 @@ namespace
{
DataDC data;
CHECK_EQUAL(data.size(), size_t(0UL));
CHECK_EQUAL(data.size(), 0UL);
CHECK(data.empty());
CHECK_EQUAL(data.capacity(), SIZE);
CHECK_EQUAL(data.max_size(), SIZE);
@ -516,7 +516,7 @@ namespace
DataNDC data(initial_data.begin(), initial_data.end());
data.clear();
CHECK_EQUAL(data.size(), size_t(0UL));
CHECK_EQUAL(data.size(), 0UL);
}
//*************************************************************************

View File

@ -142,7 +142,7 @@ namespace
{
DataDC data;
CHECK_EQUAL(data.size(), size_t(0UL));
CHECK_EQUAL(data.size(), 0UL);
CHECK(data.empty());
CHECK_EQUAL(data.capacity(), SIZE);
CHECK_EQUAL(data.max_size(), SIZE);
@ -494,7 +494,7 @@ namespace
DataNDC data(initial_data.begin(), initial_data.end());
data.clear();
CHECK_EQUAL(data.size(), size_t(0UL));
CHECK_EQUAL(data.size(), 0UL);
}
//*************************************************************************

View File

@ -170,7 +170,7 @@ namespace
{
DataDC data;
CHECK_EQUAL(data.size(), size_t(0UL));
CHECK_EQUAL(data.size(), 0UL);
CHECK(data.empty());
CHECK_EQUAL(data.capacity(), SIZE);
CHECK_EQUAL(data.max_size(), SIZE);
@ -518,7 +518,7 @@ namespace
DataNDC data(initial_data.begin(), initial_data.end());
data.clear();
CHECK_EQUAL(data.size(), size_t(0UL));
CHECK_EQUAL(data.size(), 0UL);
}
//*************************************************************************

View File

@ -179,7 +179,7 @@ namespace
{
Data data;
CHECK_EQUAL(data.size(), size_t(0UL));
CHECK_EQUAL(data.size(), 0UL);
CHECK(data.empty());
CHECK_EQUAL(MAX_SIZE, data.available());
CHECK_EQUAL(MAX_SIZE, data.capacity());
@ -512,8 +512,8 @@ namespace
compare_data.begin());
CHECK(isEqual);
data.insert(Data::const_iterator(data_result.first), 1);
compare_data.insert(Compare_Data::const_iterator(compare_result.first), 1);
data.insert(data_result.first, 1);
compare_data.insert(compare_result.first, 1);
isEqual = Check_Equal(data.begin(),
data.end(),
@ -816,7 +816,7 @@ namespace
Data data(compare_data.begin(), compare_data.end());
data.clear();
CHECK_EQUAL(data.size(), size_t(0UL));
CHECK_EQUAL(data.size(), 0UL);
}
//*************************************************************************
@ -824,9 +824,9 @@ namespace
{
const Data data(initial_data.begin(), initial_data.end());
CHECK_EQUAL(data.count(3), size_t(1UL));
CHECK_EQUAL(data.count(3), 1UL);
CHECK_EQUAL(data.count(11), size_t(0UL));
CHECK_EQUAL(data.count(11), 0UL);
}
//*************************************************************************
@ -835,9 +835,9 @@ namespace
using EMap = etl::set<int, MAX_SIZE, etl::less<>>;
const EMap data(initial_data.begin(), initial_data.end());
CHECK_EQUAL(data.count(Key(3)), size_t(1UL));
CHECK_EQUAL(data.count(Key(3)), 1UL);
CHECK_EQUAL(data.count(Key(11)), size_t(0UL));
CHECK_EQUAL(data.count(Key(11)), 0UL);
}
//*************************************************************************

View File

@ -64,7 +64,7 @@ namespace
SUITE(test_string_char16_t)
{
static const size_t SIZE = 11;
static const size_t SIZE = 11;
using Text = etl::u16string<SIZE>;
using IText = etl::iu16string;
@ -2156,9 +2156,9 @@ namespace
CompareText compare_text(short_text.c_str());
Text text(short_text.c_str());
compare_text.replace(2, 4, CompareText(STR("Replace")).c_str());
compare_text.replace(2, 4, STR("Replace"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, 4, TextL(STR("Replace")).c_str());
text.replace(2, 4, STR("Replace"));
bool is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2170,9 +2170,9 @@ namespace
compare_text.assign(short_text.c_str());
text.assign(short_text.c_str());
compare_text.replace(2, CompareText::npos, CompareText(STR("Replace")).c_str());
compare_text.replace(2, CompareText::npos, STR("Replace"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, Text::npos, TextL(STR("Replace")).c_str());
text.replace(2, Text::npos, STR("Replace"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2184,9 +2184,9 @@ namespace
compare_text.assign(short_text.c_str());
text.assign(short_text.c_str());
compare_text.replace(2, 4, CompareText(STR("Replace with some text")).c_str());
compare_text.replace(2, 4, STR("Replace with some text"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, 4, TextL(STR("Replace with some text")).c_str());
text.replace(2, 4, STR("Replace with some text"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2198,9 +2198,9 @@ namespace
compare_text.assign(short_text.c_str());
text.assign(short_text.c_str());
compare_text.replace(2, CompareText::npos, CompareText(STR("Replace with some text")).c_str());
compare_text.replace(2, CompareText::npos, STR("Replace with some text"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, Text::npos, TextL(STR("Replace with some text")).c_str());
text.replace(2, Text::npos, STR("Replace with some text"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2212,9 +2212,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(2, 7, CompareText(STR("Replace")).c_str());
compare_text.replace(2, 7, STR("Replace"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, 7, TextL(STR("Replace")).c_str());
text.replace(2, 7, STR("Replace"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2226,9 +2226,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(2, CompareText::npos, CompareText(STR("Replace")).c_str());
compare_text.replace(2, CompareText::npos, STR("Replace"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, Text::npos, TextL(STR("Replace")).c_str());
text.replace(2, Text::npos, STR("Replace"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2240,9 +2240,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(2, 4, CompareText(STR("Replace with some text")).c_str());
compare_text.replace(2, 4, STR("Replace with some text"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, 4, TextL(STR("Replace with some text")).c_str());
text.replace(2, 4, STR("Replace with some text"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2254,9 +2254,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(2, CompareText::npos, CompareText(STR("Replace with some text")).c_str());
compare_text.replace(2, CompareText::npos, STR("Replace with some text"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, Text::npos, TextL(STR("Replace with some text")).c_str());
text.replace(2, Text::npos, STR("Replace with some text"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2272,9 +2272,9 @@ namespace
CompareText compare_text(short_text.c_str());
Text text(short_text.c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, CompareText(STR("Replace")).c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, STR("Replace"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(text.begin() + 2, text.begin() + 4, TextL(STR("Replace")).c_str());
text.replace(text.begin() + 2, text.begin() + 4, STR("Replace"));
bool is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2286,9 +2286,9 @@ namespace
compare_text.assign(short_text.c_str());
text.assign(short_text.c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, CompareText(STR("Replace with some text")).c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, STR("Replace with some text"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(text.begin() + 2, text.begin() + 4, TextL(STR("Replace with some text")).c_str());
text.replace(text.begin() + 2, text.begin() + 4, STR("Replace with some text"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2300,9 +2300,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 9, CompareText(STR("Replace")).c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 9, STR("Replace"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(text.begin() + 2, text.begin() + 9, TextL(STR("Replace")).c_str());
text.replace(text.begin() + 2, text.begin() + 9, STR("Replace"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2314,9 +2314,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, CompareText(STR("Replace with some text")).c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, STR("Replace with some text"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(text.begin() + 2, text.begin() + 4, TextL(STR("Replace with some text")).c_str());
text.replace(text.begin() + 2, text.begin() + 4, STR("Replace with some text"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2332,9 +2332,9 @@ namespace
CompareText compare_text(short_text.c_str());
Text text(short_text.c_str());
compare_text.replace(2, 4, CompareText(STR("Replace")).c_str(), 5);
compare_text.replace(2, 4, STR("Replace"), 5);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, 4, TextL(STR("Replace")).c_str(), 5);
text.replace(2, 4, STR("Replace"), 5);
bool is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2346,9 +2346,9 @@ namespace
compare_text.assign(short_text.c_str());
text.assign(short_text.c_str());
compare_text.replace(2, CompareText::npos, CompareText(STR("Replace")).c_str(), 5);
compare_text.replace(2, CompareText::npos, STR("Replace"), 5);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, Text::npos, TextL(STR("Replace")).c_str(), 5);
text.replace(2, Text::npos, STR("Replace"), 5);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2360,9 +2360,9 @@ namespace
compare_text.assign(short_text.c_str());
text.assign(short_text.c_str());
compare_text.replace(2, 4, CompareText(STR("Replace with some text")).c_str(), 15);
compare_text.replace(2, 4, STR("Replace with some text"), 15);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, 4, TextL(STR("Replace with some text")).c_str(), 15);
text.replace(2, 4, STR("Replace with some text"), 15);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2374,9 +2374,9 @@ namespace
compare_text.assign(short_text.c_str());
text.assign(short_text.c_str());
compare_text.replace(2, CompareText::npos, CompareText(STR("Replace with some text")).c_str(), 15);
compare_text.replace(2, CompareText::npos, STR("Replace with some text"), 15);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, Text::npos, TextL(STR("Replace with some text")).c_str(), 15);
text.replace(2, Text::npos, STR("Replace with some text"), 15);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2388,9 +2388,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(2, 7, CompareText(STR("Replace")).c_str(), 5);
compare_text.replace(2, 7, STR("Replace"), 5);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, 7, TextL(STR("Replace")).c_str(), 5);
text.replace(2, 7, STR("Replace"), 5);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2402,9 +2402,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(2, CompareText::npos, CompareText(STR("Replace")).c_str(), 5);
compare_text.replace(2, CompareText::npos, STR("Replace"), 5);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, Text::npos, TextL(STR("Replace")).c_str(), 5);
text.replace(2, Text::npos, STR("Replace"), 5);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2416,9 +2416,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(2, 4, CompareText(STR("Replace with some text")).c_str(), 15);
compare_text.replace(2, 4, STR("Replace with some text"), 15);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, 4, TextL(STR("Replace with some text")).c_str(), 15);
text.replace(2, 4, STR("Replace with some text"), 15);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2430,9 +2430,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(2, CompareText::npos, CompareText(STR("Replace with some text")).c_str(), 15);
compare_text.replace(2, CompareText::npos, STR("Replace with some text"), 15);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, Text::npos, TextL(STR("Replace with some text")).c_str(), 15);
text.replace(2, Text::npos, STR("Replace with some text"), 15);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2448,9 +2448,9 @@ namespace
CompareText compare_text(short_text.c_str());
Text text(short_text.c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, CompareText(STR("Replace")).c_str(), 5);
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, STR("Replace"), 5);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(text.begin() + 2, text.begin() + 4, TextL(STR("Replace")).c_str(), 5);
text.replace(text.begin() + 2, text.begin() + 4, STR("Replace"), 5);
bool is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2464,7 +2464,7 @@ namespace
compare_text.assign(short_text.c_str());
text.assign(short_text.c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, CompareText(STR("Replace with some text")).c_str(), 15);
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, STR("Replace with some text"), 15);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(text.begin() + 2, text.begin() + 4, STR("Replace with some text"), 15);
@ -2480,9 +2480,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 9, CompareText(STR("Replace")).c_str(), 5);
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 9, STR("Replace"), 5);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(text.begin() + 2, text.begin() + 9, TextL(STR("Replace")).c_str(), 5);
text.replace(text.begin() + 2, text.begin() + 9, STR("Replace"), 5);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2496,9 +2496,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, CompareText(STR("Replace with some text")).c_str(), 15);
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, STR("Replace with some text"), 15);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(text.begin() + 2, text.begin() + 4, TextL(STR("Replace with some text")).c_str(), 15);
text.replace(text.begin() + 2, text.begin() + 4, STR("Replace with some text"), 15);
is_equal = Equal(compare_text, text);
CHECK(is_equal);

View File

@ -62,7 +62,7 @@ namespace
// return os;
//}
SUITE(test_string_char16_t_external_buffer)
{
static constexpr size_t SIZE = 11;
@ -2423,9 +2423,9 @@ namespace
TextBuffer buffer{0};
Text text(short_text.c_str(), buffer.data(), buffer.size());
compare_text.replace(2, 4, CompareText(STR("Replace")).c_str());
compare_text.replace(2, 4, STR("Replace"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, 4, TextL(STR("Replace")).c_str());
text.replace(2, 4, STR("Replace"));
bool is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2437,9 +2437,9 @@ namespace
compare_text.assign(short_text.c_str());
text.assign(short_text.c_str());
compare_text.replace(2, CompareText::npos, CompareText(STR("Replace")).c_str());
compare_text.replace(2, CompareText::npos, STR("Replace"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, Text::npos, TextL(STR("Replace")).c_str());
text.replace(2, Text::npos, STR("Replace"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2451,9 +2451,9 @@ namespace
compare_text.assign(short_text.c_str());
text.assign(short_text.c_str());
compare_text.replace(2, 4, CompareText(STR("Replace with some text")).c_str());
compare_text.replace(2, 4, STR("Replace with some text"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, 4, TextL(STR("Replace with some text")).c_str());
text.replace(2, 4, STR("Replace with some text"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2465,9 +2465,9 @@ namespace
compare_text.assign(short_text.c_str());
text.assign(short_text.c_str());
compare_text.replace(2, CompareText::npos, CompareText(STR("Replace with some text")).c_str());
compare_text.replace(2, CompareText::npos, STR("Replace with some text"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, Text::npos, TextL(STR("Replace with some text")).c_str());
text.replace(2, Text::npos, STR("Replace with some text"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2479,9 +2479,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(2, 7, CompareText(STR("Replace")).c_str());
compare_text.replace(2, 7, STR("Replace"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, 7, TextL(STR("Replace")).c_str());
text.replace(2, 7, STR("Replace"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2493,9 +2493,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(2, CompareText::npos, CompareText(STR("Replace")).c_str());
compare_text.replace(2, CompareText::npos, STR("Replace"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, Text::npos, TextL(STR("Replace")).c_str());
text.replace(2, Text::npos, STR("Replace"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2507,9 +2507,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(2, 4, CompareText(STR("Replace with some text")).c_str());
compare_text.replace(2, 4, STR("Replace with some text"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, 4, TextL(STR("Replace with some text")).c_str());
text.replace(2, 4, STR("Replace with some text"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2521,9 +2521,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(2, CompareText::npos, CompareText(STR("Replace with some text")).c_str());
compare_text.replace(2, CompareText::npos, STR("Replace with some text"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, Text::npos, TextL(STR("Replace with some text")).c_str());
text.replace(2, Text::npos, STR("Replace with some text"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2541,9 +2541,9 @@ namespace
TextBuffer buffer{0};
Text text(short_text.c_str(), buffer.data(), buffer.size());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, CompareText(STR("Replace")).c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, STR("Replace"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(text.begin() + 2, text.begin() + 4, TextL(STR("Replace")).c_str());
text.replace(text.begin() + 2, text.begin() + 4, STR("Replace"));
bool is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2555,9 +2555,9 @@ namespace
compare_text.assign(short_text.c_str());
text.assign(short_text.c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, CompareText(STR("Replace with some text")).c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, STR("Replace with some text"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(text.begin() + 2, text.begin() + 4, TextL(STR("Replace with some text")).c_str());
text.replace(text.begin() + 2, text.begin() + 4, STR("Replace with some text"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2569,9 +2569,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 9, CompareText(STR("Replace")).c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 9, STR("Replace"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(text.begin() + 2, text.begin() + 9, TextL(STR("Replace")).c_str());
text.replace(text.begin() + 2, text.begin() + 9, STR("Replace"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2583,9 +2583,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, CompareText(STR("Replace with some text")).c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, STR("Replace with some text"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(text.begin() + 2, text.begin() + 4, TextL(STR("Replace with some text")).c_str());
text.replace(text.begin() + 2, text.begin() + 4, STR("Replace with some text"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2603,9 +2603,9 @@ namespace
TextBuffer buffer{0};
Text text(short_text.c_str(), buffer.data(), buffer.size());
compare_text.replace(2, 4, CompareText(STR("Replace")).c_str(), 5);
compare_text.replace(2, 4, STR("Replace"), 5);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, 4, TextL(STR("Replace")).c_str(), 5);
text.replace(2, 4, STR("Replace"), 5);
bool is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2617,9 +2617,9 @@ namespace
compare_text.assign(short_text.c_str());
text.assign(short_text.c_str());
compare_text.replace(2, CompareText::npos, CompareText(STR("Replace")).c_str(), 5);
compare_text.replace(2, CompareText::npos, STR("Replace"), 5);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, Text::npos, TextL(STR("Replace")).c_str(), 5);
text.replace(2, Text::npos, STR("Replace"), 5);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2631,9 +2631,9 @@ namespace
compare_text.assign(short_text.c_str());
text.assign(short_text.c_str());
compare_text.replace(2, 4, CompareText(STR("Replace with some text")).c_str(), 15);
compare_text.replace(2, 4, STR("Replace with some text"), 15);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, 4, TextL(STR("Replace with some text")).c_str(), 15);
text.replace(2, 4, STR("Replace with some text"), 15);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2645,9 +2645,9 @@ namespace
compare_text.assign(short_text.c_str());
text.assign(short_text.c_str());
compare_text.replace(2, CompareText::npos, CompareText(STR("Replace with some text")).c_str(), 15);
compare_text.replace(2, CompareText::npos, STR("Replace with some text"), 15);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, Text::npos, TextL(STR("Replace with some text")).c_str(), 15);
text.replace(2, Text::npos, STR("Replace with some text"), 15);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2659,9 +2659,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(2, 7, CompareText(STR("Replace")).c_str(), 5);
compare_text.replace(2, 7, STR("Replace"), 5);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, 7, TextL(STR("Replace")).c_str(), 5);
text.replace(2, 7, STR("Replace"), 5);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2673,9 +2673,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(2, CompareText::npos, CompareText(STR("Replace")).c_str(), 5);
compare_text.replace(2, CompareText::npos, STR("Replace"), 5);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, Text::npos, TextL(STR("Replace")).c_str(), 5);
text.replace(2, Text::npos, STR("Replace"), 5);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2687,9 +2687,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(2, 4, CompareText(STR("Replace with some text")).c_str(), 15);
compare_text.replace(2, 4, STR("Replace with some text"), 15);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, 4, TextL(STR("Replace with some text")).c_str(), 15);
text.replace(2, 4, STR("Replace with some text"), 15);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2701,9 +2701,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(2, CompareText::npos, CompareText(STR("Replace with some text")).c_str(), 15);
compare_text.replace(2, CompareText::npos, STR("Replace with some text"), 15);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, Text::npos, TextL(STR("Replace with some text")).c_str(), 15);
text.replace(2, Text::npos, STR("Replace with some text"), 15);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2721,9 +2721,9 @@ namespace
TextBuffer buffer{0};
Text text(short_text.c_str(), buffer.data(), buffer.size());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, CompareText(STR("Replace")).c_str(), 5);
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, STR("Replace"), 5);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(text.begin() + 2, text.begin() + 4, TextL(STR("Replace")).c_str(), 5);
text.replace(text.begin() + 2, text.begin() + 4, STR("Replace"), 5);
bool is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2737,9 +2737,9 @@ namespace
compare_text.assign(short_text.c_str());
text.assign(short_text.c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, CompareText(STR("Replace with some text")).c_str(), 15);
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, STR("Replace with some text"), 15);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(text.begin() + 2, text.begin() + 4, TextL(STR("Replace with some text")).c_str(), 15);
text.replace(text.begin() + 2, text.begin() + 4, STR("Replace with some text"), 15);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2753,9 +2753,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 9, CompareText(STR("Replace")).c_str(), 5);
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 9, STR("Replace"), 5);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(text.begin() + 2, text.begin() + 9, TextL(STR("Replace")).c_str(), 5);
text.replace(text.begin() + 2, text.begin() + 9, STR("Replace"), 5);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2769,9 +2769,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, CompareText(STR("Replace with some text")).c_str(), 15);
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, STR("Replace with some text"), 15);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(text.begin() + 2, text.begin() + 4, TextL(STR("Replace with some text")).c_str(), 15);
text.replace(text.begin() + 2, text.begin() + 4, STR("Replace with some text"), 15);
is_equal = Equal(compare_text, text);
CHECK(is_equal);

View File

@ -2156,9 +2156,9 @@ namespace
CompareText compare_text(short_text.c_str());
Text text(short_text.c_str());
compare_text.replace(2, 4, CompareText(STR("Replace")).c_str());
compare_text.replace(2, 4, STR("Replace"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, 4, TextL(STR("Replace")).c_str());
text.replace(2, 4, STR("Replace"));
bool is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2170,9 +2170,9 @@ namespace
compare_text.assign(short_text.c_str());
text.assign(short_text.c_str());
compare_text.replace(2, CompareText::npos, CompareText(STR("Replace")).c_str());
compare_text.replace(2, CompareText::npos, STR("Replace"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, Text::npos, TextL(STR("Replace")).c_str());
text.replace(2, Text::npos, STR("Replace"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2184,9 +2184,9 @@ namespace
compare_text.assign(short_text.c_str());
text.assign(short_text.c_str());
compare_text.replace(2, 4, CompareText(STR("Replace with some text")).c_str());
compare_text.replace(2, 4, STR("Replace with some text"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, 4, TextL(STR("Replace with some text")).c_str());
text.replace(2, 4, STR("Replace with some text"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2198,9 +2198,9 @@ namespace
compare_text.assign(short_text.c_str());
text.assign(short_text.c_str());
compare_text.replace(2, CompareText::npos, CompareText(STR("Replace with some text")).c_str());
compare_text.replace(2, CompareText::npos, STR("Replace with some text"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, Text::npos, TextL(STR("Replace with some text")).c_str());
text.replace(2, Text::npos, STR("Replace with some text"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2212,9 +2212,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(2, 7, CompareText(STR("Replace")).c_str());
compare_text.replace(2, 7, STR("Replace"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, 7, TextL(STR("Replace")).c_str());
text.replace(2, 7, STR("Replace"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2226,9 +2226,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(2, CompareText::npos, CompareText(STR("Replace")).c_str());
compare_text.replace(2, CompareText::npos, STR("Replace"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, Text::npos, TextL(STR("Replace")).c_str());
text.replace(2, Text::npos, STR("Replace"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2240,9 +2240,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(2, 4, CompareText(STR("Replace with some text")).c_str());
compare_text.replace(2, 4, STR("Replace with some text"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, 4, TextL(STR("Replace with some text")).c_str());
text.replace(2, 4, STR("Replace with some text"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2254,9 +2254,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(2, CompareText::npos, CompareText(STR("Replace with some text")).c_str());
compare_text.replace(2, CompareText::npos, STR("Replace with some text"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, Text::npos, TextL(STR("Replace with some text")).c_str());
text.replace(2, Text::npos, STR("Replace with some text"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2272,9 +2272,9 @@ namespace
CompareText compare_text(short_text.c_str());
Text text(short_text.c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, CompareText(STR("Replace")).c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, STR("Replace"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(text.begin() + 2, text.begin() + 4, TextL(STR("Replace")).c_str());
text.replace(text.begin() + 2, text.begin() + 4, STR("Replace"));
bool is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2286,9 +2286,9 @@ namespace
compare_text.assign(short_text.c_str());
text.assign(short_text.c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, CompareText(STR("Replace with some text")).c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, STR("Replace with some text"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(text.begin() + 2, text.begin() + 4, TextL(STR("Replace with some text")).c_str());
text.replace(text.begin() + 2, text.begin() + 4, STR("Replace with some text"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2300,9 +2300,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 9, CompareText(STR("Replace")).c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 9, STR("Replace"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(text.begin() + 2, text.begin() + 9, TextL(STR("Replace")).c_str());
text.replace(text.begin() + 2, text.begin() + 9, STR("Replace"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2314,9 +2314,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, CompareText(STR("Replace with some text")).c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, STR("Replace with some text"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(text.begin() + 2, text.begin() + 4, TextL(STR("Replace with some text")).c_str());
text.replace(text.begin() + 2, text.begin() + 4, STR("Replace with some text"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2332,9 +2332,9 @@ namespace
CompareText compare_text(short_text.c_str());
Text text(short_text.c_str());
compare_text.replace(2, 4, CompareText(STR("Replace")).c_str(), 5);
compare_text.replace(2, 4, STR("Replace"), 5);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, 4, TextL(STR("Replace")).c_str(), 5);
text.replace(2, 4, STR("Replace"), 5);
bool is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2346,9 +2346,9 @@ namespace
compare_text.assign(short_text.c_str());
text.assign(short_text.c_str());
compare_text.replace(2, CompareText::npos, CompareText(STR("Replace")).c_str(), 5);
compare_text.replace(2, CompareText::npos, STR("Replace"), 5);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, Text::npos, TextL(STR("Replace")).c_str(), 5);
text.replace(2, Text::npos, STR("Replace"), 5);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2360,9 +2360,9 @@ namespace
compare_text.assign(short_text.c_str());
text.assign(short_text.c_str());
compare_text.replace(2, 4, CompareText(STR("Replace with some text")).c_str(), 15);
compare_text.replace(2, 4, STR("Replace with some text"), 15);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, 4, TextL(STR("Replace with some text")).c_str(), 15);
text.replace(2, 4, STR("Replace with some text"), 15);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2374,9 +2374,9 @@ namespace
compare_text.assign(short_text.c_str());
text.assign(short_text.c_str());
compare_text.replace(2, CompareText::npos, CompareText(STR("Replace with some text")).c_str(), 15);
compare_text.replace(2, CompareText::npos, STR("Replace with some text"), 15);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, Text::npos, TextL(STR("Replace with some text")).c_str(), 15);
text.replace(2, Text::npos, STR("Replace with some text"), 15);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2388,9 +2388,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(2, 7, CompareText(STR("Replace")).c_str(), 5);
compare_text.replace(2, 7, STR("Replace"), 5);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, 7, TextL(STR("Replace")).c_str(), 5);
text.replace(2, 7, STR("Replace"), 5);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2402,9 +2402,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(2, CompareText::npos, CompareText(STR("Replace")).c_str(), 5);
compare_text.replace(2, CompareText::npos, STR("Replace"), 5);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, Text::npos, TextL(STR("Replace")).c_str(), 5);
text.replace(2, Text::npos, STR("Replace"), 5);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2416,9 +2416,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(2, 4, CompareText(STR("Replace with some text")).c_str(), 15);
compare_text.replace(2, 4, STR("Replace with some text"), 15);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, 4, TextL(STR("Replace with some text")).c_str(), 15);
text.replace(2, 4, STR("Replace with some text"), 15);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2430,9 +2430,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(2, CompareText::npos, CompareText(STR("Replace with some text")).c_str(), 15);
compare_text.replace(2, CompareText::npos, STR("Replace with some text"), 15);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, Text::npos, TextL(STR("Replace with some text")).c_str(), 15);
text.replace(2, Text::npos, STR("Replace with some text"), 15);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2448,9 +2448,9 @@ namespace
CompareText compare_text(short_text.c_str());
Text text(short_text.c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, CompareText(STR("Replace")).c_str(), 5);
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, STR("Replace"), 5);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(text.begin() + 2, text.begin() + 4, TextL(STR("Replace")).c_str(), 5);
text.replace(text.begin() + 2, text.begin() + 4, STR("Replace"), 5);
bool is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2464,9 +2464,9 @@ namespace
compare_text.assign(short_text.c_str());
text.assign(short_text.c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, CompareText(STR("Replace with some text")).c_str(), 15);
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, STR("Replace with some text"), 15);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(text.begin() + 2, text.begin() + 4, TextL(STR("Replace with some text")).c_str(), 15);
text.replace(text.begin() + 2, text.begin() + 4, STR("Replace with some text"), 15);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2480,9 +2480,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 9, CompareText(STR("Replace")).c_str(), 5);
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 9, STR("Replace"), 5);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(text.begin() + 2, text.begin() + 9, TextL(STR("Replace")).c_str(), 5);
text.replace(text.begin() + 2, text.begin() + 9, STR("Replace"), 5);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2496,9 +2496,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, CompareText(STR("Replace with some text")).c_str(), 15);
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, STR("Replace with some text"), 15);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(text.begin() + 2, text.begin() + 4, TextL(STR("Replace with some text")).c_str(), 15);
text.replace(text.begin() + 2, text.begin() + 4, STR("Replace with some text"), 15);
is_equal = Equal(compare_text, text);
CHECK(is_equal);

View File

@ -2411,9 +2411,9 @@ namespace
TextBuffer buffer{0};
Text text(short_text.c_str(), buffer.data(), buffer.size());
compare_text.replace(2, 4, CompareText(STR("Replace")).c_str());
compare_text.replace(2, 4, STR("Replace"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, 4, TextL(STR("Replace")).c_str());
text.replace(2, 4, STR("Replace"));
bool is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2425,9 +2425,9 @@ namespace
compare_text.assign(short_text.c_str());
text.assign(short_text.c_str());
compare_text.replace(2, CompareText::npos, CompareText(STR("Replace")).c_str());
compare_text.replace(2, CompareText::npos, STR("Replace"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, Text::npos, TextL(STR("Replace")).c_str());
text.replace(2, Text::npos, STR("Replace"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2439,9 +2439,9 @@ namespace
compare_text.assign(short_text.c_str());
text.assign(short_text.c_str());
compare_text.replace(2, 4, CompareText(STR("Replace with some text")).c_str());
compare_text.replace(2, 4, STR("Replace with some text"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, 4, TextL(STR("Replace with some text")).c_str());
text.replace(2, 4, STR("Replace with some text"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2453,9 +2453,9 @@ namespace
compare_text.assign(short_text.c_str());
text.assign(short_text.c_str());
compare_text.replace(2, CompareText::npos, CompareText(STR("Replace with some text")).c_str());
compare_text.replace(2, CompareText::npos, STR("Replace with some text"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, Text::npos, TextL(STR("Replace with some text")).c_str());
text.replace(2, Text::npos, STR("Replace with some text"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2467,9 +2467,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(2, 7, CompareText(STR("Replace")).c_str());
compare_text.replace(2, 7, STR("Replace"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, 7, TextL(STR("Replace")).c_str());
text.replace(2, 7, STR("Replace"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2481,9 +2481,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(2, CompareText::npos, CompareText(STR("Replace")).c_str());
compare_text.replace(2, CompareText::npos, STR("Replace"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, Text::npos, TextL(STR("Replace")).c_str());
text.replace(2, Text::npos, STR("Replace"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2495,9 +2495,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(2, 4, CompareText(STR("Replace with some text")).c_str());
compare_text.replace(2, 4, STR("Replace with some text"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, 4, TextL(STR("Replace with some text")).c_str());
text.replace(2, 4, STR("Replace with some text"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2509,9 +2509,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(2, CompareText::npos, CompareText(STR("Replace with some text")).c_str());
compare_text.replace(2, CompareText::npos, STR("Replace with some text"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, Text::npos, TextL(STR("Replace with some text")).c_str());
text.replace(2, Text::npos, STR("Replace with some text"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2529,9 +2529,9 @@ namespace
TextBuffer buffer{0};
Text text(short_text.c_str(), buffer.data(), buffer.size());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, CompareText(STR("Replace")).c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, STR("Replace"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(text.begin() + 2, text.begin() + 4, TextL(STR("Replace")).c_str());
text.replace(text.begin() + 2, text.begin() + 4, STR("Replace"));
bool is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2543,9 +2543,9 @@ namespace
compare_text.assign(short_text.c_str());
text.assign(short_text.c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, CompareText(STR("Replace with some text")).c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, STR("Replace with some text"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(text.begin() + 2, text.begin() + 4, TextL(STR("Replace with some text")).c_str());
text.replace(text.begin() + 2, text.begin() + 4, STR("Replace with some text"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2557,9 +2557,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 9, CompareText(STR("Replace")).c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 9, STR("Replace"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(text.begin() + 2, text.begin() + 9, TextL(STR("Replace")).c_str());
text.replace(text.begin() + 2, text.begin() + 9, STR("Replace"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2571,9 +2571,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, CompareText(STR("Replace with some text")).c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, STR("Replace with some text"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(text.begin() + 2, text.begin() + 4, TextL(STR("Replace with some text")).c_str());
text.replace(text.begin() + 2, text.begin() + 4, STR("Replace with some text"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2591,9 +2591,9 @@ namespace
TextBuffer buffer{0};
Text text(short_text.c_str(), buffer.data(), buffer.size());
compare_text.replace(2, 4, CompareText(STR("Replace")).c_str(), 5);
compare_text.replace(2, 4, STR("Replace"), 5);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, 4, TextL(STR("Replace")).c_str(), 5);
text.replace(2, 4, STR("Replace"), 5);
bool is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2605,9 +2605,9 @@ namespace
compare_text.assign(short_text.c_str());
text.assign(short_text.c_str());
compare_text.replace(2, CompareText::npos, CompareText(STR("Replace")).c_str(), 5);
compare_text.replace(2, CompareText::npos, STR("Replace"), 5);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, Text::npos, TextL(STR("Replace")).c_str(), 5);
text.replace(2, Text::npos, STR("Replace"), 5);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2619,9 +2619,9 @@ namespace
compare_text.assign(short_text.c_str());
text.assign(short_text.c_str());
compare_text.replace(2, 4, CompareText(STR("Replace with some text")).c_str(), 15);
compare_text.replace(2, 4, STR("Replace with some text"), 15);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, 4, TextL(STR("Replace with some text")).c_str(), 15);
text.replace(2, 4, STR("Replace with some text"), 15);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2633,9 +2633,9 @@ namespace
compare_text.assign(short_text.c_str());
text.assign(short_text.c_str());
compare_text.replace(2, CompareText::npos, CompareText(STR("Replace with some text")).c_str(), 15);
compare_text.replace(2, CompareText::npos, STR("Replace with some text"), 15);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, Text::npos, TextL(STR("Replace with some text")).c_str(), 15);
text.replace(2, Text::npos, STR("Replace with some text"), 15);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2647,9 +2647,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(2, 7, CompareText(STR("Replace")).c_str(), 5);
compare_text.replace(2, 7, STR("Replace"), 5);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, 7, TextL(STR("Replace")).c_str(), 5);
text.replace(2, 7, STR("Replace"), 5);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2661,9 +2661,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(2, CompareText::npos, CompareText(STR("Replace")).c_str(), 5);
compare_text.replace(2, CompareText::npos, STR("Replace"), 5);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, Text::npos, TextL(STR("Replace")).c_str(), 5);
text.replace(2, Text::npos, STR("Replace"), 5);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2675,9 +2675,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(2, 4, CompareText(STR("Replace with some text")).c_str(), 15);
compare_text.replace(2, 4, STR("Replace with some text"), 15);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, 4, TextL(STR("Replace with some text")).c_str(), 15);
text.replace(2, 4, STR("Replace with some text"), 15);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2689,9 +2689,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(2, CompareText::npos, CompareText(STR("Replace with some text")).c_str(), 15);
compare_text.replace(2, CompareText::npos, STR("Replace with some text"), 15);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, Text::npos, TextL(STR("Replace with some text")).c_str(), 15);
text.replace(2, Text::npos, STR("Replace with some text"), 15);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2709,9 +2709,9 @@ namespace
TextBuffer buffer{0};
Text text(short_text.c_str(), buffer.data(), buffer.size());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, CompareText(STR("Replace")).c_str(), 5);
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, STR("Replace"), 5);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(text.begin() + 2, text.begin() + 4, TextL(STR("Replace")).c_str(), 5);
text.replace(text.begin() + 2, text.begin() + 4, STR("Replace"), 5);
bool is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2725,9 +2725,9 @@ namespace
compare_text.assign(short_text.c_str());
text.assign(short_text.c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, CompareText(STR("Replace with some text")).c_str(), 15);
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, STR("Replace with some text"), 15);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(text.begin() + 2, text.begin() + 4, TextL(STR("Replace with some text")).c_str(), 15);
text.replace(text.begin() + 2, text.begin() + 4, STR("Replace with some text"), 15);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2741,9 +2741,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 9, CompareText(STR("Replace")).c_str(), 5);
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 9, STR("Replace"), 5);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(text.begin() + 2, text.begin() + 9, TextL(STR("Replace")).c_str(), 5);
text.replace(text.begin() + 2, text.begin() + 9, STR("Replace"), 5);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2757,9 +2757,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, CompareText(STR("Replace with some text")).c_str(), 15);
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, STR("Replace with some text"), 15);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(text.begin() + 2, text.begin() + 4, TextL(STR("Replace with some text")).c_str(), 15);
text.replace(text.begin() + 2, text.begin() + 4, STR("Replace with some text"), 15);
is_equal = Equal(compare_text, text);
CHECK(is_equal);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -31,9 +31,6 @@ SOFTWARE.
#include "etl/string_view.h"
#include "etl/string.h"
#include "etl/wstring.h"
#if ETL_USING_CPP20
#include "etl/u8string.h"
#endif
#include "etl/u16string.h"
#include "etl/u32string.h"
#include "etl/hash.h"
@ -48,16 +45,12 @@ namespace
{
using View = etl::string_view;
using WView = etl::wstring_view;
using U8View = etl::u8string_view;
using U16View = etl::u16string_view;
using U32View = etl::u32string_view;
etl::string<11> etltext = "Hello World";
std::string text = "Hello World";
std::wstring wtext = L"Hello World";
#if ETL_USING_CPP20
std::u8string u8text = u8"Hello World";
#endif
std::u16string u16text = u"Hello World";
std::u32string u32text = U"Hello World";
std::string text_smaller = "Hello Worlc";
@ -66,17 +59,11 @@ namespace
constexpr char cctext[] = { 'H', 'e', 'l', 'l', 'o', ' ', 'W', 'o', 'r', 'l', 'd', '\0' };
constexpr wchar_t cwtext[] = { L'H', L'e', L'l', L'l', L'o', L' ', L'W', L'o', L'r', L'l', L'd', L'\0' };
#if ETL_USING_CPP20
constexpr char8_t cu8text[] = { u8'H', u8'e', u8'l', u8'l', u8'o', u8' ', u8'W', u8'o', u8'r', u8'l', u8'd', u8'\0' };
#endif
constexpr char16_t cu16text[] = { u'H', u'e', u'l', u'l', u'o', u' ', u'W', u'o', u'r', u'l', u'd', u'\0' };
constexpr char32_t cu32text[] = { U'H', U'e', U'l', U'l', U'o', U' ', U'W', U'o', U'r', U'l', U'd', U'\0' };
const char* pctext = cctext;
const wchar_t* pwtext = cwtext;
#if ETL_USING_CPP20
const char8_t* pu8text = cu8text;
#endif
const char16_t* pu16text = cu16text;
const char32_t* pu32text = cu32text;
@ -139,20 +126,6 @@ namespace
CHECK(isEqual);
}
//*************************************************************************
#if ETL_USING_CPP20
TEST(test_constructor_pointer_range_u8char_t)
{
U8View view(pu8text, pu8text + etl::strlen(pu8text));
CHECK(text.size() == view.size());
CHECK(text.size() == view.max_size());
bool isEqual = std::equal(view.begin(), view.end(), text.begin());
CHECK(isEqual);
}
#endif
//*************************************************************************
TEST(test_constructor_pointer_range_u16char_t)
{
@ -230,18 +203,12 @@ namespace
{
auto cview = etl::make_string_view("Hello World");
auto wview = etl::make_string_view(L"Hello World");
#if ETL_USING_CPP20
auto u8view = etl::make_string_view(u8"Hello World");
#endif
auto u16view = etl::make_string_view(u"Hello World");
auto u32view = etl::make_string_view(U"Hello World");
CHECK(std::equal(cview.begin(), cview.end(), text.begin()));
CHECK(std::equal(wview.begin(), wview.end(), wtext.begin()));
CHECK(std::equal(u16view.begin(), u16view.end(), u16text.begin()));
#if ETL_USING_CPP20
CHECK(std::equal(u8view.begin(), u8view.end(), u8text.begin()));
#endif
CHECK(std::equal(u32view.begin(), u32view.end(), u32text.begin()));
}
@ -251,19 +218,13 @@ namespace
{
constexpr auto cview = etl::make_string_view(cctext);
constexpr auto wview = etl::make_string_view(cwtext);
#if ETL_USING_CPP20
constexpr auto u8view = etl::make_string_view(cu8text);
#endif
constexpr auto u16view = etl::make_string_view(cu16text);
constexpr auto u32view = etl::make_string_view(cu32text);
CHECK(std::equal(cview.begin(), cview.end(), text.begin()));
CHECK(std::equal(wview.begin(), wview.end(), wtext.begin()));
#if ETL_USING_CPP20
CHECK(std::equal(u8view.begin(), u8view.end(), u8text.begin()));
#endif
CHECK(std::equal(u16view.begin(), u16view.end(), u16text.begin()));
CHECK(std::equal(u32view.begin(), u32view.end(), u32text.begin()));
CHECK(std::equal(wview.begin(), wview.end(), text.begin()));
CHECK(std::equal(u16view.begin(), u16view.end(), text.begin()));
CHECK(std::equal(u32view.begin(), u32view.end(), text.begin()));
}
#endif

View File

@ -2156,9 +2156,9 @@ namespace
CompareText compare_text(short_text.c_str());
Text text(short_text.c_str());
compare_text.replace(2, 4, CompareText(STR("Replace")).c_str());
compare_text.replace(2, 4, STR("Replace"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, 4, TextL(STR("Replace")).c_str());
text.replace(2, 4, STR("Replace"));
bool is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2170,9 +2170,9 @@ namespace
compare_text.assign(short_text.c_str());
text.assign(short_text.c_str());
compare_text.replace(2, CompareText::npos, CompareText(STR("Replace")).c_str());
compare_text.replace(2, CompareText::npos, STR("Replace"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, Text::npos, TextL(STR("Replace")).c_str());
text.replace(2, Text::npos, STR("Replace"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2184,9 +2184,9 @@ namespace
compare_text.assign(short_text.c_str());
text.assign(short_text.c_str());
compare_text.replace(2, 4, CompareText(STR("Replace with some text")).c_str());
compare_text.replace(2, 4, STR("Replace with some text"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, 4, TextL(STR("Replace with some text")).c_str());
text.replace(2, 4, STR("Replace with some text"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2198,9 +2198,9 @@ namespace
compare_text.assign(short_text.c_str());
text.assign(short_text.c_str());
compare_text.replace(2, CompareText::npos, CompareText(STR("Replace with some text")).c_str());
compare_text.replace(2, CompareText::npos, STR("Replace with some text"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, Text::npos, TextL(STR("Replace with some text")).c_str());
text.replace(2, Text::npos, STR("Replace with some text"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2212,9 +2212,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(2, 7, CompareText(STR("Replace")).c_str());
compare_text.replace(2, 7, STR("Replace"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, 7, TextL(STR("Replace")).c_str());
text.replace(2, 7, STR("Replace"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2226,9 +2226,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(2, CompareText::npos, CompareText(STR("Replace")).c_str());
compare_text.replace(2, CompareText::npos, STR("Replace"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, Text::npos, TextL(STR("Replace")).c_str());
text.replace(2, Text::npos, STR("Replace"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2240,9 +2240,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(2, 4, CompareText(STR("Replace with some text")).c_str());
compare_text.replace(2, 4, STR("Replace with some text"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, 4, TextL(STR("Replace with some text")).c_str());
text.replace(2, 4, STR("Replace with some text"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2254,9 +2254,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(2, CompareText::npos, CompareText(STR("Replace with some text")).c_str());
compare_text.replace(2, CompareText::npos, STR("Replace with some text"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, Text::npos, TextL(STR("Replace with some text")).c_str());
text.replace(2, Text::npos, STR("Replace with some text"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2272,9 +2272,9 @@ namespace
CompareText compare_text(short_text.c_str());
Text text(short_text.c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, CompareText(STR("Replace")).c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, STR("Replace"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(text.begin() + 2, text.begin() + 4, TextL(STR("Replace")).c_str());
text.replace(text.begin() + 2, text.begin() + 4, STR("Replace"));
bool is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2286,9 +2286,9 @@ namespace
compare_text.assign(short_text.c_str());
text.assign(short_text.c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, CompareText(STR("Replace with some text")).c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, STR("Replace with some text"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(text.begin() + 2, text.begin() + 4, TextL(STR("Replace with some text")).c_str());
text.replace(text.begin() + 2, text.begin() + 4, STR("Replace with some text"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2300,9 +2300,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 9, CompareText(STR("Replace")).c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 9, STR("Replace"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(text.begin() + 2, text.begin() + 9, TextL(STR("Replace")).c_str());
text.replace(text.begin() + 2, text.begin() + 9, STR("Replace"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2314,9 +2314,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, CompareText(STR("Replace with some text")).c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, STR("Replace with some text"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(text.begin() + 2, text.begin() + 4, TextL(STR("Replace with some text")).c_str());
text.replace(text.begin() + 2, text.begin() + 4, STR("Replace with some text"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2332,9 +2332,9 @@ namespace
CompareText compare_text(short_text.c_str());
Text text(short_text.c_str());
compare_text.replace(2, 4, CompareText(STR("Replace")).c_str(), 5);
compare_text.replace(2, 4, STR("Replace"), 5);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, 4, TextL(STR("Replace")).c_str(), 5);
text.replace(2, 4, STR("Replace"), 5);
bool is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2346,9 +2346,9 @@ namespace
compare_text.assign(short_text.c_str());
text.assign(short_text.c_str());
compare_text.replace(2, CompareText::npos, CompareText(STR("Replace")).c_str(), 5);
compare_text.replace(2, CompareText::npos, STR("Replace"), 5);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, Text::npos, TextL(STR("Replace")).c_str(), 5);
text.replace(2, Text::npos, STR("Replace"), 5);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2360,9 +2360,9 @@ namespace
compare_text.assign(short_text.c_str());
text.assign(short_text.c_str());
compare_text.replace(2, 4, CompareText(STR("Replace with some text")).c_str(), 15);
compare_text.replace(2, 4, STR("Replace with some text"), 15);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, 4, TextL(STR("Replace with some text")).c_str(), 15);
text.replace(2, 4, STR("Replace with some text"), 15);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2374,9 +2374,9 @@ namespace
compare_text.assign(short_text.c_str());
text.assign(short_text.c_str());
compare_text.replace(2, CompareText::npos, CompareText(STR("Replace with some text")).c_str(), 15);
compare_text.replace(2, CompareText::npos, STR("Replace with some text"), 15);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, Text::npos, TextL(STR("Replace with some text")).c_str(), 15);
text.replace(2, Text::npos, STR("Replace with some text"), 15);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2388,9 +2388,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(2, 7, CompareText(STR("Replace")).c_str(), 5);
compare_text.replace(2, 7, STR("Replace"), 5);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, 7, TextL(STR("Replace")).c_str(), 5);
text.replace(2, 7, STR("Replace"), 5);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2402,9 +2402,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(2, CompareText::npos, CompareText(STR("Replace")).c_str(), 5);
compare_text.replace(2, CompareText::npos, STR("Replace"), 5);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, Text::npos, TextL(STR("Replace")).c_str(), 5);
text.replace(2, Text::npos, STR("Replace"), 5);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2416,9 +2416,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(2, 4, CompareText(STR("Replace with some text")).c_str(), 15);
compare_text.replace(2, 4, STR("Replace with some text"), 15);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, 4, TextL(STR("Replace with some text")).c_str(), 15);
text.replace(2, 4, STR("Replace with some text"), 15);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2430,9 +2430,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(2, CompareText::npos, CompareText(STR("Replace with some text")).c_str(), 15);
compare_text.replace(2, CompareText::npos, STR("Replace with some text"), 15);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, Text::npos, TextL(STR("Replace with some text")).c_str(), 15);
text.replace(2, Text::npos, STR("Replace with some text"), 15);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2448,9 +2448,9 @@ namespace
CompareText compare_text(short_text.c_str());
Text text(short_text.c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, CompareText(STR("Replace")).c_str(), 5);
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, STR("Replace"), 5);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(text.begin() + 2, text.begin() + 4, TextL(STR("Replace")).c_str(), 5);
text.replace(text.begin() + 2, text.begin() + 4, STR("Replace"), 5);
bool is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2464,9 +2464,9 @@ namespace
compare_text.assign(short_text.c_str());
text.assign(short_text.c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, CompareText(STR("Replace with some text")).c_str(), 15);
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, STR("Replace with some text"), 15);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(text.begin() + 2, text.begin() + 4, TextL(STR("Replace with some text")).c_str(), 15);
text.replace(text.begin() + 2, text.begin() + 4, STR("Replace with some text"), 15);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2480,9 +2480,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 9, CompareText(STR("Replace")).c_str(), 5);
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 9, STR("Replace"), 5);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(text.begin() + 2, text.begin() + 9, TextL(STR("Replace")).c_str(), 5);
text.replace(text.begin() + 2, text.begin() + 9, STR("Replace"), 5);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2496,9 +2496,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, CompareText(STR("Replace with some text")).c_str(), 15);
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, STR("Replace with some text"), 15);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(text.begin() + 2, text.begin() + 4, TextL(STR("Replace with some text")).c_str(), 15);
text.replace(text.begin() + 2, text.begin() + 4, STR("Replace with some text"), 15);
is_equal = Equal(compare_text, text);
CHECK(is_equal);

View File

@ -69,11 +69,11 @@ namespace
static constexpr size_t SIZE_L = 52;
static constexpr size_t SIZE_S = 4;
using Text = etl::wstring_ext;
using IText = etl::iwstring;
using TextL = etl::wstring<SIZE_L>;
using Text = etl::wstring_ext;
using IText = etl::iwstring;
using TextL = etl::wstring<SIZE_L>;
using CompareText = std::wstring;
using value_t = Text::value_type;
using value_t = Text::value_type;
using TextBuffer = std::array<IText::value_type, SIZE + 1>;
using TextBufferL = std::array<IText::value_type, SIZE_L + 1>;
@ -2411,9 +2411,9 @@ namespace
TextBuffer buffer{0};
Text text(short_text.c_str(), buffer.data(), buffer.size());
compare_text.replace(2, 4, CompareText(STR("Replace")).c_str());
compare_text.replace(2, 4, STR("Replace"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, 4, TextL(STR("Replace")).c_str());
text.replace(2, 4, STR("Replace"));
bool is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2425,9 +2425,9 @@ namespace
compare_text.assign(short_text.c_str());
text.assign(short_text.c_str());
compare_text.replace(2, CompareText::npos, CompareText(STR("Replace")).c_str());
compare_text.replace(2, CompareText::npos, STR("Replace"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, Text::npos, TextL(STR("Replace")).c_str());
text.replace(2, Text::npos, STR("Replace"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2439,9 +2439,9 @@ namespace
compare_text.assign(short_text.c_str());
text.assign(short_text.c_str());
compare_text.replace(2, 4, CompareText(STR("Replace with some text")).c_str());
compare_text.replace(2, 4, STR("Replace with some text"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, 4, TextL(STR("Replace with some text")).c_str());
text.replace(2, 4, STR("Replace with some text"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2453,9 +2453,9 @@ namespace
compare_text.assign(short_text.c_str());
text.assign(short_text.c_str());
compare_text.replace(2, CompareText::npos, CompareText(STR("Replace with some text")).c_str());
compare_text.replace(2, CompareText::npos, STR("Replace with some text"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, Text::npos, TextL(STR("Replace with some text")).c_str());
text.replace(2, Text::npos, STR("Replace with some text"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2467,9 +2467,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(2, 7, CompareText(STR("Replace")).c_str());
compare_text.replace(2, 7, STR("Replace"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, 7, TextL(STR("Replace")).c_str());
text.replace(2, 7, STR("Replace"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2481,9 +2481,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(2, CompareText::npos, CompareText(STR("Replace")).c_str());
compare_text.replace(2, CompareText::npos, STR("Replace"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, Text::npos, TextL(STR("Replace")).c_str());
text.replace(2, Text::npos, STR("Replace"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2495,9 +2495,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(2, 4, CompareText(STR("Replace with some text")).c_str());
compare_text.replace(2, 4, STR("Replace with some text"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, 4, TextL(STR("Replace with some text")).c_str());
text.replace(2, 4, STR("Replace with some text"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2509,9 +2509,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(2, CompareText::npos, CompareText(STR("Replace with some text")).c_str());
compare_text.replace(2, CompareText::npos, STR("Replace with some text"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, Text::npos, TextL(STR("Replace with some text")).c_str());
text.replace(2, Text::npos, STR("Replace with some text"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2529,9 +2529,9 @@ namespace
TextBuffer buffer{0};
Text text(short_text.c_str(), buffer.data(), buffer.size());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, CompareText(STR("Replace")).c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, STR("Replace"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(text.begin() + 2, text.begin() + 4, TextL(STR("Replace")).c_str());
text.replace(text.begin() + 2, text.begin() + 4, STR("Replace"));
bool is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2545,7 +2545,7 @@ namespace
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, CompareText(STR("Replace with some text")).c_str());
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(text.begin() + 2, text.begin() + 4, TextL(STR("Replace with some text")).c_str());
text.replace(text.begin() + 2, text.begin() + 4, STR("Replace with some text"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2557,9 +2557,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 9, CompareText(STR("Replace")).c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 9, STR("Replace"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(text.begin() + 2, text.begin() + 9, TextL(STR("Replace")).c_str());
text.replace(text.begin() + 2, text.begin() + 9, STR("Replace"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2571,9 +2571,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, CompareText(STR("Replace with some text")).c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, STR("Replace with some text"));
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(text.begin() + 2, text.begin() + 4, TextL(STR("Replace with some text")).c_str());
text.replace(text.begin() + 2, text.begin() + 4, STR("Replace with some text"));
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2591,9 +2591,9 @@ namespace
TextBuffer buffer{0};
Text text(short_text.c_str(), buffer.data(), buffer.size());
compare_text.replace(2, 4, CompareText(STR("Replace")).c_str(), 5);
compare_text.replace(2, 4, STR("Replace"), 5);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, 4, TextL(STR("Replace")).c_str(), 5);
text.replace(2, 4, STR("Replace"), 5);
bool is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2605,9 +2605,9 @@ namespace
compare_text.assign(short_text.c_str());
text.assign(short_text.c_str());
compare_text.replace(2, CompareText::npos, CompareText(STR("Replace")).c_str(), 5);
compare_text.replace(2, CompareText::npos, STR("Replace"), 5);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, Text::npos, TextL(STR("Replace")).c_str(), 5);
text.replace(2, Text::npos, STR("Replace"), 5);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2619,9 +2619,9 @@ namespace
compare_text.assign(short_text.c_str());
text.assign(short_text.c_str());
compare_text.replace(2, 4, CompareText(STR("Replace with some text")).c_str(), 15);
compare_text.replace(2, 4, STR("Replace with some text"), 15);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, 4, TextL(STR("Replace with some text")).c_str(), 15);
text.replace(2, 4, STR("Replace with some text"), 15);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2633,9 +2633,9 @@ namespace
compare_text.assign(short_text.c_str());
text.assign(short_text.c_str());
compare_text.replace(2, CompareText::npos, CompareText(STR("Replace with some text")).c_str(), 15);
compare_text.replace(2, CompareText::npos, STR("Replace with some text"), 15);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, Text::npos, TextL(STR("Replace with some text")).c_str(), 15);
text.replace(2, Text::npos, STR("Replace with some text"), 15);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2647,9 +2647,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(2, 7, CompareText(STR("Replace")).c_str(), 5);
compare_text.replace(2, 7, STR("Replace"), 5);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, 7, TextL(STR("Replace")).c_str(), 5);
text.replace(2, 7, STR("Replace"), 5);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2661,9 +2661,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(2, CompareText::npos, CompareText(STR("Replace")).c_str(), 5);
compare_text.replace(2, CompareText::npos, STR("Replace"), 5);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, Text::npos, TextL(STR("Replace")).c_str(), 5);
text.replace(2, Text::npos, STR("Replace"), 5);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2675,9 +2675,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(2, 4, CompareText(STR("Replace with some text")).c_str(), 15);
compare_text.replace(2, 4, STR("Replace with some text"), 15);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, 4, TextL(STR("Replace with some text")).c_str(), 15);
text.replace(2, 4, STR("Replace with some text"), 15);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2689,9 +2689,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(2, CompareText::npos, CompareText(STR("Replace with some text")).c_str(), 15);
compare_text.replace(2, CompareText::npos, STR("Replace with some text"), 15);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(2, Text::npos, TextL(STR("Replace with some text")).c_str(), 15);
text.replace(2, Text::npos, STR("Replace with some text"), 15);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2709,9 +2709,9 @@ namespace
TextBuffer buffer{0};
Text text(short_text.c_str(), buffer.data(), buffer.size());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, CompareText(STR("Replace")).c_str(), 5);
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, STR("Replace"), 5);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(text.begin() + 2, text.begin() + 4, TextL(STR("Replace")).c_str(), 5);
text.replace(text.begin() + 2, text.begin() + 4, STR("Replace"), 5);
bool is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2725,9 +2725,9 @@ namespace
compare_text.assign(short_text.c_str());
text.assign(short_text.c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, CompareText(STR("Replace with some text")).c_str(), 15);
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, STR("Replace with some text"), 15);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(text.begin() + 2, text.begin() + 4, TextL(STR("Replace with some text")).c_str(), 15);
text.replace(text.begin() + 2, text.begin() + 4, STR("Replace with some text"), 15);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2741,9 +2741,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 9, CompareText(STR("Replace")).c_str(), 5);
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 9, STR("Replace"), 5);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(text.begin() + 2, text.begin() + 9, TextL(STR("Replace")).c_str(), 5);
text.replace(text.begin() + 2, text.begin() + 9, STR("Replace"), 5);
is_equal = Equal(compare_text, text);
CHECK(is_equal);
@ -2757,9 +2757,9 @@ namespace
compare_text.assign(initial_text.c_str());
text.assign(initial_text.c_str());
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, CompareText(STR("Replace with some text")).c_str(), 15);
compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, STR("Replace with some text"), 15);
compare_text.resize(std::min(compare_text.size(), SIZE));
text.replace(text.begin() + 2, text.begin() + 4, TextL(STR("Replace with some text")).c_str(), 15);
text.replace(text.begin() + 2, text.begin() + 4, STR("Replace with some text"), 15);
is_equal = Equal(compare_text, text);
CHECK(is_equal);

View File

@ -146,13 +146,13 @@ namespace
const Text value6(STR("10101100"));
const Text value7(STR("-01010100"));
CHECK_EQUAL(int(0), int(etl::to_arithmetic<int8_t>(value1.c_str(), value1.size(), etl::bin).value()));
CHECK_EQUAL(int(1), int(etl::to_arithmetic<int8_t>(value2.c_str(), value2.size(), etl::bin).value()));
CHECK_EQUAL(int(5), int(etl::to_arithmetic<int8_t>(value3.c_str(), value3.size(), etl::bin).value()));
CHECK_EQUAL(int(10), int(etl::to_arithmetic<int8_t>(value4.c_str(), value4.size(), etl::bin).value()));
CHECK_EQUAL(int(83), int(etl::to_arithmetic<int8_t>(value5.c_str(), value5.size(), etl::bin).value()));
CHECK_EQUAL(int(-84), int(etl::to_arithmetic<int8_t>(value6.c_str(), value6.size(), etl::bin).value()));
CHECK_EQUAL(int(-84), int(etl::to_arithmetic<int8_t>(value7.c_str(), value7.size(), etl::bin).value()));
CHECK_EQUAL(0, int(etl::to_arithmetic<int8_t>(value1.c_str(), value1.size(), etl::bin).value()));
CHECK_EQUAL(1, int(etl::to_arithmetic<int8_t>(value2.c_str(), value2.size(), etl::bin).value()));
CHECK_EQUAL(5, int(etl::to_arithmetic<int8_t>(value3.c_str(), value3.size(), etl::bin).value()));
CHECK_EQUAL(10, int(etl::to_arithmetic<int8_t>(value4.c_str(), value4.size(), etl::bin).value()));
CHECK_EQUAL(83, int(etl::to_arithmetic<int8_t>(value5.c_str(), value5.size(), etl::bin).value()));
CHECK_EQUAL(-84, int(etl::to_arithmetic<int8_t>(value6.c_str(), value6.size(), etl::bin).value()));
CHECK_EQUAL(-84, int(etl::to_arithmetic<int8_t>(value7.c_str(), value7.size(), etl::bin).value()));
CHECK(etl::to_arithmetic<int8_t>(value1.c_str(), value1.size(), etl::bin).has_value());
CHECK(etl::to_arithmetic<int8_t>(value2.c_str(), value2.size(), etl::bin).has_value());
@ -313,13 +313,13 @@ namespace
const Text value6(STR("0254"));
const Text value7(STR("-0124"));
CHECK_EQUAL(int(0), int(etl::to_arithmetic<int8_t>(value1.c_str(), value1.size(), etl::oct).value()));
CHECK_EQUAL(int(1), int(etl::to_arithmetic<int8_t>(value2.c_str(), value2.size(), etl::oct).value()));
CHECK_EQUAL(int(5), int(etl::to_arithmetic<int8_t>(value3.c_str(), value3.size(), etl::oct).value()));
CHECK_EQUAL(int(10), int(etl::to_arithmetic<int8_t>(value4.c_str(), value4.size(), etl::oct).value()));
CHECK_EQUAL(int(83), int(etl::to_arithmetic<int8_t>(value5.c_str(), value5.size(), etl::oct).value()));
CHECK_EQUAL(int(-84), int(etl::to_arithmetic<int8_t>(value6.c_str(), value6.size(), etl::oct).value()));
CHECK_EQUAL(int(-84), int(etl::to_arithmetic<int8_t>(value7.c_str(), value7.size(), etl::oct).value()));
CHECK_EQUAL(0, int(etl::to_arithmetic<int8_t>(value1.c_str(), value1.size(), etl::oct).value()));
CHECK_EQUAL(1, int(etl::to_arithmetic<int8_t>(value2.c_str(), value2.size(), etl::oct).value()));
CHECK_EQUAL(5, int(etl::to_arithmetic<int8_t>(value3.c_str(), value3.size(), etl::oct).value()));
CHECK_EQUAL(10, int(etl::to_arithmetic<int8_t>(value4.c_str(), value4.size(), etl::oct).value()));
CHECK_EQUAL(83, int(etl::to_arithmetic<int8_t>(value5.c_str(), value5.size(), etl::oct).value()));
CHECK_EQUAL(-84, int(etl::to_arithmetic<int8_t>(value6.c_str(), value6.size(), etl::oct).value()));
CHECK_EQUAL(-84, int(etl::to_arithmetic<int8_t>(value7.c_str(), value7.size(), etl::oct).value()));
}
//*************************************************************************
@ -462,13 +462,13 @@ namespace
const Text text5(STR("83"));
const Text text6(STR("-84"));
CHECK_EQUAL(int(0), int(etl::to_arithmetic<int8_t>(text1.c_str(), text1.size(), etl::dec).value()));
CHECK_EQUAL(int(1), int(etl::to_arithmetic<int8_t>(text2.c_str(), text2.size(), etl::dec).value()));
CHECK_EQUAL(int(5), int(etl::to_arithmetic<int8_t>(text3.c_str(), text3.size(), etl::dec).value()));
CHECK_EQUAL(int(10), int(etl::to_arithmetic<int8_t>(text4.c_str(), text4.size(), etl::dec).value()));
CHECK_EQUAL(int(83), int(etl::to_arithmetic<int8_t>(text5.c_str(), text5.size(), etl::dec).value()));
CHECK_EQUAL(int(83), int(etl::to_arithmetic<uint8_t>(text5.c_str(), text5.size(), etl::dec).value()));
CHECK_EQUAL(int(-84), int(etl::to_arithmetic<int8_t>(text6.c_str(), text6.size(), etl::dec).value()));
CHECK_EQUAL(0, int(etl::to_arithmetic<int8_t>(text1.c_str(), text1.size(), etl::dec).value()));
CHECK_EQUAL(1, int(etl::to_arithmetic<int8_t>(text2.c_str(), text2.size(), etl::dec).value()));
CHECK_EQUAL(5, int(etl::to_arithmetic<int8_t>(text3.c_str(), text3.size(), etl::dec).value()));
CHECK_EQUAL(10, int(etl::to_arithmetic<int8_t>(text4.c_str(), text4.size(), etl::dec).value()));
CHECK_EQUAL(83, int(etl::to_arithmetic<int8_t>(text5.c_str(), text5.size(), etl::dec).value()));
CHECK_EQUAL(83, int(etl::to_arithmetic<uint8_t>(text5.c_str(), text5.size(), etl::dec).value()));
CHECK_EQUAL(-84, int(etl::to_arithmetic<int8_t>(text6.c_str(), text6.size(), etl::dec).value()));
}
//*************************************************************************
@ -598,13 +598,13 @@ namespace
const Text text6(STR("Ac"));
const Text text7(STR("-54"));
CHECK_EQUAL(int(0), int(etl::to_arithmetic<int8_t>(text1.c_str(), text1.size(), etl::hex).value()));
CHECK_EQUAL(int(1), int(etl::to_arithmetic<int8_t>(text2.c_str(), text2.size(), etl::hex).value()));
CHECK_EQUAL(int(5), int(etl::to_arithmetic<int8_t>(text3.c_str(), text3.size(), etl::hex).value()));
CHECK_EQUAL(int(10), int(etl::to_arithmetic<int8_t>(text4.c_str(), text4.size(), etl::hex).value()));
CHECK_EQUAL(int(83), int(etl::to_arithmetic<int8_t>(text5.c_str(), text5.size(), etl::hex).value()));
CHECK_EQUAL(int(-84), int(etl::to_arithmetic<int8_t>(text6.c_str(), text6.size(), etl::hex).value()));
CHECK_EQUAL(int(-84), int(etl::to_arithmetic<int8_t>(text7.c_str(), text7.size(), etl::hex).value()));
CHECK_EQUAL(0, int(etl::to_arithmetic<int8_t>(text1.c_str(), text1.size(), etl::hex).value()));
CHECK_EQUAL(1, int(etl::to_arithmetic<int8_t>(text2.c_str(), text2.size(), etl::hex).value()));
CHECK_EQUAL(5, int(etl::to_arithmetic<int8_t>(text3.c_str(), text3.size(), etl::hex).value()));
CHECK_EQUAL(10, int(etl::to_arithmetic<int8_t>(text4.c_str(), text4.size(), etl::hex).value()));
CHECK_EQUAL(83, int(etl::to_arithmetic<int8_t>(text5.c_str(), text5.size(), etl::hex).value()));
CHECK_EQUAL(-84, int(etl::to_arithmetic<int8_t>(text6.c_str(), text6.size(), etl::hex).value()));
CHECK_EQUAL(-84, int(etl::to_arithmetic<int8_t>(text7.c_str(), text7.size(), etl::hex).value()));
}
//*************************************************************************
@ -1013,19 +1013,19 @@ namespace
using ETLText = etl::string<2>;
// Default radix
CHECK_EQUAL(int(83), int(etl::to_arithmetic<int8_t>(etl::string_view(text.c_str(), text.size())).value()));
CHECK_EQUAL(int(83), int(etl::to_arithmetic<int8_t>(text.c_str(), text.size()).value()));
CHECK_EQUAL(int(83), int(etl::to_arithmetic<int8_t>(ETLText(text.c_str(), text.size())).value()));
CHECK_EQUAL(83, int(etl::to_arithmetic<int8_t>(etl::string_view(text.c_str(), text.size())).value()));
CHECK_EQUAL(83, int(etl::to_arithmetic<int8_t>(text.c_str(), text.size()).value()));
CHECK_EQUAL(83, int(etl::to_arithmetic<int8_t>(ETLText(text.c_str(), text.size())).value()));
// Format spec radix
CHECK_EQUAL(int(83), int(etl::to_arithmetic<int8_t>(etl::string_view(text.c_str(), text.size()), etl::dec).value()));
CHECK_EQUAL(int(83), int(etl::to_arithmetic<int8_t>(text.c_str(), text.size(), etl::dec).value()));
CHECK_EQUAL(int(83), int(etl::to_arithmetic<int8_t>(ETLText(text.c_str(), text.size()), etl::dec).value()));
CHECK_EQUAL(83, int(etl::to_arithmetic<int8_t>(etl::string_view(text.c_str(), text.size()), etl::dec).value()));
CHECK_EQUAL(83, int(etl::to_arithmetic<int8_t>(text.c_str(), text.size(), etl::dec).value()));
CHECK_EQUAL(83, int(etl::to_arithmetic<int8_t>(ETLText(text.c_str(), text.size()), etl::dec).value()));
// Numeric radix
CHECK_EQUAL(int(83), int(etl::to_arithmetic<int8_t>(etl::string_view(text.c_str(), text.size()), etl::radix::decimal).value()));
CHECK_EQUAL(int(83), int(etl::to_arithmetic<int8_t>(text.c_str(), text.size(), etl::radix::decimal).value()));
CHECK_EQUAL(int(83), int(etl::to_arithmetic<int8_t>(ETLText(text.c_str(), text.size()), etl::radix::decimal).value()));
CHECK_EQUAL(83, int(etl::to_arithmetic<int8_t>(etl::string_view(text.c_str(), text.size()), etl::radix::decimal).value()));
CHECK_EQUAL(83, int(etl::to_arithmetic<int8_t>(text.c_str(), text.size(), etl::radix::decimal).value()));
CHECK_EQUAL(83, int(etl::to_arithmetic<int8_t>(ETLText(text.c_str(), text.size()), etl::radix::decimal).value()));
}
//*************************************************************************

View File

@ -146,13 +146,13 @@ namespace
const Text value6(STR("10101100"));
const Text value7(STR("-01010100"));
CHECK_EQUAL(int(0), int(etl::to_arithmetic<int8_t>(value1.c_str(), value1.size(), etl::bin).value()));
CHECK_EQUAL(int(1), int(etl::to_arithmetic<int8_t>(value2.c_str(), value2.size(), etl::bin).value()));
CHECK_EQUAL(int(5), int(etl::to_arithmetic<int8_t>(value3.c_str(), value3.size(), etl::bin).value()));
CHECK_EQUAL(int(10), int(etl::to_arithmetic<int8_t>(value4.c_str(), value4.size(), etl::bin).value()));
CHECK_EQUAL(int(83), int(etl::to_arithmetic<int8_t>(value5.c_str(), value5.size(), etl::bin).value()));
CHECK_EQUAL(int(-84), int(etl::to_arithmetic<int8_t>(value6.c_str(), value6.size(), etl::bin).value()));
CHECK_EQUAL(int(-84), int(etl::to_arithmetic<int8_t>(value7.c_str(), value7.size(), etl::bin).value()));
CHECK_EQUAL(0, int(etl::to_arithmetic<int8_t>(value1.c_str(), value1.size(), etl::bin).value()));
CHECK_EQUAL(1, int(etl::to_arithmetic<int8_t>(value2.c_str(), value2.size(), etl::bin).value()));
CHECK_EQUAL(5, int(etl::to_arithmetic<int8_t>(value3.c_str(), value3.size(), etl::bin).value()));
CHECK_EQUAL(10, int(etl::to_arithmetic<int8_t>(value4.c_str(), value4.size(), etl::bin).value()));
CHECK_EQUAL(83, int(etl::to_arithmetic<int8_t>(value5.c_str(), value5.size(), etl::bin).value()));
CHECK_EQUAL(-84, int(etl::to_arithmetic<int8_t>(value6.c_str(), value6.size(), etl::bin).value()));
CHECK_EQUAL(-84, int(etl::to_arithmetic<int8_t>(value7.c_str(), value7.size(), etl::bin).value()));
CHECK(etl::to_arithmetic<int8_t>(value1.c_str(), value1.size(), etl::bin).has_value());
CHECK(etl::to_arithmetic<int8_t>(value2.c_str(), value2.size(), etl::bin).has_value());
@ -313,13 +313,13 @@ namespace
const Text value6(STR("0254"));
const Text value7(STR("-0124"));
CHECK_EQUAL(int(0), int(etl::to_arithmetic<int8_t>(value1.c_str(), value1.size(), etl::oct).value()));
CHECK_EQUAL(int(1), int(etl::to_arithmetic<int8_t>(value2.c_str(), value2.size(), etl::oct).value()));
CHECK_EQUAL(int(5), int(etl::to_arithmetic<int8_t>(value3.c_str(), value3.size(), etl::oct).value()));
CHECK_EQUAL(int(10), int(etl::to_arithmetic<int8_t>(value4.c_str(), value4.size(), etl::oct).value()));
CHECK_EQUAL(int(83), int(etl::to_arithmetic<int8_t>(value5.c_str(), value5.size(), etl::oct).value()));
CHECK_EQUAL(int(-84), int(etl::to_arithmetic<int8_t>(value6.c_str(), value6.size(), etl::oct).value()));
CHECK_EQUAL(int(-84), int(etl::to_arithmetic<int8_t>(value7.c_str(), value7.size(), etl::oct).value()));
CHECK_EQUAL(0, int(etl::to_arithmetic<int8_t>(value1.c_str(), value1.size(), etl::oct).value()));
CHECK_EQUAL(1, int(etl::to_arithmetic<int8_t>(value2.c_str(), value2.size(), etl::oct).value()));
CHECK_EQUAL(5, int(etl::to_arithmetic<int8_t>(value3.c_str(), value3.size(), etl::oct).value()));
CHECK_EQUAL(10, int(etl::to_arithmetic<int8_t>(value4.c_str(), value4.size(), etl::oct).value()));
CHECK_EQUAL(83, int(etl::to_arithmetic<int8_t>(value5.c_str(), value5.size(), etl::oct).value()));
CHECK_EQUAL(-84, int(etl::to_arithmetic<int8_t>(value6.c_str(), value6.size(), etl::oct).value()));
CHECK_EQUAL(-84, int(etl::to_arithmetic<int8_t>(value7.c_str(), value7.size(), etl::oct).value()));
}
//*************************************************************************
@ -462,13 +462,13 @@ namespace
const Text text5(STR("83"));
const Text text6(STR("-84"));
CHECK_EQUAL(int(0), int(etl::to_arithmetic<int8_t>(text1.c_str(), text1.size(), etl::dec).value()));
CHECK_EQUAL(int(1), int(etl::to_arithmetic<int8_t>(text2.c_str(), text2.size(), etl::dec).value()));
CHECK_EQUAL(int(5), int(etl::to_arithmetic<int8_t>(text3.c_str(), text3.size(), etl::dec).value()));
CHECK_EQUAL(int(10), int(etl::to_arithmetic<int8_t>(text4.c_str(), text4.size(), etl::dec).value()));
CHECK_EQUAL(int(83), int(etl::to_arithmetic<int8_t>(text5.c_str(), text5.size(), etl::dec).value()));
CHECK_EQUAL(int(83), int(etl::to_arithmetic<uint8_t>(text5.c_str(), text5.size(), etl::dec).value()));
CHECK_EQUAL(int(-84), int(etl::to_arithmetic<int8_t>(text6.c_str(), text6.size(), etl::dec).value()));
CHECK_EQUAL(0, int(etl::to_arithmetic<int8_t>(text1.c_str(), text1.size(), etl::dec).value()));
CHECK_EQUAL(1, int(etl::to_arithmetic<int8_t>(text2.c_str(), text2.size(), etl::dec).value()));
CHECK_EQUAL(5, int(etl::to_arithmetic<int8_t>(text3.c_str(), text3.size(), etl::dec).value()));
CHECK_EQUAL(10, int(etl::to_arithmetic<int8_t>(text4.c_str(), text4.size(), etl::dec).value()));
CHECK_EQUAL(83, int(etl::to_arithmetic<int8_t>(text5.c_str(), text5.size(), etl::dec).value()));
CHECK_EQUAL(83, int(etl::to_arithmetic<uint8_t>(text5.c_str(), text5.size(), etl::dec).value()));
CHECK_EQUAL(-84, int(etl::to_arithmetic<int8_t>(text6.c_str(), text6.size(), etl::dec).value()));
}
//*************************************************************************
@ -598,13 +598,13 @@ namespace
const Text text6(STR("Ac"));
const Text text7(STR("-54"));
CHECK_EQUAL(int(0), int(etl::to_arithmetic<int8_t>(text1.c_str(), text1.size(), etl::hex).value()));
CHECK_EQUAL(int(1), int(etl::to_arithmetic<int8_t>(text2.c_str(), text2.size(), etl::hex).value()));
CHECK_EQUAL(int(5), int(etl::to_arithmetic<int8_t>(text3.c_str(), text3.size(), etl::hex).value()));
CHECK_EQUAL(int(10), int(etl::to_arithmetic<int8_t>(text4.c_str(), text4.size(), etl::hex).value()));
CHECK_EQUAL(int(83), int(etl::to_arithmetic<int8_t>(text5.c_str(), text5.size(), etl::hex).value()));
CHECK_EQUAL(int(-84), int(etl::to_arithmetic<int8_t>(text6.c_str(), text6.size(), etl::hex).value()));
CHECK_EQUAL(int(-84), int(etl::to_arithmetic<int8_t>(text7.c_str(), text7.size(), etl::hex).value()));
CHECK_EQUAL(0, int(etl::to_arithmetic<int8_t>(text1.c_str(), text1.size(), etl::hex).value()));
CHECK_EQUAL(1, int(etl::to_arithmetic<int8_t>(text2.c_str(), text2.size(), etl::hex).value()));
CHECK_EQUAL(5, int(etl::to_arithmetic<int8_t>(text3.c_str(), text3.size(), etl::hex).value()));
CHECK_EQUAL(10, int(etl::to_arithmetic<int8_t>(text4.c_str(), text4.size(), etl::hex).value()));
CHECK_EQUAL(83, int(etl::to_arithmetic<int8_t>(text5.c_str(), text5.size(), etl::hex).value()));
CHECK_EQUAL(-84, int(etl::to_arithmetic<int8_t>(text6.c_str(), text6.size(), etl::hex).value()));
CHECK_EQUAL(-84, int(etl::to_arithmetic<int8_t>(text7.c_str(), text7.size(), etl::hex).value()));
}
//*************************************************************************

View File

@ -146,13 +146,13 @@ namespace
const Text value6(STR("10101100"));
const Text value7(STR("-01010100"));
CHECK_EQUAL(int(0), int(etl::to_arithmetic<int8_t>(value1.c_str(), value1.size(), etl::bin).value()));
CHECK_EQUAL(int(1), int(etl::to_arithmetic<int8_t>(value2.c_str(), value2.size(), etl::bin).value()));
CHECK_EQUAL(int(5), int(etl::to_arithmetic<int8_t>(value3.c_str(), value3.size(), etl::bin).value()));
CHECK_EQUAL(int(10), int(etl::to_arithmetic<int8_t>(value4.c_str(), value4.size(), etl::bin).value()));
CHECK_EQUAL(int(83), int(etl::to_arithmetic<int8_t>(value5.c_str(), value5.size(), etl::bin).value()));
CHECK_EQUAL(int(-84), int(etl::to_arithmetic<int8_t>(value6.c_str(), value6.size(), etl::bin).value()));
CHECK_EQUAL(int(-84), int(etl::to_arithmetic<int8_t>(value7.c_str(), value7.size(), etl::bin).value()));
CHECK_EQUAL(0, int(etl::to_arithmetic<int8_t>(value1.c_str(), value1.size(), etl::bin).value()));
CHECK_EQUAL(1, int(etl::to_arithmetic<int8_t>(value2.c_str(), value2.size(), etl::bin).value()));
CHECK_EQUAL(5, int(etl::to_arithmetic<int8_t>(value3.c_str(), value3.size(), etl::bin).value()));
CHECK_EQUAL(10, int(etl::to_arithmetic<int8_t>(value4.c_str(), value4.size(), etl::bin).value()));
CHECK_EQUAL(83, int(etl::to_arithmetic<int8_t>(value5.c_str(), value5.size(), etl::bin).value()));
CHECK_EQUAL(-84, int(etl::to_arithmetic<int8_t>(value6.c_str(), value6.size(), etl::bin).value()));
CHECK_EQUAL(-84, int(etl::to_arithmetic<int8_t>(value7.c_str(), value7.size(), etl::bin).value()));
CHECK(etl::to_arithmetic<int8_t>(value1.c_str(), value1.size(), etl::bin).has_value());
CHECK(etl::to_arithmetic<int8_t>(value2.c_str(), value2.size(), etl::bin).has_value());
@ -313,13 +313,13 @@ namespace
const Text value6(STR("0254"));
const Text value7(STR("-0124"));
CHECK_EQUAL(int(0), int(etl::to_arithmetic<int8_t>(value1.c_str(), value1.size(), etl::oct).value()));
CHECK_EQUAL(int(1), int(etl::to_arithmetic<int8_t>(value2.c_str(), value2.size(), etl::oct).value()));
CHECK_EQUAL(int(5), int(etl::to_arithmetic<int8_t>(value3.c_str(), value3.size(), etl::oct).value()));
CHECK_EQUAL(int(10), int(etl::to_arithmetic<int8_t>(value4.c_str(), value4.size(), etl::oct).value()));
CHECK_EQUAL(int(83), int(etl::to_arithmetic<int8_t>(value5.c_str(), value5.size(), etl::oct).value()));
CHECK_EQUAL(int(-84), int(etl::to_arithmetic<int8_t>(value6.c_str(), value6.size(), etl::oct).value()));
CHECK_EQUAL(int(-84), int(etl::to_arithmetic<int8_t>(value7.c_str(), value7.size(), etl::oct).value()));
CHECK_EQUAL(0, int(etl::to_arithmetic<int8_t>(value1.c_str(), value1.size(), etl::oct).value()));
CHECK_EQUAL(1, int(etl::to_arithmetic<int8_t>(value2.c_str(), value2.size(), etl::oct).value()));
CHECK_EQUAL(5, int(etl::to_arithmetic<int8_t>(value3.c_str(), value3.size(), etl::oct).value()));
CHECK_EQUAL(10, int(etl::to_arithmetic<int8_t>(value4.c_str(), value4.size(), etl::oct).value()));
CHECK_EQUAL(83, int(etl::to_arithmetic<int8_t>(value5.c_str(), value5.size(), etl::oct).value()));
CHECK_EQUAL(-84, int(etl::to_arithmetic<int8_t>(value6.c_str(), value6.size(), etl::oct).value()));
CHECK_EQUAL(-84, int(etl::to_arithmetic<int8_t>(value7.c_str(), value7.size(), etl::oct).value()));
}
//*************************************************************************
@ -462,13 +462,13 @@ namespace
const Text text5(STR("83"));
const Text text6(STR("-84"));
CHECK_EQUAL(int(0), int(etl::to_arithmetic<int8_t>(text1.c_str(), text1.size(), etl::dec).value()));
CHECK_EQUAL(int(1), int(etl::to_arithmetic<int8_t>(text2.c_str(), text2.size(), etl::dec).value()));
CHECK_EQUAL(int(5), int(etl::to_arithmetic<int8_t>(text3.c_str(), text3.size(), etl::dec).value()));
CHECK_EQUAL(int(10), int(etl::to_arithmetic<int8_t>(text4.c_str(), text4.size(), etl::dec).value()));
CHECK_EQUAL(int(83), int(etl::to_arithmetic<int8_t>(text5.c_str(), text5.size(), etl::dec).value()));
CHECK_EQUAL(int(83), int(etl::to_arithmetic<uint8_t>(text5.c_str(), text5.size(), etl::dec).value()));
CHECK_EQUAL(int(-84), int(etl::to_arithmetic<int8_t>(text6.c_str(), text6.size(), etl::dec).value()));
CHECK_EQUAL(0, int(etl::to_arithmetic<int8_t>(text1.c_str(), text1.size(), etl::dec).value()));
CHECK_EQUAL(1, int(etl::to_arithmetic<int8_t>(text2.c_str(), text2.size(), etl::dec).value()));
CHECK_EQUAL(5, int(etl::to_arithmetic<int8_t>(text3.c_str(), text3.size(), etl::dec).value()));
CHECK_EQUAL(10, int(etl::to_arithmetic<int8_t>(text4.c_str(), text4.size(), etl::dec).value()));
CHECK_EQUAL(83, int(etl::to_arithmetic<int8_t>(text5.c_str(), text5.size(), etl::dec).value()));
CHECK_EQUAL(83, int(etl::to_arithmetic<uint8_t>(text5.c_str(), text5.size(), etl::dec).value()));
CHECK_EQUAL(-84, int(etl::to_arithmetic<int8_t>(text6.c_str(), text6.size(), etl::dec).value()));
}
//*************************************************************************
@ -598,13 +598,13 @@ namespace
const Text text6(STR("Ac"));
const Text text7(STR("-54"));
CHECK_EQUAL(int(0), int(etl::to_arithmetic<int8_t>(text1.c_str(), text1.size(), etl::hex).value()));
CHECK_EQUAL(int(1), int(etl::to_arithmetic<int8_t>(text2.c_str(), text2.size(), etl::hex).value()));
CHECK_EQUAL(int(5), int(etl::to_arithmetic<int8_t>(text3.c_str(), text3.size(), etl::hex).value()));
CHECK_EQUAL(int(10), int(etl::to_arithmetic<int8_t>(text4.c_str(), text4.size(), etl::hex).value()));
CHECK_EQUAL(int(83), int(etl::to_arithmetic<int8_t>(text5.c_str(), text5.size(), etl::hex).value()));
CHECK_EQUAL(int(-84), int(etl::to_arithmetic<int8_t>(text6.c_str(), text6.size(), etl::hex).value()));
CHECK_EQUAL(int(-84), int(etl::to_arithmetic<int8_t>(text7.c_str(), text7.size(), etl::hex).value()));
CHECK_EQUAL(0, int(etl::to_arithmetic<int8_t>(text1.c_str(), text1.size(), etl::hex).value()));
CHECK_EQUAL(1, int(etl::to_arithmetic<int8_t>(text2.c_str(), text2.size(), etl::hex).value()));
CHECK_EQUAL(5, int(etl::to_arithmetic<int8_t>(text3.c_str(), text3.size(), etl::hex).value()));
CHECK_EQUAL(10, int(etl::to_arithmetic<int8_t>(text4.c_str(), text4.size(), etl::hex).value()));
CHECK_EQUAL(83, int(etl::to_arithmetic<int8_t>(text5.c_str(), text5.size(), etl::hex).value()));
CHECK_EQUAL(-84, int(etl::to_arithmetic<int8_t>(text6.c_str(), text6.size(), etl::hex).value()));
CHECK_EQUAL(-84, int(etl::to_arithmetic<int8_t>(text7.c_str(), text7.size(), etl::hex).value()));
}
//*************************************************************************

View File

@ -26,9 +26,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
******************************************************************************/
#include "etl/platform.h"
#if ETL_USING_CPP20
#include "unit_test_framework.h"
#include <ostream>
@ -40,6 +37,8 @@ SOFTWARE.
#include "etl/u8string.h"
#include "etl/format_spec.h"
#if ETL_USING_CPP20
#undef STR
#define STR(x) u8##x
using Text = std::u8string;
@ -149,13 +148,13 @@ namespace
const Text value6(STR("10101100"));
const Text value7(STR("-01010100"));
CHECK_EQUAL(int(0), int(etl::to_arithmetic<int8_t>(value1.c_str(), value1.size(), etl::bin).value()));
CHECK_EQUAL(int(1), int(etl::to_arithmetic<int8_t>(value2.c_str(), value2.size(), etl::bin).value()));
CHECK_EQUAL(int(5), int(etl::to_arithmetic<int8_t>(value3.c_str(), value3.size(), etl::bin).value()));
CHECK_EQUAL(int(10), int(etl::to_arithmetic<int8_t>(value4.c_str(), value4.size(), etl::bin).value()));
CHECK_EQUAL(int(83), int(etl::to_arithmetic<int8_t>(value5.c_str(), value5.size(), etl::bin).value()));
CHECK_EQUAL(int(-84), int(etl::to_arithmetic<int8_t>(value6.c_str(), value6.size(), etl::bin).value()));
CHECK_EQUAL(int(-84), int(etl::to_arithmetic<int8_t>(value7.c_str(), value7.size(), etl::bin).value()));
CHECK_EQUAL(0, int(etl::to_arithmetic<int8_t>(value1.c_str(), value1.size(), etl::bin).value()));
CHECK_EQUAL(1, int(etl::to_arithmetic<int8_t>(value2.c_str(), value2.size(), etl::bin).value()));
CHECK_EQUAL(5, int(etl::to_arithmetic<int8_t>(value3.c_str(), value3.size(), etl::bin).value()));
CHECK_EQUAL(10, int(etl::to_arithmetic<int8_t>(value4.c_str(), value4.size(), etl::bin).value()));
CHECK_EQUAL(83, int(etl::to_arithmetic<int8_t>(value5.c_str(), value5.size(), etl::bin).value()));
CHECK_EQUAL(-84, int(etl::to_arithmetic<int8_t>(value6.c_str(), value6.size(), etl::bin).value()));
CHECK_EQUAL(-84, int(etl::to_arithmetic<int8_t>(value7.c_str(), value7.size(), etl::bin).value()));
CHECK(etl::to_arithmetic<int8_t>(value1.c_str(), value1.size(), etl::bin).has_value());
CHECK(etl::to_arithmetic<int8_t>(value2.c_str(), value2.size(), etl::bin).has_value());
@ -316,13 +315,13 @@ namespace
const Text value6(STR("0254"));
const Text value7(STR("-0124"));
CHECK_EQUAL(int(0), int(etl::to_arithmetic<int8_t>(value1.c_str(), value1.size(), etl::oct).value()));
CHECK_EQUAL(int(1), int(etl::to_arithmetic<int8_t>(value2.c_str(), value2.size(), etl::oct).value()));
CHECK_EQUAL(int(5), int(etl::to_arithmetic<int8_t>(value3.c_str(), value3.size(), etl::oct).value()));
CHECK_EQUAL(int(10), int(etl::to_arithmetic<int8_t>(value4.c_str(), value4.size(), etl::oct).value()));
CHECK_EQUAL(int(83), int(etl::to_arithmetic<int8_t>(value5.c_str(), value5.size(), etl::oct).value()));
CHECK_EQUAL(int(-84), int(etl::to_arithmetic<int8_t>(value6.c_str(), value6.size(), etl::oct).value()));
CHECK_EQUAL(int(-84), int(etl::to_arithmetic<int8_t>(value7.c_str(), value7.size(), etl::oct).value()));
CHECK_EQUAL(0, int(etl::to_arithmetic<int8_t>(value1.c_str(), value1.size(), etl::oct).value()));
CHECK_EQUAL(1, int(etl::to_arithmetic<int8_t>(value2.c_str(), value2.size(), etl::oct).value()));
CHECK_EQUAL(5, int(etl::to_arithmetic<int8_t>(value3.c_str(), value3.size(), etl::oct).value()));
CHECK_EQUAL(10, int(etl::to_arithmetic<int8_t>(value4.c_str(), value4.size(), etl::oct).value()));
CHECK_EQUAL(83, int(etl::to_arithmetic<int8_t>(value5.c_str(), value5.size(), etl::oct).value()));
CHECK_EQUAL(-84, int(etl::to_arithmetic<int8_t>(value6.c_str(), value6.size(), etl::oct).value()));
CHECK_EQUAL(-84, int(etl::to_arithmetic<int8_t>(value7.c_str(), value7.size(), etl::oct).value()));
}
//*************************************************************************
@ -465,13 +464,13 @@ namespace
const Text text5(STR("83"));
const Text text6(STR("-84"));
CHECK_EQUAL(int(0), int(etl::to_arithmetic<int8_t>(text1.c_str(), text1.size(), etl::dec).value()));
CHECK_EQUAL(int(1), int(etl::to_arithmetic<int8_t>(text2.c_str(), text2.size(), etl::dec).value()));
CHECK_EQUAL(int(5), int(etl::to_arithmetic<int8_t>(text3.c_str(), text3.size(), etl::dec).value()));
CHECK_EQUAL(int(10), int(etl::to_arithmetic<int8_t>(text4.c_str(), text4.size(), etl::dec).value()));
CHECK_EQUAL(int(83), int(etl::to_arithmetic<int8_t>(text5.c_str(), text5.size(), etl::dec).value()));
CHECK_EQUAL(int(83), int(etl::to_arithmetic<uint8_t>(text5.c_str(), text5.size(), etl::dec).value()));
CHECK_EQUAL(int(-84), int(etl::to_arithmetic<int8_t>(text6.c_str(), text6.size(), etl::dec).value()));
CHECK_EQUAL(0, int(etl::to_arithmetic<int8_t>(text1.c_str(), text1.size(), etl::dec).value()));
CHECK_EQUAL(1, int(etl::to_arithmetic<int8_t>(text2.c_str(), text2.size(), etl::dec).value()));
CHECK_EQUAL(5, int(etl::to_arithmetic<int8_t>(text3.c_str(), text3.size(), etl::dec).value()));
CHECK_EQUAL(10, int(etl::to_arithmetic<int8_t>(text4.c_str(), text4.size(), etl::dec).value()));
CHECK_EQUAL(83, int(etl::to_arithmetic<int8_t>(text5.c_str(), text5.size(), etl::dec).value()));
CHECK_EQUAL(83, int(etl::to_arithmetic<uint8_t>(text5.c_str(), text5.size(), etl::dec).value()));
CHECK_EQUAL(-84, int(etl::to_arithmetic<int8_t>(text6.c_str(), text6.size(), etl::dec).value()));
}
//*************************************************************************
@ -601,13 +600,13 @@ namespace
const Text text6(STR("Ac"));
const Text text7(STR("-54"));
CHECK_EQUAL(int(0), int(etl::to_arithmetic<int8_t>(text1.c_str(), text1.size(), etl::hex).value()));
CHECK_EQUAL(int(1), int(etl::to_arithmetic<int8_t>(text2.c_str(), text2.size(), etl::hex).value()));
CHECK_EQUAL(int(5), int(etl::to_arithmetic<int8_t>(text3.c_str(), text3.size(), etl::hex).value()));
CHECK_EQUAL(int(10), int(etl::to_arithmetic<int8_t>(text4.c_str(), text4.size(), etl::hex).value()));
CHECK_EQUAL(int(83), int(etl::to_arithmetic<int8_t>(text5.c_str(), text5.size(), etl::hex).value()));
CHECK_EQUAL(int(-84), int(etl::to_arithmetic<int8_t>(text6.c_str(), text6.size(), etl::hex).value()));
CHECK_EQUAL(int(-84), int(etl::to_arithmetic<int8_t>(text7.c_str(), text7.size(), etl::hex).value()));
CHECK_EQUAL(0, int(etl::to_arithmetic<int8_t>(text1.c_str(), text1.size(), etl::hex).value()));
CHECK_EQUAL(1, int(etl::to_arithmetic<int8_t>(text2.c_str(), text2.size(), etl::hex).value()));
CHECK_EQUAL(5, int(etl::to_arithmetic<int8_t>(text3.c_str(), text3.size(), etl::hex).value()));
CHECK_EQUAL(10, int(etl::to_arithmetic<int8_t>(text4.c_str(), text4.size(), etl::hex).value()));
CHECK_EQUAL(83, int(etl::to_arithmetic<int8_t>(text5.c_str(), text5.size(), etl::hex).value()));
CHECK_EQUAL(-84, int(etl::to_arithmetic<int8_t>(text6.c_str(), text6.size(), etl::hex).value()));
CHECK_EQUAL(-84, int(etl::to_arithmetic<int8_t>(text7.c_str(), text7.size(), etl::hex).value()));
}
//*************************************************************************

View File

@ -146,13 +146,13 @@ namespace
const Text value6(STR("10101100"));
const Text value7(STR("-01010100"));
CHECK_EQUAL(int(0), int(etl::to_arithmetic<int8_t>(value1.c_str(), value1.size(), etl::bin).value()));
CHECK_EQUAL(int(1), int(etl::to_arithmetic<int8_t>(value2.c_str(), value2.size(), etl::bin).value()));
CHECK_EQUAL(int(5), int(etl::to_arithmetic<int8_t>(value3.c_str(), value3.size(), etl::bin).value()));
CHECK_EQUAL(int(10), int(etl::to_arithmetic<int8_t>(value4.c_str(), value4.size(), etl::bin).value()));
CHECK_EQUAL(int(83), int(etl::to_arithmetic<int8_t>(value5.c_str(), value5.size(), etl::bin).value()));
CHECK_EQUAL(int(-84), int(etl::to_arithmetic<int8_t>(value6.c_str(), value6.size(), etl::bin).value()));
CHECK_EQUAL(int(-84), int(etl::to_arithmetic<int8_t>(value7.c_str(), value7.size(), etl::bin).value()));
CHECK_EQUAL(0, int(etl::to_arithmetic<int8_t>(value1.c_str(), value1.size(), etl::bin).value()));
CHECK_EQUAL(1, int(etl::to_arithmetic<int8_t>(value2.c_str(), value2.size(), etl::bin).value()));
CHECK_EQUAL(5, int(etl::to_arithmetic<int8_t>(value3.c_str(), value3.size(), etl::bin).value()));
CHECK_EQUAL(10, int(etl::to_arithmetic<int8_t>(value4.c_str(), value4.size(), etl::bin).value()));
CHECK_EQUAL(83, int(etl::to_arithmetic<int8_t>(value5.c_str(), value5.size(), etl::bin).value()));
CHECK_EQUAL(-84, int(etl::to_arithmetic<int8_t>(value6.c_str(), value6.size(), etl::bin).value()));
CHECK_EQUAL(-84, int(etl::to_arithmetic<int8_t>(value7.c_str(), value7.size(), etl::bin).value()));
CHECK(etl::to_arithmetic<int8_t>(value1.c_str(), value1.size(), etl::bin).has_value());
CHECK(etl::to_arithmetic<int8_t>(value2.c_str(), value2.size(), etl::bin).has_value());
@ -313,13 +313,13 @@ namespace
const Text value6(STR("0254"));
const Text value7(STR("-0124"));
CHECK_EQUAL(int(0), int(etl::to_arithmetic<int8_t>(value1.c_str(), value1.size(), etl::oct).value()));
CHECK_EQUAL(int(1), int(etl::to_arithmetic<int8_t>(value2.c_str(), value2.size(), etl::oct).value()));
CHECK_EQUAL(int(5), int(etl::to_arithmetic<int8_t>(value3.c_str(), value3.size(), etl::oct).value()));
CHECK_EQUAL(int(10), int(etl::to_arithmetic<int8_t>(value4.c_str(), value4.size(), etl::oct).value()));
CHECK_EQUAL(int(83), int(etl::to_arithmetic<int8_t>(value5.c_str(), value5.size(), etl::oct).value()));
CHECK_EQUAL(int(-84), int(etl::to_arithmetic<int8_t>(value6.c_str(), value6.size(), etl::oct).value()));
CHECK_EQUAL(int(-84), int(etl::to_arithmetic<int8_t>(value7.c_str(), value7.size(), etl::oct).value()));
CHECK_EQUAL(0, int(etl::to_arithmetic<int8_t>(value1.c_str(), value1.size(), etl::oct).value()));
CHECK_EQUAL(1, int(etl::to_arithmetic<int8_t>(value2.c_str(), value2.size(), etl::oct).value()));
CHECK_EQUAL(5, int(etl::to_arithmetic<int8_t>(value3.c_str(), value3.size(), etl::oct).value()));
CHECK_EQUAL(10, int(etl::to_arithmetic<int8_t>(value4.c_str(), value4.size(), etl::oct).value()));
CHECK_EQUAL(83, int(etl::to_arithmetic<int8_t>(value5.c_str(), value5.size(), etl::oct).value()));
CHECK_EQUAL(-84, int(etl::to_arithmetic<int8_t>(value6.c_str(), value6.size(), etl::oct).value()));
CHECK_EQUAL(-84, int(etl::to_arithmetic<int8_t>(value7.c_str(), value7.size(), etl::oct).value()));
}
//*************************************************************************
@ -462,13 +462,13 @@ namespace
const Text text5(STR("83"));
const Text text6(STR("-84"));
CHECK_EQUAL(int(0), int(etl::to_arithmetic<int8_t>(text1.c_str(), text1.size(), etl::dec).value()));
CHECK_EQUAL(int(1), int(etl::to_arithmetic<int8_t>(text2.c_str(), text2.size(), etl::dec).value()));
CHECK_EQUAL(int(5), int(etl::to_arithmetic<int8_t>(text3.c_str(), text3.size(), etl::dec).value()));
CHECK_EQUAL(int(10), int(etl::to_arithmetic<int8_t>(text4.c_str(), text4.size(), etl::dec).value()));
CHECK_EQUAL(int(83), int(etl::to_arithmetic<int8_t>(text5.c_str(), text5.size(), etl::dec).value()));
CHECK_EQUAL(int(83), int(etl::to_arithmetic<uint8_t>(text5.c_str(), text5.size(), etl::dec).value()));
CHECK_EQUAL(int(-84), int(etl::to_arithmetic<int8_t>(text6.c_str(), text6.size(), etl::dec).value()));
CHECK_EQUAL(0, int(etl::to_arithmetic<int8_t>(text1.c_str(), text1.size(), etl::dec).value()));
CHECK_EQUAL(1, int(etl::to_arithmetic<int8_t>(text2.c_str(), text2.size(), etl::dec).value()));
CHECK_EQUAL(5, int(etl::to_arithmetic<int8_t>(text3.c_str(), text3.size(), etl::dec).value()));
CHECK_EQUAL(10, int(etl::to_arithmetic<int8_t>(text4.c_str(), text4.size(), etl::dec).value()));
CHECK_EQUAL(83, int(etl::to_arithmetic<int8_t>(text5.c_str(), text5.size(), etl::dec).value()));
CHECK_EQUAL(83, int(etl::to_arithmetic<uint8_t>(text5.c_str(), text5.size(), etl::dec).value()));
CHECK_EQUAL(-84, int(etl::to_arithmetic<int8_t>(text6.c_str(), text6.size(), etl::dec).value()));
}
//*************************************************************************
@ -598,13 +598,13 @@ namespace
const Text text6(STR("Ac"));
const Text text7(STR("-54"));
CHECK_EQUAL(int(0), int(etl::to_arithmetic<int8_t>(text1.c_str(), text1.size(), etl::hex).value()));
CHECK_EQUAL(int(1), int(etl::to_arithmetic<int8_t>(text2.c_str(), text2.size(), etl::hex).value()));
CHECK_EQUAL(int(5), int(etl::to_arithmetic<int8_t>(text3.c_str(), text3.size(), etl::hex).value()));
CHECK_EQUAL(int(10), int(etl::to_arithmetic<int8_t>(text4.c_str(), text4.size(), etl::hex).value()));
CHECK_EQUAL(int(83), int(etl::to_arithmetic<int8_t>(text5.c_str(), text5.size(), etl::hex).value()));
CHECK_EQUAL(int(-84), int(etl::to_arithmetic<int8_t>(text6.c_str(), text6.size(), etl::hex).value()));
CHECK_EQUAL(int(-84), int(etl::to_arithmetic<int8_t>(text7.c_str(), text7.size(), etl::hex).value()));
CHECK_EQUAL(0, int(etl::to_arithmetic<int8_t>(text1.c_str(), text1.size(), etl::hex).value()));
CHECK_EQUAL(1, int(etl::to_arithmetic<int8_t>(text2.c_str(), text2.size(), etl::hex).value()));
CHECK_EQUAL(5, int(etl::to_arithmetic<int8_t>(text3.c_str(), text3.size(), etl::hex).value()));
CHECK_EQUAL(10, int(etl::to_arithmetic<int8_t>(text4.c_str(), text4.size(), etl::hex).value()));
CHECK_EQUAL(83, int(etl::to_arithmetic<int8_t>(text5.c_str(), text5.size(), etl::hex).value()));
CHECK_EQUAL(-84, int(etl::to_arithmetic<int8_t>(text6.c_str(), text6.size(), etl::hex).value()));
CHECK_EQUAL(-84, int(etl::to_arithmetic<int8_t>(text7.c_str(), text7.size(), etl::hex).value()));
}
//*************************************************************************

View File

@ -69,15 +69,15 @@ namespace
CHECK(etl::string<20>(STR("2147483648")) == etl::to_string(uint32_t(2147483648ul), str));
CHECK(etl::string<20>(STR("9223372036854775808")) == etl::to_string(uint64_t(9223372036854775808ull), str));
CHECK(etl::string<20>(STR("127")) == etl::to_string(int8_t(INT8_MAX), str));
CHECK(etl::string<20>(STR("32767")) == etl::to_string(int16_t(INT16_MAX), str));
CHECK(etl::string<20>(STR("2147483647")) == etl::to_string(int32_t(INT32_MAX), str));
CHECK(etl::string<20>(STR("9223372036854775807")) == etl::to_string(int64_t(INT64_MAX), str));
CHECK(etl::string<20>(STR("127")) == etl::to_string(INT8_MAX, str));
CHECK(etl::string<20>(STR("32767")) == etl::to_string(INT16_MAX, str));
CHECK(etl::string<20>(STR("2147483647")) == etl::to_string(INT32_MAX, str));
CHECK(etl::string<20>(STR("9223372036854775807")) == etl::to_string(INT64_MAX, str));
CHECK(etl::string<20>(STR("-128")) == etl::to_string(int8_t(INT8_MIN), str));
CHECK(etl::string<20>(STR("-32768")) == etl::to_string(int16_t(INT16_MIN), str));
CHECK(etl::string<20>(STR("-2147483648")) == etl::to_string(int32_t(INT32_MIN), str));
CHECK(etl::string<20>(STR("-9223372036854775808")) == etl::to_string(int64_t(INT64_MIN), str));
CHECK(etl::string<20>(STR("-128")) == etl::to_string(INT8_MIN, str));
CHECK(etl::string<20>(STR("-32768")) == etl::to_string(INT16_MIN, str));
CHECK(etl::string<20>(STR("-2147483648")) == etl::to_string(INT32_MIN, str));
CHECK(etl::string<20>(STR("-9223372036854775808")) == etl::to_string(INT64_MIN, str));
}
//*************************************************************************
@ -95,15 +95,15 @@ namespace
CHECK(etl::string<120>(STR("0000128327682147483648")) == etl::to_string(uint32_t(2147483648ul), str, true));
CHECK(etl::string<120>(STR("00001283276821474836489223372036854775808")) == etl::to_string(uint64_t(9223372036854775808ull), str, true));
CHECK(etl::string<120>(STR("00001283276821474836489223372036854775808127")) == etl::to_string(int8_t(INT8_MAX), str, true));
CHECK(etl::string<120>(STR("0000128327682147483648922337203685477580812732767")) == etl::to_string(int16_t(INT16_MAX), str, true));
CHECK(etl::string<120>(STR("00001283276821474836489223372036854775808127327672147483647")) == etl::to_string(int32_t(INT32_MAX), str, true));
CHECK(etl::string<120>(STR("000012832768214748364892233720368547758081273276721474836479223372036854775807")) == etl::to_string(int64_t(INT64_MAX), str, true));
CHECK(etl::string<120>(STR("00001283276821474836489223372036854775808127")) == etl::to_string(INT8_MAX, str, true));
CHECK(etl::string<120>(STR("0000128327682147483648922337203685477580812732767")) == etl::to_string(INT16_MAX, str, true));
CHECK(etl::string<120>(STR("00001283276821474836489223372036854775808127327672147483647")) == etl::to_string(INT32_MAX, str, true));
CHECK(etl::string<120>(STR("000012832768214748364892233720368547758081273276721474836479223372036854775807")) == etl::to_string(INT64_MAX, str, true));
CHECK(etl::string<120>(STR("000012832768214748364892233720368547758081273276721474836479223372036854775807-128")) == etl::to_string(int8_t(INT8_MIN), str, true));
CHECK(etl::string<120>(STR("000012832768214748364892233720368547758081273276721474836479223372036854775807-128-32768")) == etl::to_string(int16_t(INT16_MIN), str, true));
CHECK(etl::string<120>(STR("000012832768214748364892233720368547758081273276721474836479223372036854775807-128-32768-2147483648")) == etl::to_string(int32_t(INT32_MIN), str, true));
CHECK(etl::string<120>(STR("000012832768214748364892233720368547758081273276721474836479223372036854775807-128-32768-2147483648-9223372036854775808")) == etl::to_string(int64_t(INT64_MIN), str, true));
CHECK(etl::string<120>(STR("000012832768214748364892233720368547758081273276721474836479223372036854775807-128")) == etl::to_string(INT8_MIN, str, true));
CHECK(etl::string<120>(STR("000012832768214748364892233720368547758081273276721474836479223372036854775807-128-32768")) == etl::to_string(INT16_MIN, str, true));
CHECK(etl::string<120>(STR("000012832768214748364892233720368547758081273276721474836479223372036854775807-128-32768-2147483648")) == etl::to_string(INT32_MIN, str, true));
CHECK(etl::string<120>(STR("000012832768214748364892233720368547758081273276721474836479223372036854775807-128-32768-2147483648-9223372036854775808")) == etl::to_string(INT64_MIN, str, true));
}
//*************************************************************************
@ -125,15 +125,15 @@ namespace
CHECK(etl::string<20>(STR("##########2147483648")) == etl::to_string(uint32_t(2147483648ul), str, format));
CHECK(etl::string<20>(STR("#9223372036854775808")) == etl::to_string(uint64_t(9223372036854775808ull), str, format));
CHECK(etl::string<20>(STR("#################127")) == etl::to_string(int8_t(INT8_MAX), str, format));
CHECK(etl::string<20>(STR("###############32767")) == etl::to_string(int16_t(INT16_MAX), str, format));
CHECK(etl::string<20>(STR("##########2147483647")) == etl::to_string(int32_t(INT32_MAX), str, format));
CHECK(etl::string<20>(STR("#9223372036854775807")) == etl::to_string(int64_t(INT64_MAX), str, format));
CHECK(etl::string<20>(STR("#################127")) == etl::to_string(INT8_MAX, str, format));
CHECK(etl::string<20>(STR("###############32767")) == etl::to_string(INT16_MAX, str, format));
CHECK(etl::string<20>(STR("##########2147483647")) == etl::to_string(INT32_MAX, str, format));
CHECK(etl::string<20>(STR("#9223372036854775807")) == etl::to_string(INT64_MAX, str, format));
CHECK(etl::string<20>(STR("################-128")) == etl::to_string(int8_t(INT8_MIN), str, format));
CHECK(etl::string<20>(STR("##############-32768")) == etl::to_string(int16_t(INT16_MIN), str, format));
CHECK(etl::string<20>(STR("#########-2147483648")) == etl::to_string(int32_t(INT32_MIN), str, format));
CHECK(etl::string<20>(STR("-9223372036854775808")) == etl::to_string(int64_t(INT64_MIN), str, format));
CHECK(etl::string<20>(STR("################-128")) == etl::to_string(INT8_MIN, str, format));
CHECK(etl::string<20>(STR("##############-32768")) == etl::to_string(INT16_MIN, str, format));
CHECK(etl::string<20>(STR("#########-2147483648")) == etl::to_string(INT32_MIN, str, format));
CHECK(etl::string<20>(STR("-9223372036854775808")) == etl::to_string(INT64_MIN, str, format));
}
//*************************************************************************
@ -153,15 +153,15 @@ namespace
CHECK(etl::string<20>(STR("2147483648##########")) == etl::to_string(uint32_t(2147483648ul), str, format));
CHECK(etl::string<20>(STR("9223372036854775808#")) == etl::to_string(uint64_t(9223372036854775808ull), str, format));
CHECK(etl::string<20>(STR("127#################")) == etl::to_string(int8_t(INT8_MAX), str, format));
CHECK(etl::string<20>(STR("32767###############")) == etl::to_string(int16_t(INT16_MAX), str, format));
CHECK(etl::string<20>(STR("2147483647##########")) == etl::to_string(int32_t(INT32_MAX), str, format));
CHECK(etl::string<20>(STR("9223372036854775807#")) == etl::to_string(int64_t(INT64_MAX), str, format));
CHECK(etl::string<20>(STR("127#################")) == etl::to_string(INT8_MAX, str, format));
CHECK(etl::string<20>(STR("32767###############")) == etl::to_string(INT16_MAX, str, format));
CHECK(etl::string<20>(STR("2147483647##########")) == etl::to_string(INT32_MAX, str, format));
CHECK(etl::string<20>(STR("9223372036854775807#")) == etl::to_string(INT64_MAX, str, format));
CHECK(etl::string<20>(STR("-128################")) == etl::to_string(int8_t(INT8_MIN), str, format));
CHECK(etl::string<20>(STR("-32768##############")) == etl::to_string(int16_t(INT16_MIN), str, format));
CHECK(etl::string<20>(STR("-2147483648#########")) == etl::to_string(int32_t(INT32_MIN), str, format));
CHECK(etl::string<20>(STR("-9223372036854775808")) == etl::to_string(int64_t(INT64_MIN), str, format));
CHECK(etl::string<20>(STR("-128################")) == etl::to_string(INT8_MIN, str, format));
CHECK(etl::string<20>(STR("-32768##############")) == etl::to_string(INT16_MIN, str, format));
CHECK(etl::string<20>(STR("-2147483648#########")) == etl::to_string(INT32_MIN, str, format));
CHECK(etl::string<20>(STR("-9223372036854775808")) == etl::to_string(INT64_MIN, str, format));
}
//*************************************************************************
@ -179,15 +179,15 @@ namespace
CHECK(etl::string<64>(STR("10000000000000000000000000000000")) == etl::to_string(uint32_t(2147483648ul), str, Format().base(2).width(32).fill(STR('0'))));
CHECK(etl::string<64>(STR("1000000000000000000000000000000000000000000000000000000000000000")) == etl::to_string(uint64_t(9223372036854775808ull), str, Format().base(2).width(64).fill(STR('0'))));
CHECK(etl::string<64>(STR("01111111")) == etl::to_string(int8_t(INT8_MAX), str, Format().base(2).width(8).fill(STR('0'))));
CHECK(etl::string<64>(STR("0111111111111111")) == etl::to_string(int16_t(INT16_MAX), str, Format().base(2).width(16).fill(STR('0'))));
CHECK(etl::string<64>(STR("01111111111111111111111111111111")) == etl::to_string(int32_t(INT32_MAX), str, Format().base(2).width(32).fill(STR('0'))));
CHECK(etl::string<64>(STR("0111111111111111111111111111111111111111111111111111111111111111")) == etl::to_string(int64_t(INT64_MAX), str, Format().base(2).width(64).fill(STR('0'))));
CHECK(etl::string<64>(STR("01111111")) == etl::to_string(INT8_MAX, str, Format().base(2).width(8).fill(STR('0'))));
CHECK(etl::string<64>(STR("0111111111111111")) == etl::to_string(INT16_MAX, str, Format().base(2).width(16).fill(STR('0'))));
CHECK(etl::string<64>(STR("01111111111111111111111111111111")) == etl::to_string(INT32_MAX, str, Format().base(2).width(32).fill(STR('0'))));
CHECK(etl::string<64>(STR("0111111111111111111111111111111111111111111111111111111111111111")) == etl::to_string(INT64_MAX, str, Format().base(2).width(64).fill(STR('0'))));
CHECK(etl::string<64>(STR("10000000")) == etl::to_string(int8_t(INT8_MIN), str, Format().base(2).width(8).fill(STR('0'))));
CHECK(etl::string<64>(STR("1000000000000000")) == etl::to_string(int16_t(INT16_MIN), str, Format().base(2).width(16).fill(STR('0'))));
CHECK(etl::string<64>(STR("10000000000000000000000000000000")) == etl::to_string(int32_t(INT32_MIN), str, Format().base(2).width(32).fill(STR('0'))));
CHECK(etl::string<64>(STR("1000000000000000000000000000000000000000000000000000000000000000")) == etl::to_string(int64_t(INT64_MIN), str, Format().base(2).width(64).fill(STR('0'))));
CHECK(etl::string<64>(STR("10000000")) == etl::to_string(INT8_MIN, str, Format().base(2).width(8).fill(STR('0'))));
CHECK(etl::string<64>(STR("1000000000000000")) == etl::to_string(INT16_MIN, str, Format().base(2).width(16).fill(STR('0'))));
CHECK(etl::string<64>(STR("10000000000000000000000000000000")) == etl::to_string(INT32_MIN, str, Format().base(2).width(32).fill(STR('0'))));
CHECK(etl::string<64>(STR("1000000000000000000000000000000000000000000000000000000000000000")) == etl::to_string(INT64_MIN, str, Format().base(2).width(64).fill(STR('0'))));
}
//*************************************************************************
@ -205,15 +205,15 @@ namespace
CHECK(etl::string<22>(STR("20000000000")) == etl::to_string(uint32_t(2147483648ul), str, Format().base(8).width(11).fill(STR('0'))));
CHECK(etl::string<22>(STR("1000000000000000000000")) == etl::to_string(uint64_t(9223372036854775808ull), str, Format().base(8).width(22).fill(STR('0'))));
CHECK(etl::string<22>(STR("177")) == etl::to_string(int8_t(INT8_MAX), str, Format().base(8).width(3).fill(STR('0'))));
CHECK(etl::string<22>(STR("077777")) == etl::to_string(int16_t(INT16_MAX), str, Format().base(8).width(6).fill(STR('0'))));
CHECK(etl::string<22>(STR("17777777777")) == etl::to_string(int32_t(INT32_MAX), str, Format().base(8).width(11).fill(STR('0'))));
CHECK(etl::string<22>(STR("0777777777777777777777")) == etl::to_string(int64_t(INT64_MAX), str, Format().base(8).width(22).fill(STR('0'))));
CHECK(etl::string<22>(STR("177")) == etl::to_string(INT8_MAX, str, Format().base(8).width(3).fill(STR('0'))));
CHECK(etl::string<22>(STR("077777")) == etl::to_string(INT16_MAX, str, Format().base(8).width(6).fill(STR('0'))));
CHECK(etl::string<22>(STR("17777777777")) == etl::to_string(INT32_MAX, str, Format().base(8).width(11).fill(STR('0'))));
CHECK(etl::string<22>(STR("0777777777777777777777")) == etl::to_string(INT64_MAX, str, Format().base(8).width(22).fill(STR('0'))));
CHECK(etl::string<22>(STR("200")) == etl::to_string(int8_t(INT8_MIN), str, Format().base(8).width(3).fill(STR('0'))));
CHECK(etl::string<22>(STR("100000")) == etl::to_string(int16_t(INT16_MIN), str, Format().base(8).width(6).fill(STR('0'))));
CHECK(etl::string<22>(STR("20000000000")) == etl::to_string(int32_t(INT32_MIN), str, Format().base(8).width(11).fill(STR('0'))));
CHECK(etl::string<22>(STR("1000000000000000000000")) == etl::to_string(int64_t(INT64_MIN), str, Format().base(8).width(22).fill(STR('0'))));
CHECK(etl::string<22>(STR("200")) == etl::to_string(INT8_MIN, str, Format().base(8).width(3).fill(STR('0'))));
CHECK(etl::string<22>(STR("100000")) == etl::to_string(INT16_MIN, str, Format().base(8).width(6).fill(STR('0'))));
CHECK(etl::string<22>(STR("20000000000")) == etl::to_string(INT32_MIN, str, Format().base(8).width(11).fill(STR('0'))));
CHECK(etl::string<22>(STR("1000000000000000000000")) == etl::to_string(INT64_MIN, str, Format().base(8).width(22).fill(STR('0'))));
}
//*************************************************************************
@ -231,15 +231,15 @@ namespace
CHECK(etl::string<16>(STR("80000000")) == etl::to_string(uint32_t(2147483648ul), str, Format().base(16).width(8).fill(STR('0'))));
CHECK(etl::string<16>(STR("8000000000000000")) == etl::to_string(uint64_t(9223372036854775808ull), str, Format().base(16).width(16).fill(STR('0'))));
CHECK(etl::string<16>(STR("7f")) == etl::to_string(int8_t(INT8_MAX), str, Format().base(16).width(2).fill(STR('0'))));
CHECK(etl::string<16>(STR("7fff")) == etl::to_string(int16_t(INT16_MAX), str, Format().base(16).width(4).fill(STR('0'))));
CHECK(etl::string<16>(STR("7fffffff")) == etl::to_string(int32_t(INT32_MAX), str, Format().base(16).width(8).fill(STR('0'))));
CHECK(etl::string<16>(STR("7fffffffffffffff")) == etl::to_string(int64_t(INT64_MAX), str, Format().base(16).width(16).fill(STR('0'))));
CHECK(etl::string<16>(STR("7f")) == etl::to_string(INT8_MAX, str, Format().base(16).width(2).fill(STR('0'))));
CHECK(etl::string<16>(STR("7fff")) == etl::to_string(INT16_MAX, str, Format().base(16).width(4).fill(STR('0'))));
CHECK(etl::string<16>(STR("7fffffff")) == etl::to_string(INT32_MAX, str, Format().base(16).width(8).fill(STR('0'))));
CHECK(etl::string<16>(STR("7fffffffffffffff")) == etl::to_string(INT64_MAX, str, Format().base(16).width(16).fill(STR('0'))));
CHECK(etl::string<16>(STR("80")) == etl::to_string(int8_t(INT8_MIN), str, Format().base(16).width(2).fill(STR('0'))));
CHECK(etl::string<16>(STR("8000")) == etl::to_string(int16_t(INT16_MIN), str, Format().base(16).width(4).fill(STR('0'))));
CHECK(etl::string<16>(STR("80000000")) == etl::to_string(int32_t(INT32_MIN), str, Format().base(16).width(8).fill(STR('0'))));
CHECK(etl::string<16>(STR("8000000000000000")) == etl::to_string(int64_t(INT64_MIN), str, Format().base(16).width(16).fill(STR('0'))));
CHECK(etl::string<16>(STR("80")) == etl::to_string(INT8_MIN, str, Format().base(16).width(2).fill(STR('0'))));
CHECK(etl::string<16>(STR("8000")) == etl::to_string(INT16_MIN, str, Format().base(16).width(4).fill(STR('0'))));
CHECK(etl::string<16>(STR("80000000")) == etl::to_string(INT32_MIN, str, Format().base(16).width(8).fill(STR('0'))));
CHECK(etl::string<16>(STR("8000000000000000")) == etl::to_string(INT64_MIN, str, Format().base(16).width(16).fill(STR('0'))));
}
//*************************************************************************

View File

@ -56,15 +56,15 @@ namespace
CHECK(etl::u16string<20>(STR("2147483648")) == etl::to_string(uint32_t(2147483648ul), str));
CHECK(etl::u16string<20>(STR("9223372036854775808")) == etl::to_string(uint64_t(9223372036854775808ull), str));
CHECK(etl::u16string<20>(STR("127")) == etl::to_string(int8_t(INT8_MAX), str));
CHECK(etl::u16string<20>(STR("32767")) == etl::to_string(int16_t(INT16_MAX), str));
CHECK(etl::u16string<20>(STR("2147483647")) == etl::to_string(int32_t(INT32_MAX), str));
CHECK(etl::u16string<20>(STR("9223372036854775807")) == etl::to_string(int64_t(INT64_MAX), str));
CHECK(etl::u16string<20>(STR("127")) == etl::to_string(INT8_MAX, str));
CHECK(etl::u16string<20>(STR("32767")) == etl::to_string(INT16_MAX, str));
CHECK(etl::u16string<20>(STR("2147483647")) == etl::to_string(INT32_MAX, str));
CHECK(etl::u16string<20>(STR("9223372036854775807")) == etl::to_string(INT64_MAX, str));
CHECK(etl::u16string<20>(STR("-128")) == etl::to_string(int8_t(INT8_MIN), str));
CHECK(etl::u16string<20>(STR("-32768")) == etl::to_string(int16_t(INT16_MIN), str));
CHECK(etl::u16string<20>(STR("-2147483648")) == etl::to_string(int32_t(INT32_MIN), str));
CHECK(etl::u16string<20>(STR("-9223372036854775808")) == etl::to_string(int64_t(INT64_MIN), str));
CHECK(etl::u16string<20>(STR("-128")) == etl::to_string(INT8_MIN, str));
CHECK(etl::u16string<20>(STR("-32768")) == etl::to_string(INT16_MIN, str));
CHECK(etl::u16string<20>(STR("-2147483648")) == etl::to_string(INT32_MIN, str));
CHECK(etl::u16string<20>(STR("-9223372036854775808")) == etl::to_string(INT64_MIN, str));
}
//*************************************************************************
@ -82,15 +82,15 @@ namespace
CHECK(etl::u16string<120>(STR("0000128327682147483648")) == etl::to_string(uint32_t(2147483648ul), str, true));
CHECK(etl::u16string<120>(STR("00001283276821474836489223372036854775808")) == etl::to_string(uint64_t(9223372036854775808ull), str, true));
CHECK(etl::u16string<120>(STR("00001283276821474836489223372036854775808127")) == etl::to_string(int8_t(INT8_MAX), str, true));
CHECK(etl::u16string<120>(STR("0000128327682147483648922337203685477580812732767")) == etl::to_string(int16_t(INT16_MAX), str, true));
CHECK(etl::u16string<120>(STR("00001283276821474836489223372036854775808127327672147483647")) == etl::to_string(int32_t(INT32_MAX), str, true));
CHECK(etl::u16string<120>(STR("000012832768214748364892233720368547758081273276721474836479223372036854775807")) == etl::to_string(int64_t(INT64_MAX), str, true));
CHECK(etl::u16string<120>(STR("00001283276821474836489223372036854775808127")) == etl::to_string(INT8_MAX, str, true));
CHECK(etl::u16string<120>(STR("0000128327682147483648922337203685477580812732767")) == etl::to_string(INT16_MAX, str, true));
CHECK(etl::u16string<120>(STR("00001283276821474836489223372036854775808127327672147483647")) == etl::to_string(INT32_MAX, str, true));
CHECK(etl::u16string<120>(STR("000012832768214748364892233720368547758081273276721474836479223372036854775807")) == etl::to_string(INT64_MAX, str, true));
CHECK(etl::u16string<120>(STR("000012832768214748364892233720368547758081273276721474836479223372036854775807-128")) == etl::to_string(int8_t(INT8_MIN), str, true));
CHECK(etl::u16string<120>(STR("000012832768214748364892233720368547758081273276721474836479223372036854775807-128-32768")) == etl::to_string(int16_t(INT16_MIN), str, true));
CHECK(etl::u16string<120>(STR("000012832768214748364892233720368547758081273276721474836479223372036854775807-128-32768-2147483648")) == etl::to_string(int32_t(INT32_MIN), str, true));
CHECK(etl::u16string<120>(STR("000012832768214748364892233720368547758081273276721474836479223372036854775807-128-32768-2147483648-9223372036854775808")) == etl::to_string(int64_t(INT64_MIN), str, true));
CHECK(etl::u16string<120>(STR("000012832768214748364892233720368547758081273276721474836479223372036854775807-128")) == etl::to_string(INT8_MIN, str, true));
CHECK(etl::u16string<120>(STR("000012832768214748364892233720368547758081273276721474836479223372036854775807-128-32768")) == etl::to_string(INT16_MIN, str, true));
CHECK(etl::u16string<120>(STR("000012832768214748364892233720368547758081273276721474836479223372036854775807-128-32768-2147483648")) == etl::to_string(INT32_MIN, str, true));
CHECK(etl::u16string<120>(STR("000012832768214748364892233720368547758081273276721474836479223372036854775807-128-32768-2147483648-9223372036854775808")) == etl::to_string(INT64_MIN, str, true));
}
//*************************************************************************
@ -110,15 +110,15 @@ namespace
CHECK(etl::u16string<20>(STR("##########2147483648")) == etl::to_string(uint32_t(2147483648ul), str, format));
CHECK(etl::u16string<20>(STR("#9223372036854775808")) == etl::to_string(uint64_t(9223372036854775808ull), str, format));
CHECK(etl::u16string<20>(STR("#################127")) == etl::to_string(int8_t(INT8_MAX), str, format));
CHECK(etl::u16string<20>(STR("###############32767")) == etl::to_string(int16_t(INT16_MAX), str, format));
CHECK(etl::u16string<20>(STR("##########2147483647")) == etl::to_string(int32_t(INT32_MAX), str, format));
CHECK(etl::u16string<20>(STR("#9223372036854775807")) == etl::to_string(int64_t(INT64_MAX), str, format));
CHECK(etl::u16string<20>(STR("#################127")) == etl::to_string(INT8_MAX, str, format));
CHECK(etl::u16string<20>(STR("###############32767")) == etl::to_string(INT16_MAX, str, format));
CHECK(etl::u16string<20>(STR("##########2147483647")) == etl::to_string(INT32_MAX, str, format));
CHECK(etl::u16string<20>(STR("#9223372036854775807")) == etl::to_string(INT64_MAX, str, format));
CHECK(etl::u16string<20>(STR("################-128")) == etl::to_string(int8_t(INT8_MIN), str, format));
CHECK(etl::u16string<20>(STR("##############-32768")) == etl::to_string(int16_t(INT16_MIN), str, format));
CHECK(etl::u16string<20>(STR("#########-2147483648")) == etl::to_string(int32_t(INT32_MIN), str, format));
CHECK(etl::u16string<20>(STR("-9223372036854775808")) == etl::to_string(int64_t(INT64_MIN), str, format));
CHECK(etl::u16string<20>(STR("################-128")) == etl::to_string(INT8_MIN, str, format));
CHECK(etl::u16string<20>(STR("##############-32768")) == etl::to_string(INT16_MIN, str, format));
CHECK(etl::u16string<20>(STR("#########-2147483648")) == etl::to_string(INT32_MIN, str, format));
CHECK(etl::u16string<20>(STR("-9223372036854775808")) == etl::to_string(INT64_MIN, str, format));
}
//*************************************************************************
@ -138,15 +138,15 @@ namespace
CHECK(etl::u16string<20>(STR("2147483648##########")) == etl::to_string(uint32_t(2147483648ul), str, format));
CHECK(etl::u16string<20>(STR("9223372036854775808#")) == etl::to_string(uint64_t(9223372036854775808ull), str, format));
CHECK(etl::u16string<20>(STR("127#################")) == etl::to_string(int8_t(INT8_MAX), str, format));
CHECK(etl::u16string<20>(STR("32767###############")) == etl::to_string(int16_t(INT16_MAX), str, format));
CHECK(etl::u16string<20>(STR("2147483647##########")) == etl::to_string(int32_t(INT32_MAX), str, format));
CHECK(etl::u16string<20>(STR("9223372036854775807#")) == etl::to_string(int64_t(INT64_MAX), str, format));
CHECK(etl::u16string<20>(STR("127#################")) == etl::to_string(INT8_MAX, str, format));
CHECK(etl::u16string<20>(STR("32767###############")) == etl::to_string(INT16_MAX, str, format));
CHECK(etl::u16string<20>(STR("2147483647##########")) == etl::to_string(INT32_MAX, str, format));
CHECK(etl::u16string<20>(STR("9223372036854775807#")) == etl::to_string(INT64_MAX, str, format));
CHECK(etl::u16string<20>(STR("-128################")) == etl::to_string(int8_t(INT8_MIN), str, format));
CHECK(etl::u16string<20>(STR("-32768##############")) == etl::to_string(int16_t(INT16_MIN), str, format));
CHECK(etl::u16string<20>(STR("-2147483648#########")) == etl::to_string(int32_t(INT32_MIN), str, format));
CHECK(etl::u16string<20>(STR("-9223372036854775808")) == etl::to_string(int64_t(INT64_MIN), str, format));
CHECK(etl::u16string<20>(STR("-128################")) == etl::to_string(INT8_MIN, str, format));
CHECK(etl::u16string<20>(STR("-32768##############")) == etl::to_string(INT16_MIN, str, format));
CHECK(etl::u16string<20>(STR("-2147483648#########")) == etl::to_string(INT32_MIN, str, format));
CHECK(etl::u16string<20>(STR("-9223372036854775808")) == etl::to_string(INT64_MIN, str, format));
}
//*************************************************************************
@ -164,15 +164,15 @@ namespace
CHECK(etl::u16string<64>(STR("10000000000000000000000000000000")) == etl::to_string(uint32_t(2147483648ul), str, Format().base(2).width(32).fill(STR('0'))));
CHECK(etl::u16string<64>(STR("1000000000000000000000000000000000000000000000000000000000000000")) == etl::to_string(uint64_t(9223372036854775808ull), str, Format().base(2).width(64).fill(STR('0'))));
CHECK(etl::u16string<64>(STR("01111111")) == etl::to_string(int8_t(INT8_MAX), str, Format().base(2).width(8).fill(STR('0'))));
CHECK(etl::u16string<64>(STR("0111111111111111")) == etl::to_string(int16_t(INT16_MAX), str, Format().base(2).width(16).fill(STR('0'))));
CHECK(etl::u16string<64>(STR("01111111111111111111111111111111")) == etl::to_string(int32_t(INT32_MAX), str, Format().base(2).width(32).fill(STR('0'))));
CHECK(etl::u16string<64>(STR("0111111111111111111111111111111111111111111111111111111111111111")) == etl::to_string(int64_t(INT64_MAX), str, Format().base(2).width(64).fill(STR('0'))));
CHECK(etl::u16string<64>(STR("01111111")) == etl::to_string(INT8_MAX, str, Format().base(2).width(8).fill(STR('0'))));
CHECK(etl::u16string<64>(STR("0111111111111111")) == etl::to_string(INT16_MAX, str, Format().base(2).width(16).fill(STR('0'))));
CHECK(etl::u16string<64>(STR("01111111111111111111111111111111")) == etl::to_string(INT32_MAX, str, Format().base(2).width(32).fill(STR('0'))));
CHECK(etl::u16string<64>(STR("0111111111111111111111111111111111111111111111111111111111111111")) == etl::to_string(INT64_MAX, str, Format().base(2).width(64).fill(STR('0'))));
CHECK(etl::u16string<64>(STR("10000000")) == etl::to_string(int8_t(INT8_MIN), str, Format().base(2).width(8).fill(STR('0'))));
CHECK(etl::u16string<64>(STR("1000000000000000")) == etl::to_string(int16_t(INT16_MIN), str, Format().base(2).width(16).fill(STR('0'))));
CHECK(etl::u16string<64>(STR("10000000000000000000000000000000")) == etl::to_string(int32_t(INT32_MIN), str, Format().base(2).width(32).fill(STR('0'))));
CHECK(etl::u16string<64>(STR("1000000000000000000000000000000000000000000000000000000000000000")) == etl::to_string(int64_t(INT64_MIN), str, Format().base(2).width(64).fill(STR('0'))));
CHECK(etl::u16string<64>(STR("10000000")) == etl::to_string(INT8_MIN, str, Format().base(2).width(8).fill(STR('0'))));
CHECK(etl::u16string<64>(STR("1000000000000000")) == etl::to_string(INT16_MIN, str, Format().base(2).width(16).fill(STR('0'))));
CHECK(etl::u16string<64>(STR("10000000000000000000000000000000")) == etl::to_string(INT32_MIN, str, Format().base(2).width(32).fill(STR('0'))));
CHECK(etl::u16string<64>(STR("1000000000000000000000000000000000000000000000000000000000000000")) == etl::to_string(INT64_MIN, str, Format().base(2).width(64).fill(STR('0'))));
}
//*************************************************************************
@ -190,15 +190,15 @@ namespace
CHECK(etl::u16string<22>(STR("20000000000")) == etl::to_string(uint32_t(2147483648ul), str, Format().base(8).width(11).fill(STR('0'))));
CHECK(etl::u16string<22>(STR("1000000000000000000000")) == etl::to_string(uint64_t(9223372036854775808ull), str, Format().base(8).width(22).fill(STR('0'))));
CHECK(etl::u16string<22>(STR("177")) == etl::to_string(int8_t(INT8_MAX), str, Format().base(8).width(3).fill(STR('0'))));
CHECK(etl::u16string<22>(STR("077777")) == etl::to_string(int16_t(INT16_MAX), str, Format().base(8).width(6).fill(STR('0'))));
CHECK(etl::u16string<22>(STR("17777777777")) == etl::to_string(int32_t(INT32_MAX), str, Format().base(8).width(11).fill(STR('0'))));
CHECK(etl::u16string<22>(STR("0777777777777777777777")) == etl::to_string(int64_t(INT64_MAX), str, Format().base(8).width(22).fill(STR('0'))));
CHECK(etl::u16string<22>(STR("177")) == etl::to_string(INT8_MAX, str, Format().base(8).width(3).fill(STR('0'))));
CHECK(etl::u16string<22>(STR("077777")) == etl::to_string(INT16_MAX, str, Format().base(8).width(6).fill(STR('0'))));
CHECK(etl::u16string<22>(STR("17777777777")) == etl::to_string(INT32_MAX, str, Format().base(8).width(11).fill(STR('0'))));
CHECK(etl::u16string<22>(STR("0777777777777777777777")) == etl::to_string(INT64_MAX, str, Format().base(8).width(22).fill(STR('0'))));
CHECK(etl::u16string<22>(STR("200")) == etl::to_string(int8_t(INT8_MIN), str, Format().base(8).width(3).fill(STR('0'))));
CHECK(etl::u16string<22>(STR("100000")) == etl::to_string(int16_t(INT16_MIN), str, Format().base(8).width(6).fill(STR('0'))));
CHECK(etl::u16string<22>(STR("20000000000")) == etl::to_string(int32_t(INT32_MIN), str, Format().base(8).width(11).fill(STR('0'))));
CHECK(etl::u16string<22>(STR("1000000000000000000000")) == etl::to_string(int64_t(INT64_MIN), str, Format().base(8).width(22).fill(STR('0'))));
CHECK(etl::u16string<22>(STR("200")) == etl::to_string(INT8_MIN, str, Format().base(8).width(3).fill(STR('0'))));
CHECK(etl::u16string<22>(STR("100000")) == etl::to_string(INT16_MIN, str, Format().base(8).width(6).fill(STR('0'))));
CHECK(etl::u16string<22>(STR("20000000000")) == etl::to_string(INT32_MIN, str, Format().base(8).width(11).fill(STR('0'))));
CHECK(etl::u16string<22>(STR("1000000000000000000000")) == etl::to_string(INT64_MIN, str, Format().base(8).width(22).fill(STR('0'))));
}
//*************************************************************************
@ -216,15 +216,15 @@ namespace
CHECK(etl::u16string<16>(STR("80000000")) == etl::to_string(uint32_t(2147483648ul), str, Format().base(16).width(8).fill(STR('0'))));
CHECK(etl::u16string<16>(STR("8000000000000000")) == etl::to_string(uint64_t(9223372036854775808ull), str, Format().base(16).width(16).fill(STR('0'))));
CHECK(etl::u16string<16>(STR("7f")) == etl::to_string(int8_t(INT8_MAX), str, Format().base(16).width(2).fill(STR('0'))));
CHECK(etl::u16string<16>(STR("7fff")) == etl::to_string(int16_t(INT16_MAX), str, Format().base(16).width(4).fill(STR('0'))));
CHECK(etl::u16string<16>(STR("7fffffff")) == etl::to_string(int32_t(INT32_MAX), str, Format().base(16).width(8).fill(STR('0'))));
CHECK(etl::u16string<16>(STR("7fffffffffffffff")) == etl::to_string(int64_t(INT64_MAX), str, Format().base(16).width(16).fill(STR('0'))));
CHECK(etl::u16string<16>(STR("7f")) == etl::to_string(INT8_MAX, str, Format().base(16).width(2).fill(STR('0'))));
CHECK(etl::u16string<16>(STR("7fff")) == etl::to_string(INT16_MAX, str, Format().base(16).width(4).fill(STR('0'))));
CHECK(etl::u16string<16>(STR("7fffffff")) == etl::to_string(INT32_MAX, str, Format().base(16).width(8).fill(STR('0'))));
CHECK(etl::u16string<16>(STR("7fffffffffffffff")) == etl::to_string(INT64_MAX, str, Format().base(16).width(16).fill(STR('0'))));
CHECK(etl::u16string<16>(STR("80")) == etl::to_string(int8_t(INT8_MIN), str, Format().base(16).width(2).fill(STR('0'))));
CHECK(etl::u16string<16>(STR("8000")) == etl::to_string(int16_t(INT16_MIN), str, Format().base(16).width(4).fill(STR('0'))));
CHECK(etl::u16string<16>(STR("80000000")) == etl::to_string(int32_t(INT32_MIN), str, Format().base(16).width(8).fill(STR('0'))));
CHECK(etl::u16string<16>(STR("8000000000000000")) == etl::to_string(int64_t(INT64_MIN), str, Format().base(16).width(16).fill(STR('0'))));
CHECK(etl::u16string<16>(STR("80")) == etl::to_string(INT8_MIN, str, Format().base(16).width(2).fill(STR('0'))));
CHECK(etl::u16string<16>(STR("8000")) == etl::to_string(INT16_MIN, str, Format().base(16).width(4).fill(STR('0'))));
CHECK(etl::u16string<16>(STR("80000000")) == etl::to_string(INT32_MIN, str, Format().base(16).width(8).fill(STR('0'))));
CHECK(etl::u16string<16>(STR("8000000000000000")) == etl::to_string(INT64_MIN, str, Format().base(16).width(16).fill(STR('0'))));
}
//*************************************************************************

View File

@ -58,15 +58,15 @@ namespace
CHECK(etl::u32string<20>(STR("2147483648")) == etl::to_string(uint32_t(2147483648ul), str));
CHECK(etl::u32string<20>(STR("9223372036854775808")) == etl::to_string(uint64_t(9223372036854775808ull), str));
CHECK(etl::u32string<20>(STR("127")) == etl::to_string(int8_t(INT8_MAX), str));
CHECK(etl::u32string<20>(STR("32767")) == etl::to_string(int16_t(INT16_MAX), str));
CHECK(etl::u32string<20>(STR("2147483647")) == etl::to_string(int32_t(INT32_MAX), str));
CHECK(etl::u32string<20>(STR("9223372036854775807")) == etl::to_string(int64_t(INT64_MAX), str));
CHECK(etl::u32string<20>(STR("127")) == etl::to_string(INT8_MAX, str));
CHECK(etl::u32string<20>(STR("32767")) == etl::to_string(INT16_MAX, str));
CHECK(etl::u32string<20>(STR("2147483647")) == etl::to_string(INT32_MAX, str));
CHECK(etl::u32string<20>(STR("9223372036854775807")) == etl::to_string(INT64_MAX, str));
CHECK(etl::u32string<20>(STR("-128")) == etl::to_string(int8_t(INT8_MIN), str));
CHECK(etl::u32string<20>(STR("-32768")) == etl::to_string(int16_t(INT16_MIN), str));
CHECK(etl::u32string<20>(STR("-2147483648")) == etl::to_string(int32_t(INT32_MIN), str));
CHECK(etl::u32string<20>(STR("-9223372036854775808")) == etl::to_string(int64_t(INT64_MIN), str));
CHECK(etl::u32string<20>(STR("-128")) == etl::to_string(INT8_MIN, str));
CHECK(etl::u32string<20>(STR("-32768")) == etl::to_string(INT16_MIN, str));
CHECK(etl::u32string<20>(STR("-2147483648")) == etl::to_string(INT32_MIN, str));
CHECK(etl::u32string<20>(STR("-9223372036854775808")) == etl::to_string(INT64_MIN, str));
}
//*************************************************************************
@ -84,15 +84,15 @@ namespace
CHECK(etl::u32string<120>(STR("0000128327682147483648")) == etl::to_string(uint32_t(2147483648ul), str, true));
CHECK(etl::u32string<120>(STR("00001283276821474836489223372036854775808")) == etl::to_string(uint64_t(9223372036854775808ull), str, true));
CHECK(etl::u32string<120>(STR("00001283276821474836489223372036854775808127")) == etl::to_string(int8_t(INT8_MAX), str, true));
CHECK(etl::u32string<120>(STR("0000128327682147483648922337203685477580812732767")) == etl::to_string(int16_t(INT16_MAX), str, true));
CHECK(etl::u32string<120>(STR("00001283276821474836489223372036854775808127327672147483647")) == etl::to_string(int32_t(INT32_MAX), str, true));
CHECK(etl::u32string<120>(STR("000012832768214748364892233720368547758081273276721474836479223372036854775807")) == etl::to_string(int64_t(INT64_MAX), str, true));
CHECK(etl::u32string<120>(STR("00001283276821474836489223372036854775808127")) == etl::to_string(INT8_MAX, str, true));
CHECK(etl::u32string<120>(STR("0000128327682147483648922337203685477580812732767")) == etl::to_string(INT16_MAX, str, true));
CHECK(etl::u32string<120>(STR("00001283276821474836489223372036854775808127327672147483647")) == etl::to_string(INT32_MAX, str, true));
CHECK(etl::u32string<120>(STR("000012832768214748364892233720368547758081273276721474836479223372036854775807")) == etl::to_string(INT64_MAX, str, true));
CHECK(etl::u32string<120>(STR("000012832768214748364892233720368547758081273276721474836479223372036854775807-128")) == etl::to_string(int8_t(INT8_MIN), str, true));
CHECK(etl::u32string<120>(STR("000012832768214748364892233720368547758081273276721474836479223372036854775807-128-32768")) == etl::to_string(int16_t(INT16_MIN), str, true));
CHECK(etl::u32string<120>(STR("000012832768214748364892233720368547758081273276721474836479223372036854775807-128-32768-2147483648")) == etl::to_string(int32_t(INT32_MIN), str, true));
CHECK(etl::u32string<120>(STR("000012832768214748364892233720368547758081273276721474836479223372036854775807-128-32768-2147483648-9223372036854775808")) == etl::to_string(int64_t(INT64_MIN), str, true));
CHECK(etl::u32string<120>(STR("000012832768214748364892233720368547758081273276721474836479223372036854775807-128")) == etl::to_string(INT8_MIN, str, true));
CHECK(etl::u32string<120>(STR("000012832768214748364892233720368547758081273276721474836479223372036854775807-128-32768")) == etl::to_string(INT16_MIN, str, true));
CHECK(etl::u32string<120>(STR("000012832768214748364892233720368547758081273276721474836479223372036854775807-128-32768-2147483648")) == etl::to_string(INT32_MIN, str, true));
CHECK(etl::u32string<120>(STR("000012832768214748364892233720368547758081273276721474836479223372036854775807-128-32768-2147483648-9223372036854775808")) == etl::to_string(INT64_MIN, str, true));
}
//*************************************************************************
@ -112,15 +112,15 @@ namespace
CHECK(etl::u32string<20>(STR("##########2147483648")) == etl::to_string(uint32_t(2147483648ul), str, format));
CHECK(etl::u32string<20>(STR("#9223372036854775808")) == etl::to_string(uint64_t(9223372036854775808ull), str, format));
CHECK(etl::u32string<20>(STR("#################127")) == etl::to_string(int8_t(INT8_MAX), str, format));
CHECK(etl::u32string<20>(STR("###############32767")) == etl::to_string(int16_t(INT16_MAX), str, format));
CHECK(etl::u32string<20>(STR("##########2147483647")) == etl::to_string(int32_t(INT32_MAX), str, format));
CHECK(etl::u32string<20>(STR("#9223372036854775807")) == etl::to_string(int64_t(INT64_MAX), str, format));
CHECK(etl::u32string<20>(STR("#################127")) == etl::to_string(INT8_MAX, str, format));
CHECK(etl::u32string<20>(STR("###############32767")) == etl::to_string(INT16_MAX, str, format));
CHECK(etl::u32string<20>(STR("##########2147483647")) == etl::to_string(INT32_MAX, str, format));
CHECK(etl::u32string<20>(STR("#9223372036854775807")) == etl::to_string(INT64_MAX, str, format));
CHECK(etl::u32string<20>(STR("################-128")) == etl::to_string(int8_t(INT8_MIN), str, format));
CHECK(etl::u32string<20>(STR("##############-32768")) == etl::to_string(int16_t(INT16_MIN), str, format));
CHECK(etl::u32string<20>(STR("#########-2147483648")) == etl::to_string(int32_t(INT32_MIN), str, format));
CHECK(etl::u32string<20>(STR("-9223372036854775808")) == etl::to_string(int64_t(INT64_MIN), str, format));
CHECK(etl::u32string<20>(STR("################-128")) == etl::to_string(INT8_MIN, str, format));
CHECK(etl::u32string<20>(STR("##############-32768")) == etl::to_string(INT16_MIN, str, format));
CHECK(etl::u32string<20>(STR("#########-2147483648")) == etl::to_string(INT32_MIN, str, format));
CHECK(etl::u32string<20>(STR("-9223372036854775808")) == etl::to_string(INT64_MIN, str, format));
}
//*************************************************************************
@ -140,15 +140,15 @@ namespace
CHECK(etl::u32string<20>(STR("2147483648##########")) == etl::to_string(uint32_t(2147483648ul), str, format));
CHECK(etl::u32string<20>(STR("9223372036854775808#")) == etl::to_string(uint64_t(9223372036854775808ull), str, format));
CHECK(etl::u32string<20>(STR("127#################")) == etl::to_string(int8_t(INT8_MAX), str, format));
CHECK(etl::u32string<20>(STR("32767###############")) == etl::to_string(int16_t(INT16_MAX), str, format));
CHECK(etl::u32string<20>(STR("2147483647##########")) == etl::to_string(int32_t(INT32_MAX), str, format));
CHECK(etl::u32string<20>(STR("9223372036854775807#")) == etl::to_string(int64_t(INT64_MAX), str, format));
CHECK(etl::u32string<20>(STR("127#################")) == etl::to_string(INT8_MAX, str, format));
CHECK(etl::u32string<20>(STR("32767###############")) == etl::to_string(INT16_MAX, str, format));
CHECK(etl::u32string<20>(STR("2147483647##########")) == etl::to_string(INT32_MAX, str, format));
CHECK(etl::u32string<20>(STR("9223372036854775807#")) == etl::to_string(INT64_MAX, str, format));
CHECK(etl::u32string<20>(STR("-128################")) == etl::to_string(int8_t(INT8_MIN), str, format));
CHECK(etl::u32string<20>(STR("-32768##############")) == etl::to_string(int16_t(INT16_MIN), str, format));
CHECK(etl::u32string<20>(STR("-2147483648#########")) == etl::to_string(int32_t(INT32_MIN), str, format));
CHECK(etl::u32string<20>(STR("-9223372036854775808")) == etl::to_string(int64_t(INT64_MIN), str, format));
CHECK(etl::u32string<20>(STR("-128################")) == etl::to_string(INT8_MIN, str, format));
CHECK(etl::u32string<20>(STR("-32768##############")) == etl::to_string(INT16_MIN, str, format));
CHECK(etl::u32string<20>(STR("-2147483648#########")) == etl::to_string(INT32_MIN, str, format));
CHECK(etl::u32string<20>(STR("-9223372036854775808")) == etl::to_string(INT64_MIN, str, format));
}
//*************************************************************************
@ -166,15 +166,15 @@ namespace
CHECK(etl::u32string<64>(STR("10000000000000000000000000000000")) == etl::to_string(uint32_t(2147483648ul), str, Format().base(2).width(32).fill(STR('0'))));
CHECK(etl::u32string<64>(STR("1000000000000000000000000000000000000000000000000000000000000000")) == etl::to_string(uint64_t(9223372036854775808ull), str, Format().base(2).width(64).fill(STR('0'))));
CHECK(etl::u32string<64>(STR("01111111")) == etl::to_string(int8_t(INT8_MAX), str, Format().base(2).width(8).fill(STR('0'))));
CHECK(etl::u32string<64>(STR("0111111111111111")) == etl::to_string(int16_t(INT16_MAX), str, Format().base(2).width(16).fill(STR('0'))));
CHECK(etl::u32string<64>(STR("01111111111111111111111111111111")) == etl::to_string(int32_t(INT32_MAX), str, Format().base(2).width(32).fill(STR('0'))));
CHECK(etl::u32string<64>(STR("0111111111111111111111111111111111111111111111111111111111111111")) == etl::to_string(int64_t(INT64_MAX), str, Format().base(2).width(64).fill(STR('0'))));
CHECK(etl::u32string<64>(STR("01111111")) == etl::to_string(INT8_MAX, str, Format().base(2).width(8).fill(STR('0'))));
CHECK(etl::u32string<64>(STR("0111111111111111")) == etl::to_string(INT16_MAX, str, Format().base(2).width(16).fill(STR('0'))));
CHECK(etl::u32string<64>(STR("01111111111111111111111111111111")) == etl::to_string(INT32_MAX, str, Format().base(2).width(32).fill(STR('0'))));
CHECK(etl::u32string<64>(STR("0111111111111111111111111111111111111111111111111111111111111111")) == etl::to_string(INT64_MAX, str, Format().base(2).width(64).fill(STR('0'))));
CHECK(etl::u32string<64>(STR("10000000")) == etl::to_string(int8_t(INT8_MIN), str, Format().base(2).width(8).fill(STR('0'))));
CHECK(etl::u32string<64>(STR("1000000000000000")) == etl::to_string(int16_t(INT16_MIN), str, Format().base(2).width(16).fill(STR('0'))));
CHECK(etl::u32string<64>(STR("10000000000000000000000000000000")) == etl::to_string(int32_t(INT32_MIN), str, Format().base(2).width(32).fill(STR('0'))));
CHECK(etl::u32string<64>(STR("1000000000000000000000000000000000000000000000000000000000000000")) == etl::to_string(int64_t(INT64_MIN), str, Format().base(2).width(64).fill(STR('0'))));
CHECK(etl::u32string<64>(STR("10000000")) == etl::to_string(INT8_MIN, str, Format().base(2).width(8).fill(STR('0'))));
CHECK(etl::u32string<64>(STR("1000000000000000")) == etl::to_string(INT16_MIN, str, Format().base(2).width(16).fill(STR('0'))));
CHECK(etl::u32string<64>(STR("10000000000000000000000000000000")) == etl::to_string(INT32_MIN, str, Format().base(2).width(32).fill(STR('0'))));
CHECK(etl::u32string<64>(STR("1000000000000000000000000000000000000000000000000000000000000000")) == etl::to_string(INT64_MIN, str, Format().base(2).width(64).fill(STR('0'))));
}
//*************************************************************************
@ -192,15 +192,15 @@ namespace
CHECK(etl::u32string<22>(STR("20000000000")) == etl::to_string(uint32_t(2147483648ul), str, Format().base(8).width(11).fill(STR('0'))));
CHECK(etl::u32string<22>(STR("1000000000000000000000")) == etl::to_string(uint64_t(9223372036854775808ull), str, Format().base(8).width(22).fill(STR('0'))));
CHECK(etl::u32string<22>(STR("177")) == etl::to_string(int8_t(INT8_MAX), str, Format().base(8).width(3).fill(STR('0'))));
CHECK(etl::u32string<22>(STR("077777")) == etl::to_string(int16_t(INT16_MAX), str, Format().base(8).width(6).fill(STR('0'))));
CHECK(etl::u32string<22>(STR("17777777777")) == etl::to_string(int32_t(INT32_MAX), str, Format().base(8).width(11).fill(STR('0'))));
CHECK(etl::u32string<22>(STR("0777777777777777777777")) == etl::to_string(int64_t(INT64_MAX), str, Format().base(8).width(22).fill(STR('0'))));
CHECK(etl::u32string<22>(STR("177")) == etl::to_string(INT8_MAX, str, Format().base(8).width(3).fill(STR('0'))));
CHECK(etl::u32string<22>(STR("077777")) == etl::to_string(INT16_MAX, str, Format().base(8).width(6).fill(STR('0'))));
CHECK(etl::u32string<22>(STR("17777777777")) == etl::to_string(INT32_MAX, str, Format().base(8).width(11).fill(STR('0'))));
CHECK(etl::u32string<22>(STR("0777777777777777777777")) == etl::to_string(INT64_MAX, str, Format().base(8).width(22).fill(STR('0'))));
CHECK(etl::u32string<22>(STR("200")) == etl::to_string(int8_t(INT8_MIN), str, Format().base(8).width(3).fill(STR('0'))));
CHECK(etl::u32string<22>(STR("100000")) == etl::to_string(int16_t(INT16_MIN), str, Format().base(8).width(6).fill(STR('0'))));
CHECK(etl::u32string<22>(STR("20000000000")) == etl::to_string(int32_t(INT32_MIN), str, Format().base(8).width(11).fill(STR('0'))));
CHECK(etl::u32string<22>(STR("1000000000000000000000")) == etl::to_string(int64_t(INT64_MIN), str, Format().base(8).width(22).fill(STR('0'))));
CHECK(etl::u32string<22>(STR("200")) == etl::to_string(INT8_MIN, str, Format().base(8).width(3).fill(STR('0'))));
CHECK(etl::u32string<22>(STR("100000")) == etl::to_string(INT16_MIN, str, Format().base(8).width(6).fill(STR('0'))));
CHECK(etl::u32string<22>(STR("20000000000")) == etl::to_string(INT32_MIN, str, Format().base(8).width(11).fill(STR('0'))));
CHECK(etl::u32string<22>(STR("1000000000000000000000")) == etl::to_string(INT64_MIN, str, Format().base(8).width(22).fill(STR('0'))));
}
//*************************************************************************
@ -218,15 +218,15 @@ namespace
CHECK(etl::u32string<16>(STR("80000000")) == etl::to_string(uint32_t(2147483648ul), str, Format().base(16).width(8).fill(STR('0'))));
CHECK(etl::u32string<16>(STR("8000000000000000")) == etl::to_string(uint64_t(9223372036854775808ull), str, Format().base(16).width(16).fill(STR('0'))));
CHECK(etl::u32string<16>(STR("7f")) == etl::to_string(int8_t(INT8_MAX), str, Format().base(16).width(2).fill(STR('0'))));
CHECK(etl::u32string<16>(STR("7fff")) == etl::to_string(int16_t(INT16_MAX), str, Format().base(16).width(4).fill(STR('0'))));
CHECK(etl::u32string<16>(STR("7fffffff")) == etl::to_string(int32_t(INT32_MAX), str, Format().base(16).width(8).fill(STR('0'))));
CHECK(etl::u32string<16>(STR("7fffffffffffffff")) == etl::to_string(int64_t(INT64_MAX), str, Format().base(16).width(16).fill(STR('0'))));
CHECK(etl::u32string<16>(STR("7f")) == etl::to_string(INT8_MAX, str, Format().base(16).width(2).fill(STR('0'))));
CHECK(etl::u32string<16>(STR("7fff")) == etl::to_string(INT16_MAX, str, Format().base(16).width(4).fill(STR('0'))));
CHECK(etl::u32string<16>(STR("7fffffff")) == etl::to_string(INT32_MAX, str, Format().base(16).width(8).fill(STR('0'))));
CHECK(etl::u32string<16>(STR("7fffffffffffffff")) == etl::to_string(INT64_MAX, str, Format().base(16).width(16).fill(STR('0'))));
CHECK(etl::u32string<16>(STR("80")) == etl::to_string(int8_t(INT8_MIN), str, Format().base(16).width(2).fill(STR('0'))));
CHECK(etl::u32string<16>(STR("8000")) == etl::to_string(int16_t(INT16_MIN), str, Format().base(16).width(4).fill(STR('0'))));
CHECK(etl::u32string<16>(STR("80000000")) == etl::to_string(int32_t(INT32_MIN), str, Format().base(16).width(8).fill(STR('0'))));
CHECK(etl::u32string<16>(STR("8000000000000000")) == etl::to_string(int64_t(INT64_MIN), str, Format().base(16).width(16).fill(STR('0'))));
CHECK(etl::u32string<16>(STR("80")) == etl::to_string(INT8_MIN, str, Format().base(16).width(2).fill(STR('0'))));
CHECK(etl::u32string<16>(STR("8000")) == etl::to_string(INT16_MIN, str, Format().base(16).width(4).fill(STR('0'))));
CHECK(etl::u32string<16>(STR("80000000")) == etl::to_string(INT32_MIN, str, Format().base(16).width(8).fill(STR('0'))));
CHECK(etl::u32string<16>(STR("8000000000000000")) == etl::to_string(INT64_MIN, str, Format().base(16).width(16).fill(STR('0'))));
}

View File

@ -5,7 +5,7 @@ Embedded Template Library.
https://github.com/ETLCPP/etl
https://www.etlcpp.com
Copyright(c) 2023 John Wellbelove
Copyright(c) 2019 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
@ -26,15 +26,14 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
******************************************************************************/
#include "etl/platform.h"
#if ETL_USING_CPP20
#include "unit_test_framework.h"
#include "etl/to_u8string.h"
#include "etl/u8string.h"
#include "etl/format_spec.h"
#if ETL_USING_CPP20
#undef STR
#define STR(x) u8##x
@ -49,25 +48,25 @@ namespace
{
etl::u8string<20> str;
CHECK(etl::u8string<20>(STR("0")) == etl::to_string(uint8_t(0), str));
CHECK(etl::u8string<20>(STR("0")) == etl::to_string(uint16_t(0), str));
CHECK(etl::u8string<20>(STR("0")) == etl::to_string(uint32_t(0), str));
CHECK(etl::u8string<20>(STR("0")) == etl::to_string(uint64_t(0), str));
CHECK(etl::u8string<20>(STR("0")) == etl::to_string(uint8_t(0), str));
CHECK(etl::u8string<20>(STR("0")) == etl::to_string(uint16_t(0), str));
CHECK(etl::u8string<20>(STR("0")) == etl::to_string(uint32_t(0), str));
CHECK(etl::u8string<20>(STR("0")) == etl::to_string(uint64_t(0), str));
CHECK(etl::u8string<20>(STR("128")) == etl::to_string(uint8_t(128), str));
CHECK(etl::u8string<20>(STR("32768")) == etl::to_string(uint16_t(32768), str));
CHECK(etl::u8string<20>(STR("2147483648")) == etl::to_string(uint32_t(2147483648ul), str));
CHECK(etl::u8string<20>(STR("9223372036854775808")) == etl::to_string(uint64_t(9223372036854775808ull), str));
CHECK(etl::u8string<20>(STR("128")) == etl::to_string(uint8_t(128), str));
CHECK(etl::u8string<20>(STR("32768")) == etl::to_string(uint16_t(32768), str));
CHECK(etl::u8string<20>(STR("2147483648")) == etl::to_string(uint32_t(2147483648ul), str));
CHECK(etl::u8string<20>(STR("9223372036854775808")) == etl::to_string(uint64_t(9223372036854775808ull), str));
CHECK(etl::u8string<20>(STR("127")) == etl::to_string(int8_t(INT8_MAX), str));
CHECK(etl::u8string<20>(STR("32767")) == etl::to_string(int16_t(INT16_MAX), str));
CHECK(etl::u8string<20>(STR("2147483647")) == etl::to_string(int32_t(INT32_MAX), str));
CHECK(etl::u8string<20>(STR("9223372036854775807")) == etl::to_string(int64_t(INT64_MAX), str));
CHECK(etl::u8string<20>(STR("127")) == etl::to_string(INT8_MAX, str));
CHECK(etl::u8string<20>(STR("32767")) == etl::to_string(INT16_MAX, str));
CHECK(etl::u8string<20>(STR("2147483647")) == etl::to_string(INT32_MAX, str));
CHECK(etl::u8string<20>(STR("9223372036854775807")) == etl::to_string(INT64_MAX, str));
CHECK(etl::u8string<20>(STR("-128")) == etl::to_string(int8_t(INT8_MIN), str));
CHECK(etl::u8string<20>(STR("-32768")) == etl::to_string(int16_t(INT16_MIN), str));
CHECK(etl::u8string<20>(STR("-2147483648")) == etl::to_string(int32_t(INT32_MIN), str));
CHECK(etl::u8string<20>(STR("-9223372036854775808")) == etl::to_string(int64_t(INT64_MIN), str));
CHECK(etl::u8string<20>(STR("-128")) == etl::to_string(INT8_MIN, str));
CHECK(etl::u8string<20>(STR("-32768")) == etl::to_string(INT16_MIN, str));
CHECK(etl::u8string<20>(STR("-2147483648")) == etl::to_string(INT32_MIN, str));
CHECK(etl::u8string<20>(STR("-9223372036854775808")) == etl::to_string(INT64_MIN, str));
}
//*************************************************************************
@ -75,25 +74,25 @@ namespace
{
etl::u8string<120> str;
CHECK(etl::u8string<120>(STR("0")) == etl::to_string(uint8_t(0), str, true));
CHECK(etl::u8string<120>(STR("00")) == etl::to_string(uint16_t(0), str, true));
CHECK(etl::u8string<120>(STR("000")) == etl::to_string(uint32_t(0), str, true));
CHECK(etl::u8string<120>(STR("0000")) == etl::to_string(uint64_t(0), str, true));
CHECK(etl::u8string<120>(STR("0")) == etl::to_string(uint8_t(0), str, true));
CHECK(etl::u8string<120>(STR("00")) == etl::to_string(uint16_t(0), str, true));
CHECK(etl::u8string<120>(STR("000")) == etl::to_string(uint32_t(0), str, true));
CHECK(etl::u8string<120>(STR("0000")) == etl::to_string(uint64_t(0), str, true));
CHECK(etl::u8string<120>(STR("0000128")) == etl::to_string(uint8_t(128), str, true));
CHECK(etl::u8string<120>(STR("000012832768")) == etl::to_string(uint16_t(32768), str, true));
CHECK(etl::u8string<120>(STR("0000128327682147483648")) == etl::to_string(uint32_t(2147483648ul), str, true));
CHECK(etl::u8string<120>(STR("0000128")) == etl::to_string(uint8_t(128), str, true));
CHECK(etl::u8string<120>(STR("000012832768")) == etl::to_string(uint16_t(32768), str, true));
CHECK(etl::u8string<120>(STR("0000128327682147483648")) == etl::to_string(uint32_t(2147483648ul), str, true));
CHECK(etl::u8string<120>(STR("00001283276821474836489223372036854775808")) == etl::to_string(uint64_t(9223372036854775808ull), str, true));
CHECK(etl::u8string<120>(STR("00001283276821474836489223372036854775808127")) == etl::to_string(int8_t(INT8_MAX), str, true));
CHECK(etl::u8string<120>(STR("0000128327682147483648922337203685477580812732767")) == etl::to_string(int16_t(INT16_MAX), str, true));
CHECK(etl::u8string<120>(STR("00001283276821474836489223372036854775808127327672147483647")) == etl::to_string(int32_t(INT32_MAX), str, true));
CHECK(etl::u8string<120>(STR("000012832768214748364892233720368547758081273276721474836479223372036854775807")) == etl::to_string(int64_t(INT64_MAX), str, true));
CHECK(etl::u8string<120>(STR("00001283276821474836489223372036854775808127")) == etl::to_string(INT8_MAX, str, true));
CHECK(etl::u8string<120>(STR("0000128327682147483648922337203685477580812732767")) == etl::to_string(INT16_MAX, str, true));
CHECK(etl::u8string<120>(STR("00001283276821474836489223372036854775808127327672147483647")) == etl::to_string(INT32_MAX, str, true));
CHECK(etl::u8string<120>(STR("000012832768214748364892233720368547758081273276721474836479223372036854775807")) == etl::to_string(INT64_MAX, str, true));
CHECK(etl::u8string<120>(STR("000012832768214748364892233720368547758081273276721474836479223372036854775807-128")) == etl::to_string(int8_t(INT8_MIN), str, true));
CHECK(etl::u8string<120>(STR("000012832768214748364892233720368547758081273276721474836479223372036854775807-128-32768")) == etl::to_string(int16_t(INT16_MIN), str, true));
CHECK(etl::u8string<120>(STR("000012832768214748364892233720368547758081273276721474836479223372036854775807-128-32768-2147483648")) == etl::to_string(int32_t(INT32_MIN), str, true));
CHECK(etl::u8string<120>(STR("000012832768214748364892233720368547758081273276721474836479223372036854775807-128-32768-2147483648-9223372036854775808")) == etl::to_string(int64_t(INT64_MIN), str, true));
CHECK(etl::u8string<120>(STR("000012832768214748364892233720368547758081273276721474836479223372036854775807-128")) == etl::to_string(INT8_MIN, str, true));
CHECK(etl::u8string<120>(STR("000012832768214748364892233720368547758081273276721474836479223372036854775807-128-32768")) == etl::to_string(INT16_MIN, str, true));
CHECK(etl::u8string<120>(STR("000012832768214748364892233720368547758081273276721474836479223372036854775807-128-32768-2147483648")) == etl::to_string(INT32_MIN, str, true));
CHECK(etl::u8string<120>(STR("000012832768214748364892233720368547758081273276721474836479223372036854775807-128-32768-2147483648-9223372036854775808")) == etl::to_string(INT64_MIN, str, true));
}
//*************************************************************************
@ -103,7 +102,7 @@ namespace
Format format = Format().base(10).width(20).fill(STR('#'));
CHECK(etl::u8string<20>(STR("###################0")) == etl::to_string(uint8_t(0), str, format));
CHECK(etl::u8string<20>(STR("###################0")) == etl::to_string(uint8_t(0), str, format));
CHECK(etl::u8string<20>(STR("###################0")) == etl::to_string(uint16_t(0), str, format));
CHECK(etl::u8string<20>(STR("###################0")) == etl::to_string(uint32_t(0), str, format));
CHECK(etl::u8string<20>(STR("###################0")) == etl::to_string(uint64_t(0), str, format));
@ -113,15 +112,15 @@ namespace
CHECK(etl::u8string<20>(STR("##########2147483648")) == etl::to_string(uint32_t(2147483648ul), str, format));
CHECK(etl::u8string<20>(STR("#9223372036854775808")) == etl::to_string(uint64_t(9223372036854775808ull), str, format));
CHECK(etl::u8string<20>(STR("#################127")) == etl::to_string(int8_t(INT8_MAX), str, format));
CHECK(etl::u8string<20>(STR("###############32767")) == etl::to_string(int16_t(INT16_MAX), str, format));
CHECK(etl::u8string<20>(STR("##########2147483647")) == etl::to_string(int32_t(INT32_MAX), str, format));
CHECK(etl::u8string<20>(STR("#9223372036854775807")) == etl::to_string(int64_t(INT64_MAX), str, format));
CHECK(etl::u8string<20>(STR("#################127")) == etl::to_string(INT8_MAX, str, format));
CHECK(etl::u8string<20>(STR("###############32767")) == etl::to_string(INT16_MAX, str, format));
CHECK(etl::u8string<20>(STR("##########2147483647")) == etl::to_string(INT32_MAX, str, format));
CHECK(etl::u8string<20>(STR("#9223372036854775807")) == etl::to_string(INT64_MAX, str, format));
CHECK(etl::u8string<20>(STR("################-128")) == etl::to_string(int8_t(INT8_MIN), str, format));
CHECK(etl::u8string<20>(STR("##############-32768")) == etl::to_string(int16_t(INT16_MIN), str, format));
CHECK(etl::u8string<20>(STR("#########-2147483648")) == etl::to_string(int32_t(INT32_MIN), str, format));
CHECK(etl::u8string<20>(STR("-9223372036854775808")) == etl::to_string(int64_t(INT64_MIN), str, format));
CHECK(etl::u8string<20>(STR("################-128")) == etl::to_string(INT8_MIN, str, format));
CHECK(etl::u8string<20>(STR("##############-32768")) == etl::to_string(INT16_MIN, str, format));
CHECK(etl::u8string<20>(STR("#########-2147483648")) == etl::to_string(INT32_MIN, str, format));
CHECK(etl::u8string<20>(STR("-9223372036854775808")) == etl::to_string(INT64_MIN, str, format));
}
//*************************************************************************
@ -131,7 +130,7 @@ namespace
Format format = Format().base(10).width(20).fill(STR('#')).left();
CHECK(etl::u8string<20>(STR("0###################")) == etl::to_string(uint8_t(0), str, format));
CHECK(etl::u8string<20>(STR("0###################")) == etl::to_string(uint8_t(0), str, format));
CHECK(etl::u8string<20>(STR("0###################")) == etl::to_string(uint16_t(0), str, format));
CHECK(etl::u8string<20>(STR("0###################")) == etl::to_string(uint32_t(0), str, format));
CHECK(etl::u8string<20>(STR("0###################")) == etl::to_string(uint64_t(0), str, format));
@ -141,15 +140,15 @@ namespace
CHECK(etl::u8string<20>(STR("2147483648##########")) == etl::to_string(uint32_t(2147483648ul), str, format));
CHECK(etl::u8string<20>(STR("9223372036854775808#")) == etl::to_string(uint64_t(9223372036854775808ull), str, format));
CHECK(etl::u8string<20>(STR("127#################")) == etl::to_string(int8_t(INT8_MAX), str, format));
CHECK(etl::u8string<20>(STR("32767###############")) == etl::to_string(int16_t(INT16_MAX), str, format));
CHECK(etl::u8string<20>(STR("2147483647##########")) == etl::to_string(int32_t(INT32_MAX), str, format));
CHECK(etl::u8string<20>(STR("9223372036854775807#")) == etl::to_string(int64_t(INT64_MAX), str, format));
CHECK(etl::u8string<20>(STR("127#################")) == etl::to_string(INT8_MAX, str, format));
CHECK(etl::u8string<20>(STR("32767###############")) == etl::to_string(INT16_MAX, str, format));
CHECK(etl::u8string<20>(STR("2147483647##########")) == etl::to_string(INT32_MAX, str, format));
CHECK(etl::u8string<20>(STR("9223372036854775807#")) == etl::to_string(INT64_MAX, str, format));
CHECK(etl::u8string<20>(STR("-128################")) == etl::to_string(int8_t(INT8_MIN), str, format));
CHECK(etl::u8string<20>(STR("-32768##############")) == etl::to_string(int16_t(INT16_MIN), str, format));
CHECK(etl::u8string<20>(STR("-2147483648#########")) == etl::to_string(int32_t(INT32_MIN), str, format));
CHECK(etl::u8string<20>(STR("-9223372036854775808")) == etl::to_string(int64_t(INT64_MIN), str, format));
CHECK(etl::u8string<20>(STR("-128################")) == etl::to_string(INT8_MIN, str, format));
CHECK(etl::u8string<20>(STR("-32768##############")) == etl::to_string(INT16_MIN, str, format));
CHECK(etl::u8string<20>(STR("-2147483648#########")) == etl::to_string(INT32_MIN, str, format));
CHECK(etl::u8string<20>(STR("-9223372036854775808")) == etl::to_string(INT64_MIN, str, format));
}
//*************************************************************************
@ -157,25 +156,25 @@ namespace
{
etl::u8string<64> str;
CHECK(etl::u8string<64>(STR("00000000")) == etl::to_string(uint8_t(0), str, Format().base(2).width(8).fill(STR('0'))));
CHECK(etl::u8string<64>(STR("0000000000000000")) == etl::to_string(uint16_t(0), str, Format().base(2).width(16).fill(STR('0'))));
CHECK(etl::u8string<64>(STR("00000000000000000000000000000000")) == etl::to_string(uint32_t(0), str, Format().base(2).width(32).fill(STR('0'))));
CHECK(etl::u8string<64>(STR("0000000000000000000000000000000000000000000000000000000000000000")) == etl::to_string(uint64_t(0), str, Format().base(2).width(64).fill(STR('0'))));
CHECK(etl::u8string<64>(STR("00000000")) == etl::to_string(uint8_t(0), str, Format().base(2).width(8).fill(STR('0'))));
CHECK(etl::u8string<64>(STR("0000000000000000")) == etl::to_string(uint16_t(0), str, Format().base(2).width(16).fill(STR('0'))));
CHECK(etl::u8string<64>(STR("00000000000000000000000000000000")) == etl::to_string(uint32_t(0), str, Format().base(2).width(32).fill(STR('0'))));
CHECK(etl::u8string<64>(STR("0000000000000000000000000000000000000000000000000000000000000000")) == etl::to_string(uint64_t(0), str, Format().base(2).width(64).fill(STR('0'))));
CHECK(etl::u8string<64>(STR("10000000")) == etl::to_string(uint8_t(128), str, Format().base(2).width(8).fill(STR('0'))));
CHECK(etl::u8string<64>(STR("1000000000000000")) == etl::to_string(uint16_t(32768), str, Format().base(2).width(16).fill(STR('0'))));
CHECK(etl::u8string<64>(STR("10000000000000000000000000000000")) == etl::to_string(uint32_t(2147483648ul), str, Format().base(2).width(32).fill(STR('0'))));
CHECK(etl::u8string<64>(STR("1000000000000000000000000000000000000000000000000000000000000000")) == etl::to_string(uint64_t(9223372036854775808ull), str, Format().base(2).width(64).fill(STR('0'))));
CHECK(etl::u8string<64>(STR("10000000")) == etl::to_string(uint8_t(128), str, Format().base(2).width(8).fill(STR('0'))));
CHECK(etl::u8string<64>(STR("1000000000000000")) == etl::to_string(uint16_t(32768), str, Format().base(2).width(16).fill(STR('0'))));
CHECK(etl::u8string<64>(STR("10000000000000000000000000000000")) == etl::to_string(uint32_t(2147483648ul), str, Format().base(2).width(32).fill(STR('0'))));
CHECK(etl::u8string<64>(STR("1000000000000000000000000000000000000000000000000000000000000000")) == etl::to_string(uint64_t(9223372036854775808ull), str, Format().base(2).width(64).fill(STR('0'))));
CHECK(etl::u8string<64>(STR("01111111")) == etl::to_string(int8_t(INT8_MAX), str, Format().base(2).width(8).fill(STR('0'))));
CHECK(etl::u8string<64>(STR("0111111111111111")) == etl::to_string(int16_t(INT16_MAX), str, Format().base(2).width(16).fill(STR('0'))));
CHECK(etl::u8string<64>(STR("01111111111111111111111111111111")) == etl::to_string(int32_t(INT32_MAX), str, Format().base(2).width(32).fill(STR('0'))));
CHECK(etl::u8string<64>(STR("0111111111111111111111111111111111111111111111111111111111111111")) == etl::to_string(int64_t(INT64_MAX), str, Format().base(2).width(64).fill(STR('0'))));
CHECK(etl::u8string<64>(STR("01111111")) == etl::to_string(INT8_MAX, str, Format().base(2).width(8).fill(STR('0'))));
CHECK(etl::u8string<64>(STR("0111111111111111")) == etl::to_string(INT16_MAX, str, Format().base(2).width(16).fill(STR('0'))));
CHECK(etl::u8string<64>(STR("01111111111111111111111111111111")) == etl::to_string(INT32_MAX, str, Format().base(2).width(32).fill(STR('0'))));
CHECK(etl::u8string<64>(STR("0111111111111111111111111111111111111111111111111111111111111111")) == etl::to_string(INT64_MAX, str, Format().base(2).width(64).fill(STR('0'))));
CHECK(etl::u8string<64>(STR("10000000")) == etl::to_string(int8_t(INT8_MIN), str, Format().base(2).width(8).fill(STR('0'))));
CHECK(etl::u8string<64>(STR("1000000000000000")) == etl::to_string(int16_t(INT16_MIN), str, Format().base(2).width(16).fill(STR('0'))));
CHECK(etl::u8string<64>(STR("10000000000000000000000000000000")) == etl::to_string(int32_t(INT32_MIN), str, Format().base(2).width(32).fill(STR('0'))));
CHECK(etl::u8string<64>(STR("1000000000000000000000000000000000000000000000000000000000000000")) == etl::to_string(int64_t(INT64_MIN), str, Format().base(2).width(64).fill(STR('0'))));
CHECK(etl::u8string<64>(STR("10000000")) == etl::to_string(INT8_MIN, str, Format().base(2).width(8).fill(STR('0'))));
CHECK(etl::u8string<64>(STR("1000000000000000")) == etl::to_string(INT16_MIN, str, Format().base(2).width(16).fill(STR('0'))));
CHECK(etl::u8string<64>(STR("10000000000000000000000000000000")) == etl::to_string(INT32_MIN, str, Format().base(2).width(32).fill(STR('0'))));
CHECK(etl::u8string<64>(STR("1000000000000000000000000000000000000000000000000000000000000000")) == etl::to_string(INT64_MIN, str, Format().base(2).width(64).fill(STR('0'))));
}
//*************************************************************************
@ -183,25 +182,25 @@ namespace
{
etl::u8string<22> str;
CHECK(etl::u8string<22>(STR("000")) == etl::to_string(uint8_t(0), str, Format().base(8).width(3).fill(STR('0'))));
CHECK(etl::u8string<22>(STR("000000")) == etl::to_string(uint16_t(0), str, Format().base(8).width(6).fill(STR('0'))));
CHECK(etl::u8string<22>(STR("00000000000")) == etl::to_string(uint32_t(0), str, Format().base(8).width(11).fill(STR('0'))));
CHECK(etl::u8string<22>(STR("000")) == etl::to_string(uint8_t(0), str, Format().base(8).width(3).fill(STR('0'))));
CHECK(etl::u8string<22>(STR("000000")) == etl::to_string(uint16_t(0), str, Format().base(8).width(6).fill(STR('0'))));
CHECK(etl::u8string<22>(STR("00000000000")) == etl::to_string(uint32_t(0), str, Format().base(8).width(11).fill(STR('0'))));
CHECK(etl::u8string<22>(STR("0000000000000000000000")) == etl::to_string(uint64_t(0), str, Format().base(8).width(22).fill(STR('0'))));
CHECK(etl::u8string<22>(STR("200")) == etl::to_string(uint8_t(128), str, Format().base(8).width(3).fill(STR('0'))));
CHECK(etl::u8string<22>(STR("100000")) == etl::to_string(uint16_t(32768), str, Format().base(8).width(6).fill(STR('0'))));
CHECK(etl::u8string<22>(STR("20000000000")) == etl::to_string(uint32_t(2147483648ul), str, Format().base(8).width(11).fill(STR('0'))));
CHECK(etl::u8string<22>(STR("200")) == etl::to_string(uint8_t(128), str, Format().base(8).width(3).fill(STR('0'))));
CHECK(etl::u8string<22>(STR("100000")) == etl::to_string(uint16_t(32768), str, Format().base(8).width(6).fill(STR('0'))));
CHECK(etl::u8string<22>(STR("20000000000")) == etl::to_string(uint32_t(2147483648ul), str, Format().base(8).width(11).fill(STR('0'))));
CHECK(etl::u8string<22>(STR("1000000000000000000000")) == etl::to_string(uint64_t(9223372036854775808ull), str, Format().base(8).width(22).fill(STR('0'))));
CHECK(etl::u8string<22>(STR("177")) == etl::to_string(int8_t(INT8_MAX), str, Format().base(8).width(3).fill(STR('0'))));
CHECK(etl::u8string<22>(STR("077777")) == etl::to_string(int16_t(INT16_MAX), str, Format().base(8).width(6).fill(STR('0'))));
CHECK(etl::u8string<22>(STR("17777777777")) == etl::to_string(int32_t(INT32_MAX), str, Format().base(8).width(11).fill(STR('0'))));
CHECK(etl::u8string<22>(STR("0777777777777777777777")) == etl::to_string(int64_t(INT64_MAX), str, Format().base(8).width(22).fill(STR('0'))));
CHECK(etl::u8string<22>(STR("177")) == etl::to_string(INT8_MAX, str, Format().base(8).width(3).fill(STR('0'))));
CHECK(etl::u8string<22>(STR("077777")) == etl::to_string(INT16_MAX, str, Format().base(8).width(6).fill(STR('0'))));
CHECK(etl::u8string<22>(STR("17777777777")) == etl::to_string(INT32_MAX, str, Format().base(8).width(11).fill(STR('0'))));
CHECK(etl::u8string<22>(STR("0777777777777777777777")) == etl::to_string(INT64_MAX, str, Format().base(8).width(22).fill(STR('0'))));
CHECK(etl::u8string<22>(STR("200")) == etl::to_string(int8_t(INT8_MIN), str, Format().base(8).width(3).fill(STR('0'))));
CHECK(etl::u8string<22>(STR("100000")) == etl::to_string(int16_t(INT16_MIN), str, Format().base(8).width(6).fill(STR('0'))));
CHECK(etl::u8string<22>(STR("20000000000")) == etl::to_string(int32_t(INT32_MIN), str, Format().base(8).width(11).fill(STR('0'))));
CHECK(etl::u8string<22>(STR("1000000000000000000000")) == etl::to_string(int64_t(INT64_MIN), str, Format().base(8).width(22).fill(STR('0'))));
CHECK(etl::u8string<22>(STR("200")) == etl::to_string(INT8_MIN, str, Format().base(8).width(3).fill(STR('0'))));
CHECK(etl::u8string<22>(STR("100000")) == etl::to_string(INT16_MIN, str, Format().base(8).width(6).fill(STR('0'))));
CHECK(etl::u8string<22>(STR("20000000000")) == etl::to_string(INT32_MIN, str, Format().base(8).width(11).fill(STR('0'))));
CHECK(etl::u8string<22>(STR("1000000000000000000000")) == etl::to_string(INT64_MIN, str, Format().base(8).width(22).fill(STR('0'))));
}
//*************************************************************************
@ -209,25 +208,25 @@ namespace
{
etl::u8string<16> str;
CHECK(etl::u8string<16>(STR("00")) == etl::to_string(uint8_t(0), str, Format().base(16).width(2).fill(STR('0'))));
CHECK(etl::u8string<16>(STR("0000")) == etl::to_string(uint16_t(0), str, Format().base(16).width(4).fill(STR('0'))));
CHECK(etl::u8string<16>(STR("00000000")) == etl::to_string(uint32_t(0), str, Format().base(16).width(8).fill(STR('0'))));
CHECK(etl::u8string<16>(STR("00")) == etl::to_string(uint8_t(0), str, Format().base(16).width(2).fill(STR('0'))));
CHECK(etl::u8string<16>(STR("0000")) == etl::to_string(uint16_t(0), str, Format().base(16).width(4).fill(STR('0'))));
CHECK(etl::u8string<16>(STR("00000000")) == etl::to_string(uint32_t(0), str, Format().base(16).width(8).fill(STR('0'))));
CHECK(etl::u8string<16>(STR("0000000000000000")) == etl::to_string(uint64_t(0), str, Format().base(16).width(16).fill(STR('0'))));
CHECK(etl::u8string<16>(STR("80")) == etl::to_string(uint8_t(128), str, Format().base(16).width(2).fill(STR('0'))));
CHECK(etl::u8string<16>(STR("8000")) == etl::to_string(uint16_t(32768), str, Format().base(16).width(4).fill(STR('0'))));
CHECK(etl::u8string<16>(STR("80000000")) == etl::to_string(uint32_t(2147483648ul), str, Format().base(16).width(8).fill(STR('0'))));
CHECK(etl::u8string<16>(STR("80")) == etl::to_string(uint8_t(128), str, Format().base(16).width(2).fill(STR('0'))));
CHECK(etl::u8string<16>(STR("8000")) == etl::to_string(uint16_t(32768), str, Format().base(16).width(4).fill(STR('0'))));
CHECK(etl::u8string<16>(STR("80000000")) == etl::to_string(uint32_t(2147483648ul), str, Format().base(16).width(8).fill(STR('0'))));
CHECK(etl::u8string<16>(STR("8000000000000000")) == etl::to_string(uint64_t(9223372036854775808ull), str, Format().base(16).width(16).fill(STR('0'))));
CHECK(etl::u8string<16>(STR("7f")) == etl::to_string(int8_t(INT8_MAX), str, Format().base(16).width(2).fill(STR('0'))));
CHECK(etl::u8string<16>(STR("7fff")) == etl::to_string(int16_t(INT16_MAX), str, Format().base(16).width(4).fill(STR('0'))));
CHECK(etl::u8string<16>(STR("7fffffff")) == etl::to_string(int32_t(INT32_MAX), str, Format().base(16).width(8).fill(STR('0'))));
CHECK(etl::u8string<16>(STR("7fffffffffffffff")) == etl::to_string(int64_t(INT64_MAX), str, Format().base(16).width(16).fill(STR('0'))));
CHECK(etl::u8string<16>(STR("7f")) == etl::to_string(INT8_MAX, str, Format().base(16).width(2).fill(STR('0'))));
CHECK(etl::u8string<16>(STR("7fff")) == etl::to_string(INT16_MAX, str, Format().base(16).width(4).fill(STR('0'))));
CHECK(etl::u8string<16>(STR("7fffffff")) == etl::to_string(INT32_MAX, str, Format().base(16).width(8).fill(STR('0'))));
CHECK(etl::u8string<16>(STR("7fffffffffffffff")) == etl::to_string(INT64_MAX, str, Format().base(16).width(16).fill(STR('0'))));
CHECK(etl::u8string<16>(STR("80")) == etl::to_string(int8_t(INT8_MIN), str, Format().base(16).width(2).fill(STR('0'))));
CHECK(etl::u8string<16>(STR("8000")) == etl::to_string(int16_t(INT16_MIN), str, Format().base(16).width(4).fill(STR('0'))));
CHECK(etl::u8string<16>(STR("80000000")) == etl::to_string(int32_t(INT32_MIN), str, Format().base(16).width(8).fill(STR('0'))));
CHECK(etl::u8string<16>(STR("8000000000000000")) == etl::to_string(int64_t(INT64_MIN), str, Format().base(16).width(16).fill(STR('0'))));
CHECK(etl::u8string<16>(STR("80")) == etl::to_string(INT8_MIN, str, Format().base(16).width(2).fill(STR('0'))));
CHECK(etl::u8string<16>(STR("8000")) == etl::to_string(INT16_MIN, str, Format().base(16).width(4).fill(STR('0'))));
CHECK(etl::u8string<16>(STR("80000000")) == etl::to_string(INT32_MIN, str, Format().base(16).width(8).fill(STR('0'))));
CHECK(etl::u8string<16>(STR("8000000000000000")) == etl::to_string(INT64_MIN, str, Format().base(16).width(16).fill(STR('0'))));
}
//*************************************************************************
@ -235,10 +234,10 @@ namespace
{
etl::u8string<17> str;
CHECK(etl::u8string<17>(STR("11110001001000000")) == etl::to_string(123456, str, Format().binary()));
CHECK(etl::u8string<17>(STR("361100")) == etl::to_string(123456, str, Format().octal()));
CHECK(etl::u8string<17>(STR("123456")) == etl::to_string(123456, str, Format().decimal()));
CHECK(etl::u8string<17>(STR("1e240")) == etl::to_string(123456, str, Format().hex()));
CHECK(etl::u8string<17>(STR("11110001001000000")) == etl::to_string(123456, str, Format().binary()));
CHECK(etl::u8string<17>(STR("361100")) == etl::to_string(123456, str, Format().octal()));
CHECK(etl::u8string<17>(STR("123456")) == etl::to_string(123456, str, Format().decimal()));
CHECK(etl::u8string<17>(STR("1e240")) == etl::to_string(123456, str, Format().hex()));
}
//*************************************************************************
@ -295,15 +294,15 @@ namespace
etl::u8string<20> str;
CHECK(etl::u8string<20>(STR("0.00001")) == etl::to_string(0.000009, str, Format().precision(5).width(7).right()));
CHECK(etl::u8string<20>(STR("0.0001")) == etl::to_string(0.000099, str, Format().precision(4).width(6).right()));
CHECK(etl::u8string<20>(STR("0.001")) == etl::to_string(0.000999, str, Format().precision(3).width(5).right()));
CHECK(etl::u8string<20>(STR("0.01")) == etl::to_string(0.009999, str, Format().precision(2).width(4).right()));
CHECK(etl::u8string<20>(STR("0.1")) == etl::to_string(0.099999, str, Format().precision(1).width(3).right()));
CHECK(etl::u8string<20>(STR("1.0")) == etl::to_string(0.999999, str, Format().precision(1).width(3).right()));
CHECK(etl::u8string<20>(STR("1")) == etl::to_string(0.999999, str, Format().precision(0).width(1).right()));
CHECK(etl::u8string<20>(STR("2")) == etl::to_string(1.999999, str, Format().precision(0).width(1).right()));
CHECK(etl::u8string<20>(STR("10.0")) == etl::to_string(9.999999, str, Format().precision(1).width(4).right()));
CHECK(etl::u8string<20>(STR("20.0")) == etl::to_string(19.999999, str, Format().precision(1).width(4).right()));
CHECK(etl::u8string<20>(STR("0.0001")) == etl::to_string(0.000099, str, Format().precision(4).width(6).right()));
CHECK(etl::u8string<20>(STR("0.001")) == etl::to_string(0.000999, str, Format().precision(3).width(5).right()));
CHECK(etl::u8string<20>(STR("0.01")) == etl::to_string(0.009999, str, Format().precision(2).width(4).right()));
CHECK(etl::u8string<20>(STR("0.1")) == etl::to_string(0.099999, str, Format().precision(1).width(3).right()));
CHECK(etl::u8string<20>(STR("1.0")) == etl::to_string(0.999999, str, Format().precision(1).width(3).right()));
CHECK(etl::u8string<20>(STR("1")) == etl::to_string(0.999999, str, Format().precision(0).width(1).right()));
CHECK(etl::u8string<20>(STR("2")) == etl::to_string(1.999999, str, Format().precision(0).width(1).right()));
CHECK(etl::u8string<20>(STR("10.0")) == etl::to_string(9.999999, str, Format().precision(1).width(4).right()));
CHECK(etl::u8string<20>(STR("20.0")) == etl::to_string(19.999999, str, Format().precision(1).width(4).right()));
}
//*************************************************************************

View File

@ -60,15 +60,15 @@ namespace
CHECK(etl::wstring<20>(STR("2147483648")) == etl::to_string(uint32_t(2147483648ul), str));
CHECK(etl::wstring<20>(STR("9223372036854775808")) == etl::to_string(uint64_t(9223372036854775808ull), str));
CHECK(etl::wstring<20>(STR("127")) == etl::to_string(int8_t(INT8_MAX), str));
CHECK(etl::wstring<20>(STR("32767")) == etl::to_string(int16_t(INT16_MAX), str));
CHECK(etl::wstring<20>(STR("2147483647")) == etl::to_string(int32_t(INT32_MAX), str));
CHECK(etl::wstring<20>(STR("9223372036854775807")) == etl::to_string(int64_t(INT64_MAX), str));
CHECK(etl::wstring<20>(STR("127")) == etl::to_string(INT8_MAX, str));
CHECK(etl::wstring<20>(STR("32767")) == etl::to_string(INT16_MAX, str));
CHECK(etl::wstring<20>(STR("2147483647")) == etl::to_string(INT32_MAX, str));
CHECK(etl::wstring<20>(STR("9223372036854775807")) == etl::to_string(INT64_MAX, str));
CHECK(etl::wstring<20>(STR("-128")) == etl::to_string(int8_t(INT8_MIN), str));
CHECK(etl::wstring<20>(STR("-32768")) == etl::to_string(int16_t(INT16_MIN), str));
CHECK(etl::wstring<20>(STR("-2147483648")) == etl::to_string(int32_t(INT32_MIN), str));
CHECK(etl::wstring<20>(STR("-9223372036854775808")) == etl::to_string(int64_t(INT64_MIN), str));
CHECK(etl::wstring<20>(STR("-128")) == etl::to_string(INT8_MIN, str));
CHECK(etl::wstring<20>(STR("-32768")) == etl::to_string(INT16_MIN, str));
CHECK(etl::wstring<20>(STR("-2147483648")) == etl::to_string(INT32_MIN, str));
CHECK(etl::wstring<20>(STR("-9223372036854775808")) == etl::to_string(INT64_MIN, str));
}
//*************************************************************************
@ -86,15 +86,15 @@ namespace
CHECK(etl::wstring<120>(STR("0000128327682147483648")) == etl::to_string(uint32_t(2147483648ul), str, true));
CHECK(etl::wstring<120>(STR("00001283276821474836489223372036854775808")) == etl::to_string(uint64_t(9223372036854775808ull), str, true));
CHECK(etl::wstring<120>(STR("00001283276821474836489223372036854775808127")) == etl::to_string(int8_t(INT8_MAX), str, true));
CHECK(etl::wstring<120>(STR("0000128327682147483648922337203685477580812732767")) == etl::to_string(int16_t(INT16_MAX), str, true));
CHECK(etl::wstring<120>(STR("00001283276821474836489223372036854775808127327672147483647")) == etl::to_string(int32_t(INT32_MAX), str, true));
CHECK(etl::wstring<120>(STR("000012832768214748364892233720368547758081273276721474836479223372036854775807")) == etl::to_string(int64_t(INT64_MAX), str, true));
CHECK(etl::wstring<120>(STR("00001283276821474836489223372036854775808127")) == etl::to_string(INT8_MAX, str, true));
CHECK(etl::wstring<120>(STR("0000128327682147483648922337203685477580812732767")) == etl::to_string(INT16_MAX, str, true));
CHECK(etl::wstring<120>(STR("00001283276821474836489223372036854775808127327672147483647")) == etl::to_string(INT32_MAX, str, true));
CHECK(etl::wstring<120>(STR("000012832768214748364892233720368547758081273276721474836479223372036854775807")) == etl::to_string(INT64_MAX, str, true));
CHECK(etl::wstring<120>(STR("000012832768214748364892233720368547758081273276721474836479223372036854775807-128")) == etl::to_string(int8_t(INT8_MIN), str, true));
CHECK(etl::wstring<120>(STR("000012832768214748364892233720368547758081273276721474836479223372036854775807-128-32768")) == etl::to_string(int16_t(INT16_MIN), str, true));
CHECK(etl::wstring<120>(STR("000012832768214748364892233720368547758081273276721474836479223372036854775807-128-32768-2147483648")) == etl::to_string(int32_t(INT32_MIN), str, true));
CHECK(etl::wstring<120>(STR("000012832768214748364892233720368547758081273276721474836479223372036854775807-128-32768-2147483648-9223372036854775808")) == etl::to_string(int64_t(INT64_MIN), str, true));
CHECK(etl::wstring<120>(STR("000012832768214748364892233720368547758081273276721474836479223372036854775807-128")) == etl::to_string(INT8_MIN, str, true));
CHECK(etl::wstring<120>(STR("000012832768214748364892233720368547758081273276721474836479223372036854775807-128-32768")) == etl::to_string(INT16_MIN, str, true));
CHECK(etl::wstring<120>(STR("000012832768214748364892233720368547758081273276721474836479223372036854775807-128-32768-2147483648")) == etl::to_string(INT32_MIN, str, true));
CHECK(etl::wstring<120>(STR("000012832768214748364892233720368547758081273276721474836479223372036854775807-128-32768-2147483648-9223372036854775808")) == etl::to_string(INT64_MIN, str, true));
}
//*************************************************************************
@ -114,15 +114,15 @@ namespace
CHECK(etl::wstring<20>(STR("##########2147483648")) == etl::to_string(uint32_t(2147483648ul), str, format));
CHECK(etl::wstring<20>(STR("#9223372036854775808")) == etl::to_string(uint64_t(9223372036854775808ull), str, format));
CHECK(etl::wstring<20>(STR("#################127")) == etl::to_string(int8_t(INT8_MAX), str, format));
CHECK(etl::wstring<20>(STR("###############32767")) == etl::to_string(int16_t(INT16_MAX), str, format));
CHECK(etl::wstring<20>(STR("##########2147483647")) == etl::to_string(int32_t(INT32_MAX), str, format));
CHECK(etl::wstring<20>(STR("#9223372036854775807")) == etl::to_string(int64_t(INT64_MAX), str, format));
CHECK(etl::wstring<20>(STR("#################127")) == etl::to_string(INT8_MAX, str, format));
CHECK(etl::wstring<20>(STR("###############32767")) == etl::to_string(INT16_MAX, str, format));
CHECK(etl::wstring<20>(STR("##########2147483647")) == etl::to_string(INT32_MAX, str, format));
CHECK(etl::wstring<20>(STR("#9223372036854775807")) == etl::to_string(INT64_MAX, str, format));
CHECK(etl::wstring<20>(STR("################-128")) == etl::to_string(int8_t(INT8_MIN), str, format));
CHECK(etl::wstring<20>(STR("##############-32768")) == etl::to_string(int16_t(INT16_MIN), str, format));
CHECK(etl::wstring<20>(STR("#########-2147483648")) == etl::to_string(int32_t(INT32_MIN), str, format));
CHECK(etl::wstring<20>(STR("-9223372036854775808")) == etl::to_string(int64_t(INT64_MIN), str, format));
CHECK(etl::wstring<20>(STR("################-128")) == etl::to_string(INT8_MIN, str, format));
CHECK(etl::wstring<20>(STR("##############-32768")) == etl::to_string(INT16_MIN, str, format));
CHECK(etl::wstring<20>(STR("#########-2147483648")) == etl::to_string(INT32_MIN, str, format));
CHECK(etl::wstring<20>(STR("-9223372036854775808")) == etl::to_string(INT64_MIN, str, format));
}
//*************************************************************************
@ -142,15 +142,15 @@ namespace
CHECK(etl::wstring<20>(STR("2147483648##########")) == etl::to_string(uint32_t(2147483648ul), str, format));
CHECK(etl::wstring<20>(STR("9223372036854775808#")) == etl::to_string(uint64_t(9223372036854775808ull), str, format));
CHECK(etl::wstring<20>(STR("127#################")) == etl::to_string(int8_t(INT8_MAX), str, format));
CHECK(etl::wstring<20>(STR("32767###############")) == etl::to_string(int16_t(INT16_MAX), str, format));
CHECK(etl::wstring<20>(STR("2147483647##########")) == etl::to_string(int32_t(INT32_MAX), str, format));
CHECK(etl::wstring<20>(STR("9223372036854775807#")) == etl::to_string(int64_t(INT64_MAX), str, format));
CHECK(etl::wstring<20>(STR("127#################")) == etl::to_string(INT8_MAX, str, format));
CHECK(etl::wstring<20>(STR("32767###############")) == etl::to_string(INT16_MAX, str, format));
CHECK(etl::wstring<20>(STR("2147483647##########")) == etl::to_string(INT32_MAX, str, format));
CHECK(etl::wstring<20>(STR("9223372036854775807#")) == etl::to_string(INT64_MAX, str, format));
CHECK(etl::wstring<20>(STR("-128################")) == etl::to_string(int8_t(INT8_MIN), str, format));
CHECK(etl::wstring<20>(STR("-32768##############")) == etl::to_string(int16_t(INT16_MIN), str, format));
CHECK(etl::wstring<20>(STR("-2147483648#########")) == etl::to_string(int32_t(INT32_MIN), str, format));
CHECK(etl::wstring<20>(STR("-9223372036854775808")) == etl::to_string(int64_t(INT64_MIN), str, format));
CHECK(etl::wstring<20>(STR("-128################")) == etl::to_string(INT8_MIN, str, format));
CHECK(etl::wstring<20>(STR("-32768##############")) == etl::to_string(INT16_MIN, str, format));
CHECK(etl::wstring<20>(STR("-2147483648#########")) == etl::to_string(INT32_MIN, str, format));
CHECK(etl::wstring<20>(STR("-9223372036854775808")) == etl::to_string(INT64_MIN, str, format));
}
//*************************************************************************
@ -168,15 +168,15 @@ namespace
CHECK(etl::wstring<64>(STR("10000000000000000000000000000000")) == etl::to_string(uint32_t(2147483648ul), str, Format().base(2).width(32).fill(STR('0'))));
CHECK(etl::wstring<64>(STR("1000000000000000000000000000000000000000000000000000000000000000")) == etl::to_string(uint64_t(9223372036854775808ull), str, Format().base(2).width(64).fill(STR('0'))));
CHECK(etl::wstring<64>(STR("01111111")) == etl::to_string(int8_t(INT8_MAX), str, Format().base(2).width(8).fill(STR('0'))));
CHECK(etl::wstring<64>(STR("0111111111111111")) == etl::to_string(int16_t(INT16_MAX), str, Format().base(2).width(16).fill(STR('0'))));
CHECK(etl::wstring<64>(STR("01111111111111111111111111111111")) == etl::to_string(int32_t(INT32_MAX), str, Format().base(2).width(32).fill(STR('0'))));
CHECK(etl::wstring<64>(STR("0111111111111111111111111111111111111111111111111111111111111111")) == etl::to_string(int64_t(INT64_MAX), str, Format().base(2).width(64).fill(STR('0'))));
CHECK(etl::wstring<64>(STR("01111111")) == etl::to_string(INT8_MAX, str, Format().base(2).width(8).fill(STR('0'))));
CHECK(etl::wstring<64>(STR("0111111111111111")) == etl::to_string(INT16_MAX, str, Format().base(2).width(16).fill(STR('0'))));
CHECK(etl::wstring<64>(STR("01111111111111111111111111111111")) == etl::to_string(INT32_MAX, str, Format().base(2).width(32).fill(STR('0'))));
CHECK(etl::wstring<64>(STR("0111111111111111111111111111111111111111111111111111111111111111")) == etl::to_string(INT64_MAX, str, Format().base(2).width(64).fill(STR('0'))));
CHECK(etl::wstring<64>(STR("10000000")) == etl::to_string(int8_t(INT8_MIN), str, Format().base(2).width(8).fill(STR('0'))));
CHECK(etl::wstring<64>(STR("1000000000000000")) == etl::to_string(int16_t(INT16_MIN), str, Format().base(2).width(16).fill(STR('0'))));
CHECK(etl::wstring<64>(STR("10000000000000000000000000000000")) == etl::to_string(int32_t(INT32_MIN), str, Format().base(2).width(32).fill(STR('0'))));
CHECK(etl::wstring<64>(STR("1000000000000000000000000000000000000000000000000000000000000000")) == etl::to_string(int64_t(INT64_MIN), str, Format().base(2).width(64).fill(STR('0'))));
CHECK(etl::wstring<64>(STR("10000000")) == etl::to_string(INT8_MIN, str, Format().base(2).width(8).fill(STR('0'))));
CHECK(etl::wstring<64>(STR("1000000000000000")) == etl::to_string(INT16_MIN, str, Format().base(2).width(16).fill(STR('0'))));
CHECK(etl::wstring<64>(STR("10000000000000000000000000000000")) == etl::to_string(INT32_MIN, str, Format().base(2).width(32).fill(STR('0'))));
CHECK(etl::wstring<64>(STR("1000000000000000000000000000000000000000000000000000000000000000")) == etl::to_string(INT64_MIN, str, Format().base(2).width(64).fill(STR('0'))));
}
//*************************************************************************
@ -194,15 +194,15 @@ namespace
CHECK(etl::wstring<22>(STR("20000000000")) == etl::to_string(uint32_t(2147483648ul), str, Format().base(8).width(11).fill(STR('0'))));
CHECK(etl::wstring<22>(STR("1000000000000000000000")) == etl::to_string(uint64_t(9223372036854775808ull), str, Format().base(8).width(22).fill(STR('0'))));
CHECK(etl::wstring<22>(STR("177")) == etl::to_string(int8_t(INT8_MAX), str, Format().base(8).width(3).fill(STR('0'))));
CHECK(etl::wstring<22>(STR("077777")) == etl::to_string(int16_t(INT16_MAX), str, Format().base(8).width(6).fill(STR('0'))));
CHECK(etl::wstring<22>(STR("17777777777")) == etl::to_string(int32_t(INT32_MAX), str, Format().base(8).width(11).fill(STR('0'))));
CHECK(etl::wstring<22>(STR("0777777777777777777777")) == etl::to_string(int64_t(INT64_MAX), str, Format().base(8).width(22).fill(STR('0'))));
CHECK(etl::wstring<22>(STR("177")) == etl::to_string(INT8_MAX, str, Format().base(8).width(3).fill(STR('0'))));
CHECK(etl::wstring<22>(STR("077777")) == etl::to_string(INT16_MAX, str, Format().base(8).width(6).fill(STR('0'))));
CHECK(etl::wstring<22>(STR("17777777777")) == etl::to_string(INT32_MAX, str, Format().base(8).width(11).fill(STR('0'))));
CHECK(etl::wstring<22>(STR("0777777777777777777777")) == etl::to_string(INT64_MAX, str, Format().base(8).width(22).fill(STR('0'))));
CHECK(etl::wstring<22>(STR("200")) == etl::to_string(int8_t(INT8_MIN), str, Format().base(8).width(3).fill(STR('0'))));
CHECK(etl::wstring<22>(STR("100000")) == etl::to_string(int16_t(INT16_MIN), str, Format().base(8).width(6).fill(STR('0'))));
CHECK(etl::wstring<22>(STR("20000000000")) == etl::to_string(int32_t(INT32_MIN), str, Format().base(8).width(11).fill(STR('0'))));
CHECK(etl::wstring<22>(STR("1000000000000000000000")) == etl::to_string(int64_t(INT64_MIN), str, Format().base(8).width(22).fill(STR('0'))));
CHECK(etl::wstring<22>(STR("200")) == etl::to_string(INT8_MIN, str, Format().base(8).width(3).fill(STR('0'))));
CHECK(etl::wstring<22>(STR("100000")) == etl::to_string(INT16_MIN, str, Format().base(8).width(6).fill(STR('0'))));
CHECK(etl::wstring<22>(STR("20000000000")) == etl::to_string(INT32_MIN, str, Format().base(8).width(11).fill(STR('0'))));
CHECK(etl::wstring<22>(STR("1000000000000000000000")) == etl::to_string(INT64_MIN, str, Format().base(8).width(22).fill(STR('0'))));
}
//*************************************************************************
@ -220,15 +220,15 @@ namespace
CHECK(etl::wstring<16>(STR("80000000")) == etl::to_string(uint32_t(2147483648ul), str, Format().base(16).width(8).fill(STR('0'))));
CHECK(etl::wstring<16>(STR("8000000000000000")) == etl::to_string(uint64_t(9223372036854775808ull), str, Format().base(16).width(16).fill(STR('0'))));
CHECK(etl::wstring<16>(STR("7f")) == etl::to_string(int8_t(INT8_MAX), str, Format().base(16).width(2).fill(STR('0'))));
CHECK(etl::wstring<16>(STR("7fff")) == etl::to_string(int16_t(INT16_MAX), str, Format().base(16).width(4).fill(STR('0'))));
CHECK(etl::wstring<16>(STR("7fffffff")) == etl::to_string(int32_t(INT32_MAX), str, Format().base(16).width(8).fill(STR('0'))));
CHECK(etl::wstring<16>(STR("7fffffffffffffff")) == etl::to_string(int64_t(INT64_MAX), str, Format().base(16).width(16).fill(STR('0'))));
CHECK(etl::wstring<16>(STR("7f")) == etl::to_string(INT8_MAX, str, Format().base(16).width(2).fill(STR('0'))));
CHECK(etl::wstring<16>(STR("7fff")) == etl::to_string(INT16_MAX, str, Format().base(16).width(4).fill(STR('0'))));
CHECK(etl::wstring<16>(STR("7fffffff")) == etl::to_string(INT32_MAX, str, Format().base(16).width(8).fill(STR('0'))));
CHECK(etl::wstring<16>(STR("7fffffffffffffff")) == etl::to_string(INT64_MAX, str, Format().base(16).width(16).fill(STR('0'))));
CHECK(etl::wstring<16>(STR("80")) == etl::to_string(int8_t(INT8_MIN), str, Format().base(16).width(2).fill(STR('0'))));
CHECK(etl::wstring<16>(STR("8000")) == etl::to_string(int16_t(INT16_MIN), str, Format().base(16).width(4).fill(STR('0'))));
CHECK(etl::wstring<16>(STR("80000000")) == etl::to_string(int32_t(INT32_MIN), str, Format().base(16).width(8).fill(STR('0'))));
CHECK(etl::wstring<16>(STR("8000000000000000")) == etl::to_string(int64_t(INT64_MIN), str, Format().base(16).width(16).fill(STR('0'))));
CHECK(etl::wstring<16>(STR("80")) == etl::to_string(INT8_MIN, str, Format().base(16).width(2).fill(STR('0'))));
CHECK(etl::wstring<16>(STR("8000")) == etl::to_string(INT16_MIN, str, Format().base(16).width(4).fill(STR('0'))));
CHECK(etl::wstring<16>(STR("80000000")) == etl::to_string(INT32_MIN, str, Format().base(16).width(8).fill(STR('0'))));
CHECK(etl::wstring<16>(STR("8000000000000000")) == etl::to_string(INT64_MIN, str, Format().base(16).width(16).fill(STR('0'))));
}
//*************************************************************************

View File

@ -32,6 +32,8 @@ SOFTWARE.
#include <type_traits>
#include "etl/private/diagnostic_useless_cast_push.h"
namespace
{
//***********************************
@ -425,3 +427,5 @@ namespace
#endif
};
}
#include "etl/private/diagnostic_pop.h"

View File

@ -31,6 +31,8 @@ SOFTWARE.
#include "etl/unaligned_type.h"
#include "etl/integral_limits.h"
#include "etl/private/diagnostic_useless_cast_push.h"
namespace
{
SUITE(test_unaligned_type)
@ -620,23 +622,23 @@ namespace
CHECK_EQUAL(int(0x34), int(*itr));
++itr;
*itr = 0x12;
CHECK_EQUAL(int(0x12), int(*itr));
CHECK_EQUAL(0x12, *itr);
++itr;
CHECK(itr == test.end());
//*******************************
citr = const_test.begin();
CHECK_EQUAL(int(0x12), int(*citr));
CHECK_EQUAL(0x12, *citr);
++citr;
CHECK_EQUAL(int(0x34), int(*citr));
CHECK_EQUAL(0x34, *citr);
++citr;
CHECK(citr == const_test.end());
//*******************************
citr = const_test.cbegin();
CHECK_EQUAL(int(0x12), int(*citr));
CHECK_EQUAL(0x12, *citr);
++citr;
CHECK_EQUAL(int(0x34), int(*citr));
CHECK_EQUAL(0x34, *citr);
++citr;
CHECK(citr == const_test.cend());
}
@ -655,35 +657,35 @@ namespace
//*******************************
itr = test.rbegin();
CHECK_EQUAL(int(0x34), int(*itr));
CHECK_EQUAL(0x34, *itr);
++itr;
CHECK_EQUAL(int(0x12), int(*itr));
CHECK_EQUAL(0x12, *itr);
++itr;
CHECK(itr == test.rend());
//*******************************
itr = test.rbegin();
*itr = 0x12;
CHECK_EQUAL(int(0x12), int(*itr));
CHECK_EQUAL(0x12, *itr);
++itr;
*itr = 0x34;
CHECK_EQUAL(int(0x34), int(*itr));
CHECK_EQUAL(0x34, *itr);
++itr;
CHECK(itr == test.rend());
//*******************************
citr = const_test.rbegin();
CHECK_EQUAL(int(0x34), int(*citr));
CHECK_EQUAL(0x34, *citr);
++citr;
CHECK_EQUAL(int(0x12), int(*citr));
CHECK_EQUAL(0x12, *citr);
++citr;
CHECK(citr == const_test.rend());
//*******************************
citr = const_test.crbegin();
CHECK_EQUAL(int(0x34), int(*citr));
CHECK_EQUAL(0x34, *citr);
++citr;
CHECK_EQUAL(int(0x12), int(*citr));
CHECK_EQUAL(0x12, *citr);
++citr;
CHECK(citr == const_test.crend());
}
@ -780,3 +782,5 @@ namespace
}
};
}
#include "etl/private/diagnostic_pop.h"

View File

@ -33,6 +33,8 @@ SOFTWARE.
#if ETL_USING_CPP14
#include "etl/private/diagnostic_useless_cast_push.h"
namespace
{
SUITE(test_unaligned_type_constexpr)
@ -641,4 +643,8 @@ namespace
};
}
#include "etl/private/diagnostic_pop.h"
#endif

View File

@ -35,6 +35,8 @@ SOFTWARE.
#include <algorithm>
#include <string>
#include "etl/private/diagnostic_useless_cast_push.h"
namespace
{
// Test classes for polymorphic tests.
@ -690,9 +692,11 @@ namespace
ui16 = variant8;
CHECK_EQUAL(ui16, variant8.get<uint16_t>());
#include "etl/private/diagnostic_useless_cast_push.h"
variant8 = int32_t(5);
i32 = variant8;
CHECK_EQUAL(i32, variant8.get<int32_t>());
#include "etl/private/diagnostic_pop.h"
variant8 = uint32_t(6);
ui32 = variant8;
@ -931,3 +935,5 @@ namespace
}
};
}
#include "etl/private/diagnostic_pop.h"

View File

@ -44,6 +44,8 @@ SOFTWARE.
#include <variant>
#endif
#include "etl/private/diagnostic_useless_cast_push.h"
namespace
{
// Test variant_etl types.
@ -1378,7 +1380,9 @@ namespace
CHECK(etl::get_if<int>(&variant_etl) == nullptr);
CHECK(etl::get_if<std::string>(&variant_etl) == nullptr);
#include "etl/private/diagnostic_useless_cast_push.h"
variant_etl = int(2);
#include "etl/private/diagnostic_pop.h"
CHECK(etl::get_if<char>(&variant_etl) == nullptr);
CHECK(etl::get_if<int>(&variant_etl) != nullptr);
CHECK(etl::get_if<std::string>(&variant_etl) == nullptr);
@ -1593,7 +1597,7 @@ namespace
//*************************************************************************
TEST(test_get_if_by_type)
{
int value;
int value = 0;
etl::variant<int, double> v(value);
const etl::variant<int, double> cv(value);
@ -1629,7 +1633,7 @@ namespace
//*************************************************************************
TEST(test_get_if_by_index)
{
int value;
int value = 0;
etl::variant<int, double> v(value);
const etl::variant<int, double> cv(value);
@ -1917,4 +1921,6 @@ namespace
};
}
#include "etl/private/diagnostic_pop.h"
#endif

View File

@ -46,7 +46,7 @@ namespace
int buffer4[SIZE];
int buffer5[SIZE];
SUITE(test_vector)
SUITE(test_vector_external_buffer)
{
typedef etl::vector_ext<int> Data;
typedef etl::ivector<int> IData;
@ -511,7 +511,7 @@ namespace
Compare_Data compare_data(initial_data.begin(), initial_data.end());
Data data(initial_data.begin(), initial_data.end(), buffer1, SIZE);
CHECK(data.front() == compare_data.front());
CHECK_EQUAL(compare_data.front(), data.front());
}
//*************************************************************************
@ -520,7 +520,7 @@ namespace
const Compare_Data compare_data(initial_data.begin(), initial_data.end());
const Data data(initial_data.begin(), initial_data.end(), buffer1, SIZE);
CHECK(data.front() == compare_data.front());
CHECK_EQUAL(compare_data.front(), data.front());
}
//*************************************************************************
@ -529,7 +529,7 @@ namespace
Compare_Data compare_data(initial_data.begin(), initial_data.end());
Data data(initial_data.begin(), initial_data.end(), buffer1, SIZE);
CHECK(data.back() == compare_data.back());
CHECK_EQUAL(compare_data.back(), data.back());
}
//*************************************************************************
@ -538,7 +538,7 @@ namespace
const Compare_Data compare_data(initial_data.begin(), initial_data.end());
const Data data(initial_data.begin(), initial_data.end(), buffer1, SIZE);
CHECK(data.back() == compare_data.back());
CHECK_EQUAL(compare_data.back(), data.back());
}
@ -550,8 +550,8 @@ namespace
Data data(compare_data.begin(), compare_data.end(), buffer1, SIZE);
bool is_equal = std::equal(data.data(),
data.data() + data.size(),
compare_data.begin());
data.data() + data.size(),
compare_data.begin());
CHECK(is_equal);
}
@ -564,8 +564,8 @@ namespace
const Data data(compare_data.begin(), compare_data.end(), buffer1, SIZE);
bool is_equal = std::equal(data.data(),
data.data() + data.size(),
compare_data.begin());
data.data() + data.size(),
compare_data.begin());
CHECK(is_equal);
}

View File

@ -105,7 +105,7 @@ namespace
{
Data data(buffer1, SIZE);
CHECK_EQUAL(data.size(), size_t(0UL));
CHECK_EQUAL(data.size(), 0UL);
CHECK(data.empty());
CHECK_EQUAL(data.capacity(), SIZE);
CHECK_EQUAL(data.max_size(), SIZE);
@ -116,7 +116,7 @@ namespace
{
CData data(buffer1, SIZE);
CHECK_EQUAL(data.size(), size_t(0UL));
CHECK_EQUAL(data.size(), 0UL);
CHECK(data.empty());
CHECK_EQUAL(data.capacity(), SIZE);
CHECK_EQUAL(data.max_size(), SIZE);
@ -1175,9 +1175,9 @@ namespace
}
//*************************************************************************
#include "etl/private/diagnostic_array_bounds_push.h"
TEST_FIXTURE(SetupFixture, test_insert_position_value_excess)
{
#include "etl/private/diagnostic_array_bounds_push.h"
const size_t INITIAL_SIZE = SIZE;
int INITIAL_VALUE = 1;
@ -1194,8 +1194,8 @@ namespace
offset = data.size();
CHECK_THROW(data.insert(data.begin() + offset, &INITIAL_VALUE), etl::vector_full);
#include "etl/private/diagnostic_pop.h"
}
#include "etl/private/diagnostic_pop.h"
//*************************************************************************
TEST_FIXTURE(SetupFixture, test_emplace_position_value)
@ -1488,7 +1488,7 @@ namespace
Data data(compare_data.begin(), compare_data.end(), buffer1, SIZE);
data.clear();
CHECK_EQUAL(data.size(), size_t(0UL));
CHECK_EQUAL(data.size(), 0UL);
}
//*************************************************************************
@ -1499,7 +1499,7 @@ namespace
CData data(compare_data.begin(), compare_data.end(), buffer1, SIZE);
data.clear();
CHECK_EQUAL(data.size(), size_t(0UL));
CHECK_EQUAL(data.size(), 0UL);
}
//*************************************************************************