From e44efd75a77086b654afb219d21adae5caa41f8c Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Thu, 17 Jun 2021 12:01:04 +0100 Subject: [PATCH 1/3] etl::basic_string::copy is now const and does not affect the 'truncated' flag. --- include/etl/basic_string.h | 36 ++++----- test/test_string_char.cpp | 67 +++++++++++++++++ test/test_string_char_external_buffer.cpp | 74 ++++++++++++++++++- test/test_string_u16.cpp | 71 +++++++++++++++++- test/test_string_u16_external_buffer.cpp | 78 +++++++++++++++++++- test/test_string_u32.cpp | 71 +++++++++++++++++- test/test_string_u32_external_buffer.cpp | 78 +++++++++++++++++++- test/test_string_wchar_t.cpp | 71 +++++++++++++++++- test/test_string_wchar_t_external_buffer.cpp | 78 +++++++++++++++++++- 9 files changed, 590 insertions(+), 34 deletions(-) diff --git a/include/etl/basic_string.h b/include/etl/basic_string.h index 8467fc91..8818c0ae 100644 --- a/include/etl/basic_string.h +++ b/include/etl/basic_string.h @@ -1296,31 +1296,31 @@ namespace etl //********************************************************************* /// Copies a portion of a string. - ///\param s Pointer to the string to copy. - ///\param len The number of characters to copy. - ///\param pos The position to start copying from. + ///\param s Pointer to the string to copy. + ///\param count The number of characters to copy. + ///\param pos The position to start copying from. //********************************************************************* - size_type copy(pointer s, size_type len, size_type pos = 0) + size_type copy(pointer dest, size_type count, size_type pos = 0) const { - if ((pos + len > size())) + if (pos < size()) { -#if ETL_STRING_TRUNCATION_CHECKS_ENABLED - set_truncated(true); + if (count != npos) + { + count = etl::min(count, size() - pos); + } + else + { + count = size() - pos; + } -#if defined(ETL_STRING_TRUNCATION_IS_ERROR) - ETL_ALWAYS_ASSERT(ETL_ERROR(string_truncation)); -#endif -#endif + etl::copy_n(p_buffer + pos, count, dest); + + return count; } - - size_type endpos = etl::min(pos + len, size()); - - for (size_type i = pos; i < endpos; ++i) + else { - *s++ = p_buffer[i]; + return 0U; } - - return endpos - pos; } //********************************************************************* diff --git a/test/test_string_char.cpp b/test/test_string_char.cpp index dab48f9b..840c3855 100644 --- a/test/test_string_char.cpp +++ b/test/test_string_char.cpp @@ -3000,6 +3000,73 @@ namespace CHECK(is_equal); } + //************************************************************************* + TEST_FIXTURE(SetupFixture, test_copy_start_pos_too_large) + { + Text text(initial_text.c_str()); + + value_t buffer1[SIZE]; + + size_t length1 = text.copy(buffer1, 5, SIZE); + + CHECK_EQUAL(0U, length1); +#if ETL_STRING_TRUNCATION_CHECKS_ENABLED + CHECK(!text.is_truncated()); +#endif + } + + //************************************************************************* + TEST_FIXTURE(SetupFixture, test_copy_count_equals_npos) + { + Compare_Text compare_text(initial_text.c_str()); + Text text(initial_text.c_str()); + + value_t buffer1[SIZE]; + value_t buffer2[SIZE]; + + size_t length1 = compare_text.copy(buffer1, Compare_Text::npos, 2); + buffer1[length1] = STR('\0'); + + size_t length2 = text.copy(buffer2, Text::npos, 2); + buffer2[length2] = STR('\0'); + + CHECK_EQUAL(length1, length2); +#if ETL_STRING_TRUNCATION_CHECKS_ENABLED + CHECK(!text.is_truncated()); +#endif + + bool is_equal = std::equal(buffer1, + buffer1 + length1, + buffer2); + CHECK(is_equal); + } + + //************************************************************************* + TEST_FIXTURE(SetupFixture, test_copy_count_too_large) + { + Compare_Text compare_text(initial_text.c_str()); + Text text(initial_text.c_str()); + + value_t buffer1[SIZE]; + value_t buffer2[SIZE]; + + size_t length1 = compare_text.copy(buffer1, SIZE, 2); + buffer1[length1] = STR('\0'); + + size_t length2 = text.copy(buffer2, SIZE, 2); + buffer2[length2] = STR('\0'); + + CHECK_EQUAL(length1, length2); +#if ETL_STRING_TRUNCATION_CHECKS_ENABLED + CHECK(!text.is_truncated()); +#endif + + bool is_equal = std::equal(buffer1, + buffer1 + length1, + buffer2); + CHECK(is_equal); + } + //************************************************************************* TEST_FIXTURE(SetupFixture, test_find_string) { diff --git a/test/test_string_char_external_buffer.cpp b/test/test_string_char_external_buffer.cpp index 7fe729b1..63017019 100644 --- a/test/test_string_char_external_buffer.cpp +++ b/test/test_string_char_external_buffer.cpp @@ -3290,7 +3290,7 @@ namespace TEST_FIXTURE(SetupFixture, test_copy) { Compare_Text compare_text(initial_text.c_str()); - + TextBuffer buffer; Text text(initial_text.c_str(), buffer.data(), buffer.size()); @@ -3314,6 +3314,78 @@ namespace CHECK(is_equal); } + //************************************************************************* + TEST_FIXTURE(SetupFixture, test_copy_start_pos_too_large) + { + TextBuffer buffer; + Text text(initial_text.c_str(), buffer.data(), buffer.size()); + + value_t buffer1[SIZE]; + + size_t length1 = text.copy(buffer1, 5, SIZE); + + CHECK_EQUAL(0U, length1); +#if ETL_STRING_TRUNCATION_CHECKS_ENABLED + CHECK(!text.is_truncated()); +#endif + } + + //************************************************************************* + TEST_FIXTURE(SetupFixture, test_copy_count_equals_npos) + { + Compare_Text compare_text(initial_text.c_str()); + + TextBuffer buffer; + Text text(initial_text.c_str(), buffer.data(), buffer.size()); + + value_t buffer1[SIZE]; + value_t buffer2[SIZE]; + + size_t length1 = compare_text.copy(buffer1, Compare_Text::npos, 2); + buffer1[length1] = STR('\0'); + + size_t length2 = text.copy(buffer2, Text::npos, 2); + buffer2[length2] = STR('\0'); + + CHECK_EQUAL(length1, length2); +#if ETL_STRING_TRUNCATION_CHECKS_ENABLED + CHECK(!text.is_truncated()); +#endif + + bool is_equal = std::equal(buffer1, + buffer1 + length1, + buffer2); + CHECK(is_equal); + } + + //************************************************************************* + TEST_FIXTURE(SetupFixture, test_copy_count_too_large) + { + Compare_Text compare_text(initial_text.c_str()); + + TextBuffer buffer; + Text text(initial_text.c_str(), buffer.data(), buffer.size()); + + value_t buffer1[SIZE]; + value_t buffer2[SIZE]; + + size_t length1 = compare_text.copy(buffer1, SIZE, 2); + buffer1[length1] = STR('\0'); + + size_t length2 = text.copy(buffer2, SIZE, 2); + buffer2[length2] = STR('\0'); + + CHECK_EQUAL(length1, length2); +#if ETL_STRING_TRUNCATION_CHECKS_ENABLED + CHECK(!text.is_truncated()); +#endif + + bool is_equal = std::equal(buffer1, + buffer1 + length1, + buffer2); + CHECK(is_equal); + } + //************************************************************************* TEST_FIXTURE(SetupFixture, test_find_string) { diff --git a/test/test_string_u16.cpp b/test/test_string_u16.cpp index 15703e12..2bf49875 100644 --- a/test/test_string_u16.cpp +++ b/test/test_string_u16.cpp @@ -2995,8 +2995,75 @@ namespace #endif bool is_equal = std::equal(buffer1, - buffer1 + length1, - buffer2); + buffer1 + length1, + buffer2); + CHECK(is_equal); + } + + //************************************************************************* + TEST_FIXTURE(SetupFixture, test_copy_start_pos_too_large) + { + Text text(initial_text.c_str()); + + value_t buffer1[SIZE]; + + size_t length1 = text.copy(buffer1, 5, SIZE); + + CHECK_EQUAL(0U, length1); +#if ETL_STRING_TRUNCATION_CHECKS_ENABLED + CHECK(!text.is_truncated()); +#endif + } + + //************************************************************************* + TEST_FIXTURE(SetupFixture, test_copy_count_equals_npos) + { + Compare_Text compare_text(initial_text.c_str()); + Text text(initial_text.c_str()); + + value_t buffer1[SIZE]; + value_t buffer2[SIZE]; + + size_t length1 = compare_text.copy(buffer1, Compare_Text::npos, 2); + buffer1[length1] = STR('\0'); + + size_t length2 = text.copy(buffer2, Text::npos, 2); + buffer2[length2] = STR('\0'); + + CHECK_EQUAL(length1, length2); +#if ETL_STRING_TRUNCATION_CHECKS_ENABLED + CHECK(!text.is_truncated()); +#endif + + bool is_equal = std::equal(buffer1, + buffer1 + length1, + buffer2); + CHECK(is_equal); + } + + //************************************************************************* + TEST_FIXTURE(SetupFixture, test_copy_count_too_large) + { + Compare_Text compare_text(initial_text.c_str()); + Text text(initial_text.c_str()); + + value_t buffer1[SIZE]; + value_t buffer2[SIZE]; + + size_t length1 = compare_text.copy(buffer1, SIZE, 2); + buffer1[length1] = STR('\0'); + + size_t length2 = text.copy(buffer2, SIZE, 2); + buffer2[length2] = STR('\0'); + + CHECK_EQUAL(length1, length2); +#if ETL_STRING_TRUNCATION_CHECKS_ENABLED + CHECK(!text.is_truncated()); +#endif + + bool is_equal = std::equal(buffer1, + buffer1 + length1, + buffer2); CHECK(is_equal); } diff --git a/test/test_string_u16_external_buffer.cpp b/test/test_string_u16_external_buffer.cpp index c62639cd..13128983 100644 --- a/test/test_string_u16_external_buffer.cpp +++ b/test/test_string_u16_external_buffer.cpp @@ -3290,7 +3290,7 @@ namespace TEST_FIXTURE(SetupFixture, test_copy) { Compare_Text compare_text(initial_text.c_str()); - + TextBuffer buffer; Text text(initial_text.c_str(), buffer.data(), buffer.size()); @@ -3309,8 +3309,80 @@ namespace #endif bool is_equal = std::equal(buffer1, - buffer1 + length1, - buffer2); + buffer1 + length1, + buffer2); + CHECK(is_equal); + } + + //************************************************************************* + TEST_FIXTURE(SetupFixture, test_copy_start_pos_too_large) + { + TextBuffer buffer; + Text text(initial_text.c_str(), buffer.data(), buffer.size()); + + value_t buffer1[SIZE]; + + size_t length1 = text.copy(buffer1, 5, SIZE); + + CHECK_EQUAL(0U, length1); +#if ETL_STRING_TRUNCATION_CHECKS_ENABLED + CHECK(!text.is_truncated()); +#endif + } + + //************************************************************************* + TEST_FIXTURE(SetupFixture, test_copy_count_equals_npos) + { + Compare_Text compare_text(initial_text.c_str()); + + TextBuffer buffer; + Text text(initial_text.c_str(), buffer.data(), buffer.size()); + + value_t buffer1[SIZE]; + value_t buffer2[SIZE]; + + size_t length1 = compare_text.copy(buffer1, Compare_Text::npos, 2); + buffer1[length1] = STR('\0'); + + size_t length2 = text.copy(buffer2, Text::npos, 2); + buffer2[length2] = STR('\0'); + + CHECK_EQUAL(length1, length2); +#if ETL_STRING_TRUNCATION_CHECKS_ENABLED + CHECK(!text.is_truncated()); +#endif + + bool is_equal = std::equal(buffer1, + buffer1 + length1, + buffer2); + CHECK(is_equal); + } + + //************************************************************************* + TEST_FIXTURE(SetupFixture, test_copy_count_too_large) + { + Compare_Text compare_text(initial_text.c_str()); + + TextBuffer buffer; + Text text(initial_text.c_str(), buffer.data(), buffer.size()); + + value_t buffer1[SIZE]; + value_t buffer2[SIZE]; + + size_t length1 = compare_text.copy(buffer1, SIZE, 2); + buffer1[length1] = STR('\0'); + + size_t length2 = text.copy(buffer2, SIZE, 2); + buffer2[length2] = STR('\0'); + + CHECK_EQUAL(length1, length2); +#if ETL_STRING_TRUNCATION_CHECKS_ENABLED + CHECK(!text.is_truncated()); +#endif + + bool is_equal = std::equal(buffer1, + buffer1 + length1, + buffer2); CHECK(is_equal); } diff --git a/test/test_string_u32.cpp b/test/test_string_u32.cpp index f5c2dfb3..75a827a5 100644 --- a/test/test_string_u32.cpp +++ b/test/test_string_u32.cpp @@ -2995,8 +2995,75 @@ namespace #endif bool is_equal = std::equal(buffer1, - buffer1 + length1, - buffer2); + buffer1 + length1, + buffer2); + CHECK(is_equal); + } + + //************************************************************************* + TEST_FIXTURE(SetupFixture, test_copy_start_pos_too_large) + { + Text text(initial_text.c_str()); + + value_t buffer1[SIZE]; + + size_t length1 = text.copy(buffer1, 5, SIZE); + + CHECK_EQUAL(0U, length1); +#if ETL_STRING_TRUNCATION_CHECKS_ENABLED + CHECK(!text.is_truncated()); +#endif + } + + //************************************************************************* + TEST_FIXTURE(SetupFixture, test_copy_count_equals_npos) + { + Compare_Text compare_text(initial_text.c_str()); + Text text(initial_text.c_str()); + + value_t buffer1[SIZE]; + value_t buffer2[SIZE]; + + size_t length1 = compare_text.copy(buffer1, Compare_Text::npos, 2); + buffer1[length1] = STR('\0'); + + size_t length2 = text.copy(buffer2, Text::npos, 2); + buffer2[length2] = STR('\0'); + + CHECK_EQUAL(length1, length2); +#if ETL_STRING_TRUNCATION_CHECKS_ENABLED + CHECK(!text.is_truncated()); +#endif + + bool is_equal = std::equal(buffer1, + buffer1 + length1, + buffer2); + CHECK(is_equal); + } + + //************************************************************************* + TEST_FIXTURE(SetupFixture, test_copy_count_too_large) + { + Compare_Text compare_text(initial_text.c_str()); + Text text(initial_text.c_str()); + + value_t buffer1[SIZE]; + value_t buffer2[SIZE]; + + size_t length1 = compare_text.copy(buffer1, SIZE, 2); + buffer1[length1] = STR('\0'); + + size_t length2 = text.copy(buffer2, SIZE, 2); + buffer2[length2] = STR('\0'); + + CHECK_EQUAL(length1, length2); +#if ETL_STRING_TRUNCATION_CHECKS_ENABLED + CHECK(!text.is_truncated()); +#endif + + bool is_equal = std::equal(buffer1, + buffer1 + length1, + buffer2); CHECK(is_equal); } diff --git a/test/test_string_u32_external_buffer.cpp b/test/test_string_u32_external_buffer.cpp index b210efdd..a1f62f2e 100644 --- a/test/test_string_u32_external_buffer.cpp +++ b/test/test_string_u32_external_buffer.cpp @@ -3290,7 +3290,7 @@ namespace TEST_FIXTURE(SetupFixture, test_copy) { Compare_Text compare_text(initial_text.c_str()); - + TextBuffer buffer; Text text(initial_text.c_str(), buffer.data(), buffer.size()); @@ -3309,8 +3309,80 @@ namespace #endif bool is_equal = std::equal(buffer1, - buffer1 + length1, - buffer2); + buffer1 + length1, + buffer2); + CHECK(is_equal); + } + + //************************************************************************* + TEST_FIXTURE(SetupFixture, test_copy_start_pos_too_large) + { + TextBuffer buffer; + Text text(initial_text.c_str(), buffer.data(), buffer.size()); + + value_t buffer1[SIZE]; + + size_t length1 = text.copy(buffer1, 5, SIZE); + + CHECK_EQUAL(0U, length1); +#if ETL_STRING_TRUNCATION_CHECKS_ENABLED + CHECK(!text.is_truncated()); +#endif + } + + //************************************************************************* + TEST_FIXTURE(SetupFixture, test_copy_count_equals_npos) + { + Compare_Text compare_text(initial_text.c_str()); + + TextBuffer buffer; + Text text(initial_text.c_str(), buffer.data(), buffer.size()); + + value_t buffer1[SIZE]; + value_t buffer2[SIZE]; + + size_t length1 = compare_text.copy(buffer1, Compare_Text::npos, 2); + buffer1[length1] = STR('\0'); + + size_t length2 = text.copy(buffer2, Text::npos, 2); + buffer2[length2] = STR('\0'); + + CHECK_EQUAL(length1, length2); +#if ETL_STRING_TRUNCATION_CHECKS_ENABLED + CHECK(!text.is_truncated()); +#endif + + bool is_equal = std::equal(buffer1, + buffer1 + length1, + buffer2); + CHECK(is_equal); + } + + //************************************************************************* + TEST_FIXTURE(SetupFixture, test_copy_count_too_large) + { + Compare_Text compare_text(initial_text.c_str()); + + TextBuffer buffer; + Text text(initial_text.c_str(), buffer.data(), buffer.size()); + + value_t buffer1[SIZE]; + value_t buffer2[SIZE]; + + size_t length1 = compare_text.copy(buffer1, SIZE, 2); + buffer1[length1] = STR('\0'); + + size_t length2 = text.copy(buffer2, SIZE, 2); + buffer2[length2] = STR('\0'); + + CHECK_EQUAL(length1, length2); +#if ETL_STRING_TRUNCATION_CHECKS_ENABLED + CHECK(!text.is_truncated()); +#endif + + bool is_equal = std::equal(buffer1, + buffer1 + length1, + buffer2); CHECK(is_equal); } diff --git a/test/test_string_wchar_t.cpp b/test/test_string_wchar_t.cpp index a6d0b7fb..3521b278 100644 --- a/test/test_string_wchar_t.cpp +++ b/test/test_string_wchar_t.cpp @@ -2995,8 +2995,75 @@ namespace #endif bool is_equal = std::equal(buffer1, - buffer1 + length1, - buffer2); + buffer1 + length1, + buffer2); + CHECK(is_equal); + } + + //************************************************************************* + TEST_FIXTURE(SetupFixture, test_copy_start_pos_too_large) + { + Text text(initial_text.c_str()); + + value_t buffer1[SIZE]; + + size_t length1 = text.copy(buffer1, 5, SIZE); + + CHECK_EQUAL(0U, length1); +#if ETL_STRING_TRUNCATION_CHECKS_ENABLED + CHECK(!text.is_truncated()); +#endif + } + + //************************************************************************* + TEST_FIXTURE(SetupFixture, test_copy_count_equals_npos) + { + Compare_Text compare_text(initial_text.c_str()); + Text text(initial_text.c_str()); + + value_t buffer1[SIZE]; + value_t buffer2[SIZE]; + + size_t length1 = compare_text.copy(buffer1, Compare_Text::npos, 2); + buffer1[length1] = STR('\0'); + + size_t length2 = text.copy(buffer2, Text::npos, 2); + buffer2[length2] = STR('\0'); + + CHECK_EQUAL(length1, length2); +#if ETL_STRING_TRUNCATION_CHECKS_ENABLED + CHECK(!text.is_truncated()); +#endif + + bool is_equal = std::equal(buffer1, + buffer1 + length1, + buffer2); + CHECK(is_equal); + } + + //************************************************************************* + TEST_FIXTURE(SetupFixture, test_copy_count_too_large) + { + Compare_Text compare_text(initial_text.c_str()); + Text text(initial_text.c_str()); + + value_t buffer1[SIZE]; + value_t buffer2[SIZE]; + + size_t length1 = compare_text.copy(buffer1, SIZE, 2); + buffer1[length1] = STR('\0'); + + size_t length2 = text.copy(buffer2, SIZE, 2); + buffer2[length2] = STR('\0'); + + CHECK_EQUAL(length1, length2); +#if ETL_STRING_TRUNCATION_CHECKS_ENABLED + CHECK(!text.is_truncated()); +#endif + + bool is_equal = std::equal(buffer1, + buffer1 + length1, + buffer2); CHECK(is_equal); } diff --git a/test/test_string_wchar_t_external_buffer.cpp b/test/test_string_wchar_t_external_buffer.cpp index f2fb7a70..1c736862 100644 --- a/test/test_string_wchar_t_external_buffer.cpp +++ b/test/test_string_wchar_t_external_buffer.cpp @@ -3290,7 +3290,7 @@ namespace TEST_FIXTURE(SetupFixture, test_copy) { Compare_Text compare_text(initial_text.c_str()); - + TextBuffer buffer; Text text(initial_text.c_str(), buffer.data(), buffer.size()); @@ -3309,8 +3309,80 @@ namespace #endif bool is_equal = std::equal(buffer1, - buffer1 + length1, - buffer2); + buffer1 + length1, + buffer2); + CHECK(is_equal); + } + + //************************************************************************* + TEST_FIXTURE(SetupFixture, test_copy_start_pos_too_large) + { + TextBuffer buffer; + Text text(initial_text.c_str(), buffer.data(), buffer.size()); + + value_t buffer1[SIZE]; + + size_t length1 = text.copy(buffer1, 5, SIZE); + + CHECK_EQUAL(0U, length1); +#if ETL_STRING_TRUNCATION_CHECKS_ENABLED + CHECK(!text.is_truncated()); +#endif + } + + //************************************************************************* + TEST_FIXTURE(SetupFixture, test_copy_count_equals_npos) + { + Compare_Text compare_text(initial_text.c_str()); + + TextBuffer buffer; + Text text(initial_text.c_str(), buffer.data(), buffer.size()); + + value_t buffer1[SIZE]; + value_t buffer2[SIZE]; + + size_t length1 = compare_text.copy(buffer1, Compare_Text::npos, 2); + buffer1[length1] = STR('\0'); + + size_t length2 = text.copy(buffer2, Text::npos, 2); + buffer2[length2] = STR('\0'); + + CHECK_EQUAL(length1, length2); +#if ETL_STRING_TRUNCATION_CHECKS_ENABLED + CHECK(!text.is_truncated()); +#endif + + bool is_equal = std::equal(buffer1, + buffer1 + length1, + buffer2); + CHECK(is_equal); + } + + //************************************************************************* + TEST_FIXTURE(SetupFixture, test_copy_count_too_large) + { + Compare_Text compare_text(initial_text.c_str()); + + TextBuffer buffer; + Text text(initial_text.c_str(), buffer.data(), buffer.size()); + + value_t buffer1[SIZE]; + value_t buffer2[SIZE]; + + size_t length1 = compare_text.copy(buffer1, SIZE, 2); + buffer1[length1] = STR('\0'); + + size_t length2 = text.copy(buffer2, SIZE, 2); + buffer2[length2] = STR('\0'); + + CHECK_EQUAL(length1, length2); +#if ETL_STRING_TRUNCATION_CHECKS_ENABLED + CHECK(!text.is_truncated()); +#endif + + bool is_equal = std::equal(buffer1, + buffer1 + length1, + buffer2); CHECK(is_equal); } From 6a1ce235dc52c5dfa95fadd49cc290821a63a548 Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Thu, 17 Jun 2021 12:01:04 +0100 Subject: [PATCH 2/3] etl::basic_string::copy is now const and does not affect the 'truncated' flag. --- include/etl/version.h | 2 +- library.json | 2 +- library.properties | 2 +- meson.build | 4 +++- support/Release notes.txt | 4 ++++ 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/include/etl/version.h b/include/etl/version.h index 61d898fe..1939f2b5 100644 --- a/include/etl/version.h +++ b/include/etl/version.h @@ -39,7 +39,7 @@ SOFTWARE. #define ETL_VERSION_MAJOR 20 #define ETL_VERSION_MINOR 11 -#define ETL_VERSION_PATCH 1 +#define ETL_VERSION_PATCH 2 #define ETL_VERSION ETL_STRINGIFY(ETL_VERSION_MAJOR) "." ETL_STRINGIFY(ETL_VERSION_MINOR) "." ETL_STRINGIFY(ETL_VERSION_PATCH) #define ETL_VERSION_W ETL_STRINGIFY(ETL_VERSION_MAJOR) L"." ETL_STRINGIFY(ETL_VERSION_MINOR) L"." ETL_STRINGIFY(ETL_VERSION_PATCH) #define ETL_VERSION_U16 ETL_STRINGIFY(ETL_VERSION_MAJOR) u"." ETL_STRINGIFY(ETL_VERSION_MINOR) u"." ETL_STRINGIFY(ETL_VERSION_PATCH) diff --git a/library.json b/library.json index 11db9207..200b4de9 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "ETL Embedded Template Library", - "version": "20.11.1", + "version": "20.11.2", "author s": { "name": "John Wellbelove", "email": "john.wellbelove@etlcpp.com" diff --git a/library.properties b/library.properties index aeaf6fa4..0780c918 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Embedded Template Library ETL -version=20.11.1 +version=20.11.2 author= John Wellbelove maintainer=John Wellbelove license=MIT diff --git a/meson.build b/meson.build index f870b9bc..8355fa88 100644 --- a/meson.build +++ b/meson.build @@ -8,7 +8,7 @@ project('PROJECT_NAME', 'cpp_std=c++17', 'build.cpp_std=c++17', ], meson_version: '>=0.54.0', - version: '20.11.1' + version: '20.11.2' ) ###################### @@ -71,6 +71,8 @@ etl_test_sources = files( 'test/test_largest.cpp', 'test/test_list.cpp', 'test/test_maths.cpp', + 'test/test_mem_cast.cpp', + 'test/test_mem_cast_ptr.cpp', 'test/test_memory.cpp', 'test/test_message_bus.cpp', 'test/test_message_router.cpp', diff --git a/support/Release notes.txt b/support/Release notes.txt index 4e457139..979920f6 100644 --- a/support/Release notes.txt +++ b/support/Release notes.txt @@ -1,3 +1,7 @@ +=============================================================================== +20.11.2 +etl::basic_string::copy is not const and does not affect truncation flags. + =============================================================================== 20.11.1 Fixed ambiguous function call in etl::mem_cast for clang. From 7f30a7cb8bb3d306220471f239710630b19d46a3 Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Thu, 17 Jun 2021 12:01:04 +0100 Subject: [PATCH 3/3] etl::basic_string::copy is now const and does not affect the 'truncated' flag. --- support/Release notes.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/support/Release notes.txt b/support/Release notes.txt index 979920f6..6cab183b 100644 --- a/support/Release notes.txt +++ b/support/Release notes.txt @@ -1,6 +1,6 @@ =============================================================================== 20.11.2 -etl::basic_string::copy is not const and does not affect truncation flags. +etl::basic_string::copy is now const and does not affect truncation flags. =============================================================================== 20.11.1