From bd578b6e7732b384a73205e7e82fbf64e74698a0 Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Sun, 2 Aug 2020 15:14:52 +0100 Subject: [PATCH] Resolve 0U ambiguity in string utility tests --- .circleci/config.yml | 1 + include/etl/string_utilities.h | 2 +- include/etl/version.h | 2 +- library.json | 2 +- library.properties | 2 +- support/Release notes.txt | 4 ++++ test/test_string_utilities.cpp | 4 ++-- test/test_string_utilities_u16.cpp | 4 ++-- test/test_string_utilities_u32.cpp | 4 ++-- test/test_string_utilities_wchar_t.cpp | 4 ++-- 10 files changed, 17 insertions(+), 12 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e3df303f..56da1208 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,6 +6,7 @@ jobs: branches: only: - master + - development steps: - checkout: - run: diff --git a/include/etl/string_utilities.h b/include/etl/string_utilities.h index 94d4589c..02c5e604 100644 --- a/include/etl/string_utilities.h +++ b/include/etl/string_utilities.h @@ -745,7 +745,7 @@ namespace etl if (required_size > s.size()) { required_size -= s.size(); - s.insert(0U, required_size, pad_char); + s.insert(size_t(0U), required_size, pad_char); } } diff --git a/include/etl/version.h b/include/etl/version.h index 93d16774..088f6bdc 100644 --- a/include/etl/version.h +++ b/include/etl/version.h @@ -39,7 +39,7 @@ SOFTWARE. #define ETL_VERSION_MAJOR 18 #define ETL_VERSION_MINOR 12 -#define ETL_VERSION_PATCH 2 +#define ETL_VERSION_PATCH 3 #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 9f5335b4..1f10047b 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "Embedded Template Library", - "version": "18.12.2", + "version": "18.12.3", "authors": { "name": "John Wellbelove", "email": "john.wellbelove@etlcpp.com" diff --git a/library.properties b/library.properties index 3f19cdad..4a136a6d 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Embedded Template Library -version=18.12.2 +version=18.12.3 author= John Wellbelove maintainer=John Wellbelove license=MIT diff --git a/support/Release notes.txt b/support/Release notes.txt index 65d26be5..8d735e4f 100644 --- a/support/Release notes.txt +++ b/support/Release notes.txt @@ -1,3 +1,7 @@ +=============================================================================== +18.12.3 +Resolve 0U constant ambiguity in string utility tests + =============================================================================== 18.12.2 Deleted unused file. diff --git a/test/test_string_utilities.cpp b/test/test_string_utilities.cpp index dfa3ef4f..19266338 100644 --- a/test/test_string_utilities.cpp +++ b/test/test_string_utilities.cpp @@ -1086,7 +1086,7 @@ namespace { String text(STR("Hello World")); String expected(text); - expected.insert(0U, text.capacity() - expected.size(), STR('x')); + expected.insert(size_t(0U), text.capacity() - expected.size(), STR('x')); etl::pad_left(text, text.capacity() + 1U, STR('x')); @@ -1154,7 +1154,7 @@ namespace { String text(STR("Hello World")); String expected(text); - expected.insert(0U, text.capacity() - expected.size(), STR('x')); + expected.insert(size_t(0U), text.capacity() - expected.size(), STR('x')); etl::pad(text, text.capacity() + 1U, etl::string_pad_direction::LEFT, STR('x')); diff --git a/test/test_string_utilities_u16.cpp b/test/test_string_utilities_u16.cpp index 85e8feed..fd0e8e88 100644 --- a/test/test_string_utilities_u16.cpp +++ b/test/test_string_utilities_u16.cpp @@ -1086,7 +1086,7 @@ namespace { String text(STR("Hello World")); String expected(text); - expected.insert(0U, text.capacity() - expected.size(), STR('x')); + expected.insert(size_t(0U), text.capacity() - expected.size(), STR('x')); etl::pad_left(text, text.capacity() + 1U, STR('x')); @@ -1154,7 +1154,7 @@ namespace { String text(STR("Hello World")); String expected(text); - expected.insert(0U, text.capacity() - expected.size(), STR('x')); + expected.insert(size_t(0U), text.capacity() - expected.size(), STR('x')); etl::pad(text, text.capacity() + 1U, etl::string_pad_direction::LEFT, STR('x')); diff --git a/test/test_string_utilities_u32.cpp b/test/test_string_utilities_u32.cpp index 54895271..4c716e4c 100644 --- a/test/test_string_utilities_u32.cpp +++ b/test/test_string_utilities_u32.cpp @@ -1086,7 +1086,7 @@ namespace { String text(STR("Hello World")); String expected(text); - expected.insert(0U, text.capacity() - expected.size(), STR('x')); + expected.insert(size_t(0U), text.capacity() - expected.size(), STR('x')); etl::pad_left(text, text.capacity() + 1U, STR('x')); @@ -1154,7 +1154,7 @@ namespace { String text(STR("Hello World")); String expected(text); - expected.insert(0U, text.capacity() - expected.size(), STR('x')); + expected.insert(size_t(0U), text.capacity() - expected.size(), STR('x')); etl::pad(text, text.capacity() + 1U, etl::string_pad_direction::LEFT, STR('x')); diff --git a/test/test_string_utilities_wchar_t.cpp b/test/test_string_utilities_wchar_t.cpp index 68495ace..531701f9 100644 --- a/test/test_string_utilities_wchar_t.cpp +++ b/test/test_string_utilities_wchar_t.cpp @@ -1086,7 +1086,7 @@ namespace { String text(STR("Hello World")); String expected(text); - expected.insert(0U, text.capacity() - expected.size(), STR('x')); + expected.insert(size_t(0U), text.capacity() - expected.size(), STR('x')); etl::pad_left(text, text.capacity() + 1U, STR('x')); @@ -1154,7 +1154,7 @@ namespace { String text(STR("Hello World")); String expected(text); - expected.insert(0U, text.capacity() - expected.size(), STR('x')); + expected.insert(size_t(0U), text.capacity() - expected.size(), STR('x')); etl::pad(text, text.capacity() + 1U, etl::string_pad_direction::LEFT, STR('x'));