diff --git a/include/etl/utility.h b/include/etl/utility.h index 0c8fa240..08097a75 100644 --- a/include/etl/utility.h +++ b/include/etl/utility.h @@ -132,7 +132,7 @@ namespace etl #endif // We can't have std::swap and etl::swap templates coexisting in the unit tests - // as the compiler will be unable to decide of which one to use, due to ADL. + // as the compiler will be unable to decide which one to use, due to ADL. #if ETL_NOT_USING_STL && !defined(ETL_IN_UNIT_TEST) //*************************************************************************** // swap diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 3e44f0af..6fb1de1d 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -342,12 +342,21 @@ if (ETL_OPTIMISATION MATCHES "-O3") endif() if ((CMAKE_CXX_COMPILER_ID MATCHES "MSVC")) + message(STATUS "Using MSVC compiler") target_compile_options(etl_tests PRIVATE /Zc:__cplusplus ) endif () +if (CMAKE_CXX_COMPILER_ID MATCHES "GNU") + message(STATUS "Using GCC compiler") +endif () + +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")) target_compile_options(etl_tests PRIVATE diff --git a/test/test_string_char_external_buffer.cpp b/test/test_string_char_external_buffer.cpp index d131cf63..e25dfc35 100644 --- a/test/test_string_char_external_buffer.cpp +++ b/test/test_string_char_external_buffer.cpp @@ -105,7 +105,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_default_constructor) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); CHECK_EQUAL(text.size(), size_t(0)); @@ -182,7 +182,7 @@ namespace //************************************************************************* TEST(test_iterator_comparison_empty) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); CHECK(text.begin() == text.end()); @@ -199,7 +199,7 @@ namespace { const size_t INITIAL_SIZE = 5UL; const value_t INITIAL_VALUE = STR('A'); - TextBuffer buffer; + TextBuffer buffer{0}; Compare_Text compare_text(INITIAL_SIZE, INITIAL_VALUE); Text text(INITIAL_SIZE, INITIAL_VALUE, buffer.data(), buffer.size()); @@ -218,7 +218,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_constructor_size_excess) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.size() + 1, STR('A'), buffer.data(), buffer.size()); CHECK_EQUAL(buffer.size() - 1, text.size()); @@ -230,7 +230,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_constructor_char_pointer) { - TextBuffer buffer; + TextBuffer buffer{0}; Compare_Text compare_text(initial_text.c_str()); Text text(initial_text.c_str(), buffer.data(), buffer.size()); @@ -249,7 +249,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(longer_text.c_str(), buffer.data(), buffer.size()); CHECK(!text.empty()); @@ -266,7 +266,7 @@ namespace { Compare_Text compare_text(SIZE, STR('A')); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(SIZE, STR('A'), buffer.data(), buffer.size()); CHECK(!text.empty()); @@ -283,7 +283,7 @@ namespace { Compare_Text compare_text(SIZE, STR('A')); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(SIZE + 1, STR('A'), buffer.data(), buffer.size()); CHECK(!text.empty()); @@ -300,7 +300,7 @@ namespace { Compare_Text compare_text(initial_text.c_str(), initial_text.size() / 2); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), initial_text.size() / 2, buffer.data(), buffer.size()); CHECK(!text.empty()); @@ -317,7 +317,7 @@ namespace { Compare_Text compare_text(initial_text.c_str(), initial_text.size()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(longer_text.c_str(), longer_text.size(), buffer.data(), buffer.size()); CHECK(!text.empty()); @@ -334,7 +334,7 @@ namespace { Compare_Text compare_text(initial_text.begin(), initial_text.end()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(compare_text.begin(), compare_text.end(), buffer.data(), buffer.size()); CHECK(text.size() == SIZE); @@ -347,7 +347,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_constructor_range_excess) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(longer_text.begin(), longer_text.end(), buffer.data(), buffer.size()); bool is_equal = Equal(initial_text, text); @@ -362,7 +362,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_constructor_from_literal) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("Hello World"), buffer.data(), buffer.size()); bool is_equal = Equal(initial_text, text); @@ -376,7 +376,7 @@ namespace { etl::string_view view(initial_text.data(), initial_text.size()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(view, buffer.data(), buffer.size()); bool is_equal = Equal(initial_text, text); @@ -388,10 +388,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_copy_constructor) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text text2(text, buffer2.data(), buffer2.size()); CHECK(text2 == text); #if ETL_HAS_STRING_TRUNCATION_CHECKS @@ -402,11 +402,11 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_copy_constructor_i) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); IText& itext = text; - TextBuffer buffer2; + TextBuffer buffer2{0}; Text text2(itext, buffer2.data(), buffer2.size()); CHECK(text2 == text); #if ETL_HAS_STRING_TRUNCATION_CHECKS @@ -417,13 +417,13 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_copy_constructor_excess) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); - TextBufferL bufferl; + TextBufferL bufferl{0}; Text textl(longer_text.c_str(), bufferl.data(), bufferl.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text text2(textl, buffer2.data(), buffer2.size()); CHECK(text2 == text); #if ETL_HAS_STRING_TRUNCATION_CHECKS @@ -434,10 +434,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_copy_constructor_from_truncated) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(longer_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text text2(text, buffer2.data(), buffer2.size()); #if ETL_HAS_STRING_TRUNCATION_CHECKS @@ -451,10 +451,10 @@ namespace Compare_Text compare_text(initial_text.c_str()); Compare_Text compare_text2(compare_text, 2, 4); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text text2(text, buffer2.data(), buffer2.size(), 2, 4); bool is_equal = Equal(compare_text2, text2); @@ -470,10 +470,10 @@ namespace Compare_Text compare_text(longer_text.c_str()); Compare_Text compare_text2(compare_text, 2, 11); - TextBufferL bufferl; + TextBufferL bufferl{0}; Text textl(longer_text.c_str(), bufferl.data(), bufferl.size()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text2(textl, buffer.data(), buffer.size(), 2, 12); bool is_equal = Equal(compare_text2, text2); @@ -490,7 +490,7 @@ namespace Compare_Text compare_text = { STR('H'), STR('e'), STR('l') , STR('l') , STR('o') }; std::initializer_list il = { STR('H'), STR('e'), STR('l') , STR('l') , STR('o') }; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(il, buffer.data(), buffer.size()); bool is_equal = Equal(compare_text, text); @@ -509,7 +509,7 @@ namespace std::initializer_list il = { STR('H'), STR('e'), STR('l'), STR('l'), STR('o'), STR(' '), STR('W'), STR('o'), STR('r'), STR('l'), STR('d'), STR(' '), STR('T'), STR('h'), STR('e'), STR('r'), STR('e') }; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(il, buffer.data(), buffer.size()); bool is_equal = Equal(compare_text, text); @@ -523,10 +523,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_assignment) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.begin(), initial_text.end(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text other_text(buffer2.data(), buffer2.size()); other_text = text; @@ -542,10 +542,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_assignment_excess) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(longer_text.begin(), longer_text.end(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text other_text(buffer2.data(), buffer2.size()); other_text = text; @@ -561,10 +561,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_assignment_iterface) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text1(initial_text.begin(), initial_text.end(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text text2(buffer2.data(), buffer2.size()); IText& itext1 = text1; @@ -584,10 +584,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_assignment_iterface_excess) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text1(longer_text.begin(), longer_text.end(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text text2(buffer2.data(), buffer2.size()); IText& itext1 = text1; @@ -607,10 +607,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_self_assignment) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.begin(), initial_text.end(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text other_text(text, buffer2.data(), buffer2.size()); #include "etl/private/diagnostic_self_assign_overloaded_push.h" @@ -629,10 +629,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_self_assignment_excess) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(longer_text.begin(), longer_text.end(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text other_text(text, buffer2.data(), buffer2.size()); #include "etl/private/diagnostic_self_assign_overloaded_push.h" @@ -651,7 +651,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_assignment_from_literal) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text = STR("Hello World"); @@ -666,7 +666,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_assignment_from_literal_excess) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text = STR("Hello World There"); @@ -681,7 +681,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_assignment_from_literal_via_interface) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); IText& itext = text; @@ -697,7 +697,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_assignment_from_literal_via_interface_excess) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); IText& itext = text; @@ -713,10 +713,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_begin) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; const Text constText(initial_text.c_str(), buffer2.data(), buffer2.size()); CHECK_EQUAL(&text[0], text.begin()); @@ -727,10 +727,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_end) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; const Text constText(initial_text.c_str(), buffer2.data(), buffer2.size()); CHECK_EQUAL(&text[initial_text.size()], text.end()); @@ -743,7 +743,7 @@ namespace const size_t INITIAL_SIZE = 5; const size_t NEW_SIZE = 8; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), INITIAL_SIZE, buffer.data(), buffer.size()); text.resize(NEW_SIZE); @@ -760,7 +760,7 @@ namespace const size_t NEW_SIZE = 8; const value_t INITIAL_VALUE = STR('A'); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(INITIAL_SIZE, INITIAL_VALUE, buffer.data(), buffer.size()); text.resize(NEW_SIZE, INITIAL_VALUE); @@ -781,7 +781,7 @@ namespace const size_t INITIAL_SIZE = 5; const size_t NEW_SIZE = SIZE + 1; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(INITIAL_SIZE, STR('A'), buffer.data(), buffer.size()); text.resize(NEW_SIZE, STR('A')); CHECK_EQUAL(SIZE, text.size()); @@ -796,7 +796,7 @@ namespace const size_t INITIAL_SIZE = 5; const size_t NEW_SIZE = 2; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(INITIAL_SIZE, STR('A'), buffer.data(), buffer.size()); text.resize(NEW_SIZE); @@ -813,7 +813,7 @@ namespace const size_t NEW_SIZE = 2; const value_t INITIAL_VALUE = STR('A'); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(INITIAL_SIZE, INITIAL_VALUE, buffer.data(), buffer.size()); text.resize(NEW_SIZE, INITIAL_VALUE); @@ -837,7 +837,7 @@ namespace const value_t INITIAL_VALUE = STR('A'); const value_t FILL_VALUE = STR('B'); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(INITIAL_SIZE, INITIAL_VALUE, buffer.data(), buffer.size()); Text::pointer pbegin = &text.front(); @@ -865,7 +865,7 @@ namespace const size_t INITIAL_SIZE = 5; const size_t NEW_SIZE = SIZE + 1; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(INITIAL_SIZE, STR('A'), buffer.data(), buffer.size()); text.uninitialized_resize(NEW_SIZE); @@ -881,7 +881,7 @@ namespace const value_t INITIAL_VALUE = STR('A'); const value_t FILL_VALUE = STR('B'); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(INITIAL_SIZE, INITIAL_VALUE, buffer.data(), buffer.size()); Text::pointer pbegin = &text.front(); @@ -905,7 +905,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_empty_full) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.resize(text.max_size(), STR('A')); @@ -918,7 +918,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_empty_half) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.resize(text.max_size() / 2, STR('A')); @@ -931,7 +931,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_empty_empty) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); CHECK(text.empty()); @@ -943,7 +943,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_full_full) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.resize(text.max_size(), STR('A')); @@ -956,7 +956,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_full_half) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.resize(text.max_size() / 2, STR('A')); @@ -969,7 +969,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_full_empty) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); CHECK(!text.full()); @@ -983,7 +983,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); for (size_t i = 0UL; i < text.size(); ++i) @@ -1001,7 +1001,7 @@ namespace { const Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; const Text text(initial_text.c_str(), buffer.data(), buffer.size()); for (size_t i = 0UL; i < text.size(); ++i) @@ -1019,7 +1019,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); for (size_t i = 0UL; i < text.size(); ++i) @@ -1039,7 +1039,7 @@ namespace { const Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; const Text text(initial_text.c_str(), buffer.data(), buffer.size()); for (size_t i = 0UL; i < text.size(); ++i) @@ -1059,7 +1059,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); CHECK(text.front() == compare_text.front()); @@ -1073,7 +1073,7 @@ namespace { const Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; const Text text(initial_text.c_str(), buffer.data(), buffer.size()); CHECK(text.front() == compare_text.front()); @@ -1087,7 +1087,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); CHECK(text.back() == compare_text.back()); @@ -1101,7 +1101,7 @@ namespace { const Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; const Text text(initial_text.c_str(), buffer.data(), buffer.size()); CHECK(text.back() == compare_text.back()); @@ -1115,7 +1115,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(compare_text.begin(), compare_text.end(), buffer.data(), buffer.size()); bool is_equal = std::equal(text.data(), @@ -1133,7 +1133,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; const Text text(compare_text.begin(), compare_text.end(), buffer.data(), buffer.size()); bool is_equal = std::equal(text.data(), @@ -1151,12 +1151,12 @@ namespace { Compare_Text compare_input(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text input(initial_text.c_str(), buffer.data(), buffer.size()); Compare_Text compare_text; - TextBuffer buffer2; + TextBuffer buffer2{0}; Text text(buffer2.data(), buffer2.size()); compare_text.assign(compare_input); @@ -1174,12 +1174,12 @@ namespace { Compare_Text compare_input(initial_text.c_str()); - TextBufferL bufferl; + TextBufferL bufferl{0}; Text input(longer_text.c_str(), bufferl.data(), bufferl.size()); Compare_Text compare_text; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); compare_text.assign(compare_input); @@ -1197,7 +1197,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.assign(initial_text.c_str()); @@ -1213,7 +1213,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.assign(longer_text.c_str()); @@ -1229,7 +1229,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.assign(initial_text.c_str(), initial_text.size()); @@ -1245,7 +1245,7 @@ namespace { Compare_Text compare_text(longer_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.assign(longer_text.c_str(), longer_text.size()); @@ -1263,7 +1263,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.assign(compare_text.begin(), compare_text.end()); @@ -1278,7 +1278,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_assign_range_excess) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.assign(longer_text.begin(), longer_text.end()); @@ -1301,7 +1301,7 @@ namespace std::array compare_text; compare_text.fill(INITIAL_VALUE); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.assign(INITIAL_SIZE, INITIAL_VALUE); @@ -1323,7 +1323,7 @@ namespace std::array compare_text; compare_text.fill(INITIAL_VALUE); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.assign(EXCESS_SIZE, INITIAL_VALUE); @@ -1339,7 +1339,7 @@ namespace { Compare_Text compare_text; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); for (size_t i = 0UL; i < SIZE; ++i) @@ -1367,7 +1367,7 @@ namespace { Compare_Text compare_text; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); for (size_t i = 0UL; i < SIZE; ++i) @@ -1400,7 +1400,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); compare_text.pop_back(); @@ -1426,7 +1426,7 @@ namespace { Compare_Text compare_text; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.assign(initial_text.begin(), initial_text.begin() + INITIAL_SIZE); @@ -1447,7 +1447,7 @@ namespace TEST_FIXTURE(SetupFixture, test_insert_position_value_excess) { Compare_Text compare_text(initial_text.begin(), initial_text.end()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.begin(), initial_text.end(), buffer.data(), buffer.size()); const value_t INITIAL_VALUE = STR('A'); @@ -1493,7 +1493,7 @@ namespace TEST_FIXTURE(SetupFixture, test_insert_position_n_value) { Compare_Text compare_text; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); const size_t INITIAL_SIZE = 5UL; @@ -1520,7 +1520,7 @@ namespace TEST_FIXTURE(SetupFixture, test_insert_position_n_value_excess) { Compare_Text compare_text; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); const size_t INSERT_SIZE = 4UL; @@ -1594,7 +1594,7 @@ namespace for (size_t offset = 0UL; offset <= INITIAL_SIZE; ++offset) { Compare_Text compare_text; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.assign(initial_text.cbegin(), initial_text.cbegin() + INITIAL_SIZE); @@ -1618,7 +1618,7 @@ namespace const value_t INITIAL_VALUE = STR('A'); Compare_Text compare_text; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); size_t offset = 0UL; @@ -1677,7 +1677,7 @@ namespace for (size_t offset = 10UL; offset < length; ++offset) { Compare_Text compare_text = STR("ABCDEFGHIJKLMNOPQRSTUVWXYZ"); - TextBufferL bufferl; + TextBufferL bufferl{0}; Text text(bufferl.data(), bufferl.size()); text = STR("ABCDEFGHIJKLMNOPQRSTUVWXYZ"); @@ -1698,10 +1698,10 @@ namespace for (size_t offset = 0UL; offset <= short_text.size(); ++offset) { Compare_Text compare_text(short_text.cbegin(), short_text.cend()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.begin(), short_text.end(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text insert(insert_text.begin(), insert_text.end(), buffer2.data(), buffer2.size()); text.insert(offset, insert); @@ -1723,10 +1723,10 @@ namespace { Compare_Text compare_text(initial_text.cbegin(), initial_text.cend()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.begin(), initial_text.end(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text insert(insert_text.begin(), insert_text.end(), buffer2.data(), buffer2.size()); text.insert(offset, insert); @@ -1748,10 +1748,10 @@ namespace { Compare_Text compare_text(short_text.cbegin(), short_text.cend()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.begin(), short_text.end(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text insert(longer_text.begin(), longer_text.end(), buffer2.data(), buffer2.size()); insert.erase(insert.cbegin(), insert.cend()); @@ -1774,10 +1774,10 @@ namespace { Compare_Text compare_text(short_text.cbegin(), short_text.cend()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.begin(), short_text.end(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text insert(insert_text.begin(), insert_text.end(), buffer2.data(), buffer2.size()); text.insert(0, insert, 0, insert.size()); @@ -1824,10 +1824,10 @@ namespace { Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text append(insert_text.c_str(), buffer2.data(), buffer2.size()); // Non-overflow. @@ -1860,10 +1860,10 @@ namespace TEST_FIXTURE(SetupFixture, test_append_truncated_string) { #include "etl/private/diagnostic_array_bounds_push.h" - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); - TextBufferS buffers; + TextBufferS buffers{0}; Text append(short_text.c_str(), buffers.data(), buffers.size()); #if ETL_HAS_STRING_TRUNCATION_CHECKS CHECK(append.is_truncated()); @@ -1881,7 +1881,7 @@ namespace { Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); // Non-overflow. @@ -1914,10 +1914,10 @@ namespace { Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text append(insert_text.c_str(), buffer2.data(), buffer2.size()); // Whole string. @@ -1964,10 +1964,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_append_truncated_string_subpos_sublen) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); - TextBufferS buffer2; + TextBufferS buffer2{0}; Text append(short_text.c_str(), buffer2.data(), buffer2.size()); #if ETL_HAS_STRING_TRUNCATION_CHECKS CHECK(append.is_truncated()); @@ -1985,7 +1985,7 @@ namespace // Non-overflow. Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); // Whole string. @@ -2019,7 +2019,7 @@ namespace // Non-overflow. Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); // Non-overflow. @@ -2053,10 +2053,10 @@ namespace // Non-overflow. Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text append(insert_text.c_str(), buffer2.data(), buffer2.size()); compare_text.append(insert_text.begin(), insert_text.end()); @@ -2090,7 +2090,7 @@ namespace // Non-overflow short text, npos. Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); compare_text.replace(2, Compare_Text::npos, Compare_Text(STR("Replace"))); @@ -2194,7 +2194,7 @@ namespace // Non-overflow short text. Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, Compare_Text(STR("Replace"))); @@ -2256,7 +2256,7 @@ namespace // Non-overflow short text. Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); compare_text.replace(2, 4, Compare_Text(STR("Replace")), 1, 5); @@ -2374,7 +2374,7 @@ namespace // Non-overflow short text. Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); compare_text.replace(2, 4, Compare_Text(STR("Replace")).c_str()); @@ -2492,7 +2492,7 @@ namespace // Non-overflow short text. Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, Compare_Text(STR("Replace")).c_str()); @@ -2554,7 +2554,7 @@ namespace // Non-overflow short text. Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); compare_text.replace(2, 4, Compare_Text(STR("Replace")).c_str(), 5); @@ -2672,7 +2672,7 @@ namespace // Non-overflow short text. Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, Compare_Text(STR("Replace")).c_str(), 5); @@ -2742,7 +2742,7 @@ namespace // Non-overflow short text. Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); compare_text.replace(2, 4, 7, STR('A')); @@ -2860,7 +2860,7 @@ namespace // Non-overflow short text. Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, 7, STR('A')); @@ -2922,7 +2922,7 @@ namespace // Non-overflow short text. Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); Compare_Text replace(STR("Replace")); @@ -2986,7 +2986,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); compare_text.erase(compare_text.begin() + 2); @@ -3004,7 +3004,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); compare_text.erase(compare_text.begin() + 2, compare_text.begin() + 4); @@ -3021,7 +3021,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_clear) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); text.clear(); @@ -3036,7 +3036,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); bool is_equal = std::equal(text.begin(), text.end(), compare_text.begin()); @@ -3051,7 +3051,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); bool is_equal = std::equal(text.cbegin(), text.cend(), compare_text.cbegin()); @@ -3066,7 +3066,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); bool is_equal = std::equal(text.rbegin(), text.rend(), compare_text.rbegin()); @@ -3081,7 +3081,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); bool is_equal = std::equal(text.crbegin(), text.crend(), compare_text.crbegin()); @@ -3094,10 +3094,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_equal) { - TextBuffer buffer; + TextBuffer buffer{0}; const Text initial1(initial_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; const Text initial2(initial_text.c_str(), buffer2.data(), buffer2.size()); CHECK(initial1 == initial2); @@ -3116,10 +3116,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_not_equal) { - TextBuffer buffer; + TextBuffer buffer{0}; const Text initial1(initial_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; const Text initial2(initial_text.c_str(), buffer2.data(), buffer2.size()); CHECK(!(initial1 != initial2)); @@ -3138,10 +3138,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_less_than) { - TextBuffer buffer; + TextBuffer buffer{0}; const Text less(less_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; const Text initial(initial_text.c_str(), buffer2.data(), buffer2.size()); // String-String @@ -3178,10 +3178,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_less_than_or_equal) { - TextBuffer buffer; + TextBuffer buffer{0}; const Text less(less_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; const Text initial(initial_text.c_str(), buffer2.data(), buffer2.size()); // String-String @@ -3218,10 +3218,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_greater_than) { - TextBuffer buffer; + TextBuffer buffer{0}; const Text less(less_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; const Text initial(initial_text.c_str(), buffer2.data(), buffer2.size()); // String-String @@ -3258,10 +3258,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_greater_than_or_equal) { - TextBuffer buffer; + TextBuffer buffer{0}; const Text less(less_text.begin(), less_text.end(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; const Text initial(initial_text.begin(), initial_text.end(), buffer2.data(), buffer2.size()); // String-String @@ -3300,7 +3300,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); value_t buffer1[SIZE]; @@ -3326,7 +3326,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_copy_start_pos_too_large) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); value_t buffer1[SIZE]; @@ -3344,7 +3344,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); value_t buffer1[SIZE]; @@ -3372,7 +3372,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); value_t buffer1[SIZE]; @@ -3402,12 +3402,12 @@ namespace std::string compare_needle(STR("needle")); - TextBuffer buffer; + TextBuffer buffer{0}; Text needle(STR("needle"), buffer.data(), buffer.size()); std::string compare_haystack(the_haystack); - TextBufferL buffer2; + TextBufferL buffer2{0}; Text haystack(the_haystack, buffer2.data(), buffer2.size()); size_t position1 = 0; @@ -3438,7 +3438,7 @@ namespace std::string compare_haystack(the_haystack); - TextBufferL buffer; + TextBufferL buffer{0}; Text haystack(the_haystack, buffer.data(), buffer.size()); size_t position1 = 0; @@ -3469,7 +3469,7 @@ namespace std::string compare_haystack(the_haystack); - TextBufferL buffer; + TextBufferL buffer{0}; Text haystack(the_haystack, buffer.data(), buffer.size()); size_t position1 = 0; @@ -3498,12 +3498,12 @@ namespace std::string compare_needle(STR("needle")); - TextBufferL buffer; + TextBufferL buffer{0}; Text needle(STR("needle"), buffer.data(), buffer.size()); std::string compare_haystack(the_haystack); - TextBufferL buffer2; + TextBufferL buffer2{0}; Text haystack(the_haystack, buffer2.data(), buffer2.size()); size_t position1 = std::string::npos; @@ -3530,7 +3530,7 @@ namespace std::string compare_haystack(the_haystack); - TextBufferL buffer; + TextBufferL buffer{0}; Text haystack(the_haystack, buffer.data(), buffer.size()); const value_t* needle = STR("needle"); @@ -3546,7 +3546,7 @@ namespace position2 = haystack.rfind(needle, haystack.size() - 10); CHECK_EQUAL(position1, position2); - TextBufferL buffer2; + TextBufferL buffer2{0}; Text pin(STR("pin"), buffer2.data(), buffer2.size()); position2 = haystack.rfind(pin); CHECK_EQUAL(IText::npos, position2); @@ -3559,7 +3559,7 @@ namespace std::string compare_haystack(the_haystack); - TextBufferL buffer; + TextBufferL buffer{0}; Text haystack(the_haystack, buffer.data(), buffer.size()); const value_t* needle = STR("needle"); @@ -3587,7 +3587,7 @@ namespace std::string compare_haystack(the_haystack); - TextBufferL buffer; + TextBufferL buffer{0}; Text haystack(the_haystack, buffer.data(), buffer.size()); size_t position1 = std::string::npos; @@ -3610,7 +3610,7 @@ namespace { Compare_Text compare_text(STR("ABCDEF")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEF"), buffer.data(), buffer.size()); int compare_result; @@ -3647,7 +3647,7 @@ namespace { Compare_Text compare_text(STR("xxxABCDEFyyy")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("xxxABCDEFyyy"), buffer.data(), buffer.size()); int compare_result; @@ -3684,7 +3684,7 @@ namespace { Compare_Text compare_text(STR("xxxABCDEFyyy")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("xxxABCDEFyyy"), buffer.data(), buffer.size()); int compare_result; @@ -3721,7 +3721,7 @@ namespace { Compare_Text compare_text(STR("ABCDEF")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEF"), buffer.data(), buffer.size()); int compare_result; @@ -3758,7 +3758,7 @@ namespace { Compare_Text compare_text(STR("xxxABCDEFyyy")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("xxxABCDEFyyy"), buffer.data(), buffer.size()); int compare_result; @@ -3795,7 +3795,7 @@ namespace { Compare_Text compare_text(STR("xxxABCDEFyyy")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("xxxABCDEFyyy"), buffer.data(), buffer.size()); int compare_result; @@ -3832,7 +3832,7 @@ namespace { Compare_Text compare_text(STR("ABCDEF")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEF"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_first_of(Compare_Text(STR("ZCXF"))); @@ -3863,7 +3863,7 @@ namespace { Compare_Text compare_text(STR("ABCDEF")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEF"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_first_of(STR("ZCXF")); @@ -3894,7 +3894,7 @@ namespace { Compare_Text compare_text(STR("ABCDEF")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEF"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_first_of(STR("ZCXF"), 0, 4); @@ -3930,7 +3930,7 @@ namespace { Compare_Text compare_text(STR("ABCDEF")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEF"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_first_of(STR('C')); @@ -3971,7 +3971,7 @@ namespace { Compare_Text compare_text(STR("ABCDEFABCDE")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEFABCDE"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_last_of(Compare_Text(STR("ZCXE"))); @@ -4007,7 +4007,7 @@ namespace { Compare_Text compare_text(STR("ABCDEFABCDE")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEFABCDE"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_last_of(STR("ZCXE")); @@ -4048,7 +4048,7 @@ namespace { Compare_Text compare_text(STR("ABCDEFABCDE")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEFABCDE"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_last_of(STR("AZCXE"), 0, 4); @@ -4089,7 +4089,7 @@ namespace { Compare_Text compare_text(STR("ABCDEF")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEF"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_last_of(STR('C')); @@ -4130,7 +4130,7 @@ namespace { Compare_Text compare_text(STR("ABCDEF")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEF"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_first_not_of(Compare_Text(STR("ZAXB"))); @@ -4166,7 +4166,7 @@ namespace { Compare_Text compare_text(STR("ABCDEF")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEF"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_first_not_of(STR("ZAXB")); @@ -4202,7 +4202,7 @@ namespace { Compare_Text compare_text(STR("ABCDEF")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEF"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_first_not_of(STR("ZAXB"), 0, 4); @@ -4243,7 +4243,7 @@ namespace { Compare_Text compare_text(STR("ABCDEF")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEF"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_first_not_of(STR('A')); @@ -4284,7 +4284,7 @@ namespace { Compare_Text compare_text(STR("ABCDEFABCDE")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEFABCDE"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_last_not_of(Compare_Text(STR("ZEXD"))); @@ -4320,7 +4320,7 @@ namespace { Compare_Text compare_text(STR("ABCDEFABCDE")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEFABCDE"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_last_not_of(STR("ZEXD")); @@ -4356,7 +4356,7 @@ namespace { Compare_Text compare_text(STR("ABCDEFABCDE")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEFABCDE"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_last_not_of(STR("ZEXD"), 0, 4); @@ -4390,7 +4390,7 @@ namespace { Compare_Text compare_text(STR("ABCDEF")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEF"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_last_not_of(STR('F')); @@ -4430,7 +4430,7 @@ namespace TEST_FIXTURE(SetupFixture, test_hash) { // Test with actual string type. - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEFHIJKL"), buffer.data(), buffer.size()); size_t hash = etl::hash()(text); size_t compare_hash = etl::private_hash::generic_hash(reinterpret_cast(&text[0]), reinterpret_cast(&text[text.size()])); @@ -4445,7 +4445,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_memcpy_repair) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.assign(STR("ABCDEF")); @@ -4472,7 +4472,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_memcpy_repair_virtual) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.assign(STR("ABCDEF")); @@ -4500,7 +4500,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_truncate_over_many_operations) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); CHECK(!text.is_truncated()); @@ -4526,10 +4526,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_add_from_truncated) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text1(short_text.c_str(), buffer.data(), buffer.size()); - TextBufferS buffers; + TextBufferS buffers{0}; Text text2(short_text.c_str(), buffers.data(), buffers.size()); CHECK(!text1.is_truncated()); @@ -4544,10 +4544,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_add_to_truncated) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text1(longer_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text text2(short_text.c_str(), buffer2.data(), buffer2.size()); CHECK(text1.is_truncated()); @@ -4565,7 +4565,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_clear_truncated) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(longer_text.c_str(), buffer.data(), buffer.size()); CHECK(text.is_truncated()); @@ -4581,7 +4581,7 @@ namespace char buffer[sizeof(Text)]; std::fill_n(buffer, sizeof(Text), 0); - TextBuffer buffer2; + TextBuffer buffer2{0}; ::new (buffer) Text(STR("ABCDEF"), buffer2.data(), buffer2.size()); Text& text = *reinterpret_cast(buffer); @@ -4602,7 +4602,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_secure_after_assign) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.set_secure(); text.assign(STR("ABCDEF")); @@ -4617,7 +4617,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_secure_after_resize_down) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.set_secure(); text.assign(STR("ABCDEF")); @@ -4632,7 +4632,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_secure_after_erase) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.set_secure(); text.assign(STR("ABCDEF")); @@ -4649,7 +4649,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_secure_after_replace) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.set_secure(); text.assign(STR("ABCDEF")); @@ -4666,7 +4666,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_secure_after_clear) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.set_secure(); text.assign(STR("ABCDEF")); @@ -4683,11 +4683,11 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_secure_flag_after_copy) { - TextBuffer buffer1; + TextBuffer buffer1{0}; Text text1(STR("Hello World"), buffer1.data(), buffer1.size()); text1.set_secure(); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text text2(text1, buffer2.data(), buffer2.size()); TextBuffer buffer3; @@ -4706,8 +4706,8 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_initialize_free_space_empty_string) { - TextBuffer buffer1; - TextBuffer buffer2; + TextBuffer buffer1{0}; + TextBuffer buffer2{0}; Text text(buffer1.data(), buffer1.size()); Text empty(buffer2.data(), buffer2.size()); @@ -4725,8 +4725,8 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_initialize_free_space_part_filled_string) { - TextBuffer buffer1; - TextBuffer buffer2; + TextBuffer buffer1{0}; + TextBuffer buffer2{0}; Text initial(STR("ABC"), buffer1.data(), buffer1.size()); Text empty(buffer2.data(), buffer2.size()); Text text(initial, buffer2.data(), buffer2.size()); @@ -4745,7 +4745,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_update_after_c_string_max_size) { - TextBuffer buffer1; + TextBuffer buffer1{0}; Text text(buffer1.data(), buffer1.size()); text.initialize_free_space(); @@ -4761,7 +4761,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_update_after_c_string_shorter_size) { - TextBuffer buffer1; + TextBuffer buffer1{0}; Text text(buffer1.data(), buffer1.size()); text.initialize_free_space(); @@ -4777,7 +4777,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_update_after_c_string_greater_size) { - TextBuffer buffer1; + TextBuffer buffer1{0}; Text text(buffer1.data(), buffer1.size()); text.initialize_free_space(); diff --git a/test/test_string_u16_external_buffer.cpp b/test/test_string_u16_external_buffer.cpp index 7fa6de47..5d497888 100644 --- a/test/test_string_u16_external_buffer.cpp +++ b/test/test_string_u16_external_buffer.cpp @@ -120,7 +120,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_default_constructor) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); CHECK_EQUAL(text.size(), size_t(0)); @@ -197,7 +197,7 @@ namespace //************************************************************************* TEST(test_iterator_comparison_empty) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); CHECK(text.begin() == text.end()); @@ -214,7 +214,7 @@ namespace { const size_t INITIAL_SIZE = 5; const value_t INITIAL_VALUE = STR('A'); - TextBuffer buffer; + TextBuffer buffer{0}; Compare_Text compare_text(INITIAL_SIZE, INITIAL_VALUE); Text text(INITIAL_SIZE, INITIAL_VALUE, buffer.data(), buffer.size()); @@ -233,7 +233,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_constructor_size_excess) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.size() + 1, STR('A'), buffer.data(), buffer.size()); CHECK_EQUAL(buffer.size() - 1, text.size()); @@ -245,7 +245,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_constructor_char_pointer) { - TextBuffer buffer; + TextBuffer buffer{0}; Compare_Text compare_text(initial_text.c_str()); Text text(initial_text.c_str(), buffer.data(), buffer.size()); @@ -264,7 +264,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(longer_text.c_str(), buffer.data(), buffer.size()); CHECK(!text.empty()); @@ -281,7 +281,7 @@ namespace { Compare_Text compare_text(SIZE, STR('A')); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(SIZE, STR('A'), buffer.data(), buffer.size()); CHECK(!text.empty()); @@ -298,7 +298,7 @@ namespace { Compare_Text compare_text(SIZE, STR('A')); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(SIZE + 1, STR('A'), buffer.data(), buffer.size()); CHECK(!text.empty()); @@ -315,7 +315,7 @@ namespace { Compare_Text compare_text(initial_text.c_str(), initial_text.size() / 2); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), initial_text.size() / 2, buffer.data(), buffer.size()); CHECK(!text.empty()); @@ -332,7 +332,7 @@ namespace { Compare_Text compare_text(initial_text.c_str(), initial_text.size()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(longer_text.c_str(), longer_text.size(), buffer.data(), buffer.size()); CHECK(!text.empty()); @@ -349,7 +349,7 @@ namespace { Compare_Text compare_text(initial_text.begin(), initial_text.end()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(compare_text.begin(), compare_text.end(), buffer.data(), buffer.size()); CHECK(text.size() == SIZE); @@ -362,7 +362,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_constructor_range_excess) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(longer_text.begin(), longer_text.end(), buffer.data(), buffer.size()); bool is_equal = Equal(initial_text, text); @@ -377,7 +377,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_constructor_from_literal) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("Hello World"), buffer.data(), buffer.size()); bool is_equal = Equal(initial_text, text); @@ -391,7 +391,7 @@ namespace { etl::u16string_view view(initial_text.data(), initial_text.size()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(view, buffer.data(), buffer.size()); bool is_equal = Equal(initial_text, text); @@ -403,10 +403,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_copy_constructor) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text text2(text, buffer2.data(), buffer2.size()); CHECK(text2 == text); #if ETL_HAS_STRING_TRUNCATION_CHECKS @@ -417,11 +417,11 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_copy_constructor_i) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); IText& itext = text; - TextBuffer buffer2; + TextBuffer buffer2{0}; Text text2(itext, buffer2.data(), buffer2.size()); CHECK(text2 == text); #if ETL_HAS_STRING_TRUNCATION_CHECKS @@ -432,13 +432,13 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_copy_constructor_excess) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); - TextBufferL bufferl; + TextBufferL bufferl{0}; Text textl(longer_text.c_str(), bufferl.data(), bufferl.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text text2(textl, buffer2.data(), buffer2.size()); CHECK(text2 == text); #if ETL_HAS_STRING_TRUNCATION_CHECKS @@ -449,10 +449,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_copy_constructor_from_truncated) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(longer_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text text2(text, buffer2.data(), buffer2.size()); #if ETL_HAS_STRING_TRUNCATION_CHECKS @@ -466,10 +466,10 @@ namespace Compare_Text compare_text(initial_text.c_str()); Compare_Text compare_text2(compare_text, 2, 4); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text text2(text, buffer2.data(), buffer2.size(), 2, 4); bool is_equal = Equal(compare_text2, text2); @@ -485,10 +485,10 @@ namespace Compare_Text compare_text(longer_text.c_str()); Compare_Text compare_text2(compare_text, 2, 11); - TextBufferL bufferl; + TextBufferL bufferl{0}; Text textl(longer_text.c_str(), bufferl.data(), bufferl.size()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text2(textl, buffer.data(), buffer.size(), 2, 12); bool is_equal = Equal(compare_text2, text2); @@ -505,7 +505,7 @@ namespace Compare_Text compare_text = { STR('H'), STR('e'), STR('l') , STR('l') , STR('o') }; std::initializer_list il = { STR('H'), STR('e'), STR('l') , STR('l') , STR('o') }; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(il, buffer.data(), buffer.size()); bool is_equal = Equal(compare_text, text); @@ -524,7 +524,7 @@ namespace std::initializer_list il = { STR('H'), STR('e'), STR('l'), STR('l'), STR('o'), STR(' '), STR('W'), STR('o'), STR('r'), STR('l'), STR('d'), STR(' '), STR('T'), STR('h'), STR('e'), STR('r'), STR('e') }; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(il, buffer.data(), buffer.size()); bool is_equal = Equal(compare_text, text); @@ -538,10 +538,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_assignment) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.begin(), initial_text.end(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text other_text(buffer2.data(), buffer2.size()); other_text = text; @@ -557,10 +557,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_assignment_excess) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(longer_text.begin(), longer_text.end(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text other_text(buffer2.data(), buffer2.size()); other_text = text; @@ -576,10 +576,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_assignment_iterface) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text1(initial_text.begin(), initial_text.end(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text text2(buffer2.data(), buffer2.size()); IText& itext1 = text1; @@ -599,10 +599,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_assignment_iterface_excess) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text1(longer_text.begin(), longer_text.end(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text text2(buffer2.data(), buffer2.size()); IText& itext1 = text1; @@ -622,10 +622,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_self_assignment) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.begin(), initial_text.end(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text other_text(text, buffer2.data(), buffer2.size()); #include "etl/private/diagnostic_self_assign_overloaded_push.h" @@ -644,10 +644,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_self_assignment_excess) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(longer_text.begin(), longer_text.end(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text other_text(text, buffer2.data(), buffer2.size()); #include "etl/private/diagnostic_self_assign_overloaded_push.h" @@ -666,7 +666,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_assignment_from_literal) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text = STR("Hello World"); @@ -681,7 +681,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_assignment_from_literal_excess) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text = STR("Hello World There"); @@ -696,7 +696,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_assignment_from_literal_via_interface) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); IText& itext = text; @@ -712,7 +712,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_assignment_from_literal_via_interface_excess) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); IText& itext = text; @@ -728,10 +728,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_begin) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; const Text constText(initial_text.c_str(), buffer2.data(), buffer2.size()); CHECK_EQUAL(&text[0], text.begin()); @@ -742,10 +742,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_end) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; const Text constText(initial_text.c_str(), buffer2.data(), buffer2.size()); CHECK_EQUAL(&text[initial_text.size()], text.end()); @@ -758,7 +758,7 @@ namespace const size_t INITIAL_SIZE = 5; const size_t NEW_SIZE = 8; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), INITIAL_SIZE, buffer.data(), buffer.size()); text.resize(NEW_SIZE); @@ -775,7 +775,7 @@ namespace const size_t NEW_SIZE = 8; const value_t INITIAL_VALUE = STR('A'); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(INITIAL_SIZE, INITIAL_VALUE, buffer.data(), buffer.size()); text.resize(NEW_SIZE, INITIAL_VALUE); @@ -796,7 +796,7 @@ namespace const size_t INITIAL_SIZE = 5; const size_t NEW_SIZE = SIZE + 1; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(INITIAL_SIZE, STR('A'), buffer.data(), buffer.size()); text.resize(NEW_SIZE, STR('A')); CHECK_EQUAL(SIZE, text.size()); @@ -811,7 +811,7 @@ namespace const size_t INITIAL_SIZE = 5; const size_t NEW_SIZE = 2; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(INITIAL_SIZE, STR('A'), buffer.data(), buffer.size()); text.resize(NEW_SIZE); @@ -828,7 +828,7 @@ namespace const size_t NEW_SIZE = 2; const value_t INITIAL_VALUE = STR('A'); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(INITIAL_SIZE, INITIAL_VALUE, buffer.data(), buffer.size()); text.resize(NEW_SIZE, INITIAL_VALUE); @@ -852,7 +852,7 @@ namespace const value_t INITIAL_VALUE = STR('A'); const value_t FILL_VALUE = STR('B'); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(INITIAL_SIZE, INITIAL_VALUE, buffer.data(), buffer.size()); Text::pointer pbegin = &text.front(); @@ -880,7 +880,7 @@ namespace const size_t INITIAL_SIZE = 5; const size_t NEW_SIZE = SIZE + 1; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(INITIAL_SIZE, STR('A'), buffer.data(), buffer.size()); text.uninitialized_resize(NEW_SIZE); @@ -896,7 +896,7 @@ namespace const value_t INITIAL_VALUE = STR('A'); const value_t FILL_VALUE = STR('B'); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(INITIAL_SIZE, INITIAL_VALUE, buffer.data(), buffer.size()); Text::pointer pbegin = &text.front(); @@ -920,7 +920,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_empty_full) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.resize(text.max_size(), STR('A')); @@ -933,7 +933,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_empty_half) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.resize(text.max_size() / 2, STR('A')); @@ -946,7 +946,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_empty_empty) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); CHECK(text.empty()); @@ -958,7 +958,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_full_full) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.resize(text.max_size(), STR('A')); @@ -971,7 +971,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_full_half) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.resize(text.max_size() / 2, STR('A')); @@ -984,7 +984,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_full_empty) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); CHECK(!text.full()); @@ -998,7 +998,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); for (size_t i = 0UL; i < text.size(); ++i) @@ -1016,7 +1016,7 @@ namespace { const Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; const Text text(initial_text.c_str(), buffer.data(), buffer.size()); for (size_t i = 0UL; i < text.size(); ++i) @@ -1034,7 +1034,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); for (size_t i = 0UL; i < text.size(); ++i) @@ -1054,7 +1054,7 @@ namespace { const Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; const Text text(initial_text.c_str(), buffer.data(), buffer.size()); for (size_t i = 0UL; i < text.size(); ++i) @@ -1074,7 +1074,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); CHECK(text.front() == compare_text.front()); @@ -1088,7 +1088,7 @@ namespace { const Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; const Text text(initial_text.c_str(), buffer.data(), buffer.size()); CHECK(text.front() == compare_text.front()); @@ -1102,7 +1102,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); CHECK(text.back() == compare_text.back()); @@ -1116,7 +1116,7 @@ namespace { const Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; const Text text(initial_text.c_str(), buffer.data(), buffer.size()); CHECK(text.back() == compare_text.back()); @@ -1130,7 +1130,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(compare_text.begin(), compare_text.end(), buffer.data(), buffer.size()); bool is_equal = std::equal(text.data(), @@ -1148,7 +1148,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; const Text text(compare_text.begin(), compare_text.end(), buffer.data(), buffer.size()); bool is_equal = std::equal(text.data(), @@ -1166,12 +1166,12 @@ namespace { Compare_Text compare_input(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text input(initial_text.c_str(), buffer.data(), buffer.size()); Compare_Text compare_text; - TextBuffer buffer2; + TextBuffer buffer2{0}; Text text(buffer2.data(), buffer2.size()); compare_text.assign(compare_input); @@ -1189,12 +1189,12 @@ namespace { Compare_Text compare_input(initial_text.c_str()); - TextBufferL bufferl; + TextBufferL bufferl{0}; Text input(longer_text.c_str(), bufferl.data(), bufferl.size()); Compare_Text compare_text; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); compare_text.assign(compare_input); @@ -1212,7 +1212,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.assign(initial_text.c_str()); @@ -1228,7 +1228,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.assign(longer_text.c_str()); @@ -1244,7 +1244,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.assign(initial_text.c_str(), initial_text.size()); @@ -1260,7 +1260,7 @@ namespace { Compare_Text compare_text(longer_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.assign(longer_text.c_str(), longer_text.size()); @@ -1278,7 +1278,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.assign(compare_text.begin(), compare_text.end()); @@ -1293,7 +1293,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_assign_range_excess) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.assign(longer_text.begin(), longer_text.end()); @@ -1316,7 +1316,7 @@ namespace std::array compare_text; compare_text.fill(INITIAL_VALUE); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.assign(INITIAL_SIZE, INITIAL_VALUE); @@ -1338,7 +1338,7 @@ namespace std::array compare_text; compare_text.fill(INITIAL_VALUE); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.assign(EXCESS_SIZE, INITIAL_VALUE); @@ -1354,7 +1354,7 @@ namespace { Compare_Text compare_text; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); for (size_t i = 0UL; i < SIZE; ++i) @@ -1382,7 +1382,7 @@ namespace { Compare_Text compare_text; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); for (size_t i = 0UL; i < SIZE; ++i) @@ -1415,7 +1415,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); compare_text.pop_back(); @@ -1441,7 +1441,7 @@ namespace { Compare_Text compare_text; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.assign(initial_text.begin(), initial_text.begin() + INITIAL_SIZE); @@ -1462,7 +1462,7 @@ namespace TEST_FIXTURE(SetupFixture, test_insert_position_value_excess) { Compare_Text compare_text(initial_text.begin(), initial_text.end()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.begin(), initial_text.end(), buffer.data(), buffer.size()); const value_t INITIAL_VALUE = STR('A'); @@ -1508,7 +1508,7 @@ namespace TEST_FIXTURE(SetupFixture, test_insert_position_n_value) { Compare_Text compare_text; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); const size_t INITIAL_SIZE = 5UL; @@ -1535,7 +1535,7 @@ namespace TEST_FIXTURE(SetupFixture, test_insert_position_n_value_excess) { Compare_Text compare_text; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); const size_t INSERT_SIZE = 4UL; @@ -1609,7 +1609,7 @@ namespace for (size_t offset = 0UL; offset <= INITIAL_SIZE; ++offset) { Compare_Text compare_text; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.assign(initial_text.cbegin(), initial_text.cbegin() + INITIAL_SIZE); @@ -1633,7 +1633,7 @@ namespace const value_t INITIAL_VALUE = STR('A'); Compare_Text compare_text; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); size_t offset = 0UL; @@ -1692,7 +1692,7 @@ namespace for (size_t offset = 10UL; offset < length; ++offset) { Compare_Text compare_text = STR("ABCDEFGHIJKLMNOPQRSTUVWXYZ"); - TextBufferL bufferl; + TextBufferL bufferl{0}; Text text(bufferl.data(), bufferl.size()); text = STR("ABCDEFGHIJKLMNOPQRSTUVWXYZ"); @@ -1713,10 +1713,10 @@ namespace for (size_t offset = 0UL; offset <= short_text.size(); ++offset) { Compare_Text compare_text(short_text.cbegin(), short_text.cend()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.begin(), short_text.end(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text insert(insert_text.begin(), insert_text.end(), buffer2.data(), buffer2.size()); text.insert(offset, insert); @@ -1738,10 +1738,10 @@ namespace { Compare_Text compare_text(initial_text.cbegin(), initial_text.cend()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.begin(), initial_text.end(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text insert(insert_text.begin(), insert_text.end(), buffer2.data(), buffer2.size()); text.insert(offset, insert); @@ -1763,10 +1763,10 @@ namespace { Compare_Text compare_text(short_text.cbegin(), short_text.cend()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.begin(), short_text.end(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text insert(longer_text.begin(), longer_text.end(), buffer2.data(), buffer2.size()); insert.erase(insert.cbegin(), insert.cend()); @@ -1789,10 +1789,10 @@ namespace { Compare_Text compare_text(short_text.cbegin(), short_text.cend()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.begin(), short_text.end(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text insert(insert_text.begin(), insert_text.end(), buffer2.data(), buffer2.size()); text.insert(0, insert, 0, insert.size()); @@ -1839,10 +1839,10 @@ namespace { Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text append(insert_text.c_str(), buffer2.data(), buffer2.size()); // Non-overflow. @@ -1875,10 +1875,10 @@ namespace TEST_FIXTURE(SetupFixture, test_append_truncated_string) { #include "etl/private/diagnostic_array_bounds_push.h" - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); - TextBufferS buffers; + TextBufferS buffers{0}; Text append(short_text.c_str(), buffers.data(), buffers.size()); #if ETL_HAS_STRING_TRUNCATION_CHECKS CHECK(append.is_truncated()); @@ -1896,7 +1896,7 @@ namespace { Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); // Non-overflow. @@ -1929,10 +1929,10 @@ namespace { Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text append(insert_text.c_str(), buffer2.data(), buffer2.size()); // Whole string. @@ -1979,10 +1979,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_append_truncated_string_subpos_sublen) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); - TextBufferS buffer2; + TextBufferS buffer2{0}; Text append(short_text.c_str(), buffer2.data(), buffer2.size()); #if ETL_HAS_STRING_TRUNCATION_CHECKS CHECK(append.is_truncated()); @@ -2000,7 +2000,7 @@ namespace // Non-overflow. Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); // Whole string. @@ -2034,7 +2034,7 @@ namespace // Non-overflow. Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); // Non-overflow. @@ -2068,10 +2068,10 @@ namespace // Non-overflow. Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text append(insert_text.c_str(), buffer2.data(), buffer2.size()); compare_text.append(insert_text.begin(), insert_text.end()); @@ -2105,7 +2105,7 @@ namespace // Non-overflow short text, npos. Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); compare_text.replace(2, Compare_Text::npos, Compare_Text(STR("Replace"))); @@ -2209,7 +2209,7 @@ namespace // Non-overflow short text. Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, Compare_Text(STR("Replace"))); @@ -2271,7 +2271,7 @@ namespace // Non-overflow short text. Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); compare_text.replace(2, 4, Compare_Text(STR("Replace")), 1, 5); @@ -2389,7 +2389,7 @@ namespace // Non-overflow short text. Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); compare_text.replace(2, 4, Compare_Text(STR("Replace")).c_str()); @@ -2507,7 +2507,7 @@ namespace // Non-overflow short text. Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, Compare_Text(STR("Replace")).c_str()); @@ -2569,7 +2569,7 @@ namespace // Non-overflow short text. Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); compare_text.replace(2, 4, Compare_Text(STR("Replace")).c_str(), 5); @@ -2687,7 +2687,7 @@ namespace // Non-overflow short text. Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, Compare_Text(STR("Replace")).c_str(), 5); @@ -2757,7 +2757,7 @@ namespace // Non-overflow short text. Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); compare_text.replace(2, 4, 7, STR('A')); @@ -2875,7 +2875,7 @@ namespace // Non-overflow short text. Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, 7, STR('A')); @@ -2937,7 +2937,7 @@ namespace // Non-overflow short text. Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); Compare_Text replace(STR("Replace")); @@ -3000,7 +3000,7 @@ namespace TEST_FIXTURE(SetupFixture, test_erase_single_iterator) { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); Compare_Text::iterator citr = compare_text.erase(compare_text.begin() + 2); @@ -3018,7 +3018,7 @@ namespace TEST_FIXTURE(SetupFixture, test_erase_single_const_iterator) { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); Compare_Text::iterator citr = compare_text.erase(compare_text.cbegin() + 2); @@ -3036,7 +3036,7 @@ namespace TEST_FIXTURE(SetupFixture, test_erase_range) { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); Compare_Text::iterator citr = compare_text.erase(compare_text.cbegin() + 2, compare_text.cbegin() + 4); @@ -3053,7 +3053,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_clear) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); text.clear(); @@ -3068,7 +3068,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); bool is_equal = std::equal(text.begin(), text.end(), compare_text.begin()); @@ -3083,7 +3083,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); bool is_equal = std::equal(text.cbegin(), text.cend(), compare_text.cbegin()); @@ -3098,7 +3098,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); bool is_equal = std::equal(text.rbegin(), text.rend(), compare_text.rbegin()); @@ -3113,7 +3113,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); bool is_equal = std::equal(text.crbegin(), text.crend(), compare_text.crbegin()); @@ -3126,10 +3126,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_equal) { - TextBuffer buffer; + TextBuffer buffer{0}; const Text initial1(initial_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; const Text initial2(initial_text.c_str(), buffer2.data(), buffer2.size()); CHECK(initial1 == initial2); @@ -3148,10 +3148,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_not_equal) { - TextBuffer buffer; + TextBuffer buffer{0}; const Text initial1(initial_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; const Text initial2(initial_text.c_str(), buffer2.data(), buffer2.size()); CHECK(!(initial1 != initial2)); @@ -3170,10 +3170,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_less_than) { - TextBuffer buffer; + TextBuffer buffer{0}; const Text less(less_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; const Text initial(initial_text.c_str(), buffer2.data(), buffer2.size()); // String-String @@ -3210,10 +3210,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_less_than_or_equal) { - TextBuffer buffer; + TextBuffer buffer{0}; const Text less(less_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; const Text initial(initial_text.c_str(), buffer2.data(), buffer2.size()); // String-String @@ -3250,10 +3250,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_greater_than) { - TextBuffer buffer; + TextBuffer buffer{0}; const Text less(less_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; const Text initial(initial_text.c_str(), buffer2.data(), buffer2.size()); // String-String @@ -3290,10 +3290,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_greater_than_or_equal) { - TextBuffer buffer; + TextBuffer buffer{0}; const Text less(less_text.begin(), less_text.end(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; const Text initial(initial_text.begin(), initial_text.end(), buffer2.data(), buffer2.size()); // String-String @@ -3332,7 +3332,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); value_t buffer1[SIZE]; @@ -3358,7 +3358,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_copy_start_pos_too_large) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); value_t buffer1[SIZE]; @@ -3376,7 +3376,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); value_t buffer1[SIZE]; @@ -3404,7 +3404,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); value_t buffer1[SIZE]; @@ -3434,12 +3434,12 @@ namespace std::u16string compare_needle(STR("needle")); - TextBuffer buffer; + TextBuffer buffer{0}; Text needle(STR("needle"), buffer.data(), buffer.size()); std::u16string compare_haystack(the_haystack); - TextBufferL buffer2; + TextBufferL buffer2{0}; Text haystack(the_haystack, buffer2.data(), buffer2.size()); size_t position1 = 0; @@ -3470,7 +3470,7 @@ namespace std::u16string compare_haystack(the_haystack); - TextBufferL buffer; + TextBufferL buffer{0}; Text haystack(the_haystack, buffer.data(), buffer.size()); size_t position1 = 0; @@ -3501,7 +3501,7 @@ namespace std::u16string compare_haystack(the_haystack); - TextBufferL buffer; + TextBufferL buffer{0}; Text haystack(the_haystack, buffer.data(), buffer.size()); size_t position1 = 0; @@ -3530,12 +3530,12 @@ namespace std::u16string compare_needle(STR("needle")); - TextBufferL buffer; + TextBufferL buffer{0}; Text needle(STR("needle"), buffer.data(), buffer.size()); std::u16string compare_haystack(the_haystack); - TextBufferL buffer2; + TextBufferL buffer2{0}; Text haystack(the_haystack, buffer2.data(), buffer2.size()); size_t position1 = std::u16string::npos; @@ -3562,7 +3562,7 @@ namespace std::u16string compare_haystack(the_haystack); - TextBufferL buffer; + TextBufferL buffer{0}; Text haystack(the_haystack, buffer.data(), buffer.size()); const value_t* needle = STR("needle"); @@ -3578,7 +3578,7 @@ namespace position2 = haystack.rfind(needle, haystack.size() - 10); CHECK_EQUAL(position1, position2); - TextBufferL buffer2; + TextBufferL buffer2{0}; Text pin(STR("pin"), buffer2.data(), buffer2.size()); position2 = haystack.rfind(pin); CHECK_EQUAL(IText::npos, position2); @@ -3591,7 +3591,7 @@ namespace std::u16string compare_haystack(the_haystack); - TextBufferL buffer; + TextBufferL buffer{0}; Text haystack(the_haystack, buffer.data(), buffer.size()); const value_t* needle = STR("needle"); @@ -3619,7 +3619,7 @@ namespace std::u16string compare_haystack(the_haystack); - TextBufferL buffer; + TextBufferL buffer{0}; Text haystack(the_haystack, buffer.data(), buffer.size()); size_t position1 = std::u16string::npos; @@ -3642,7 +3642,7 @@ namespace { Compare_Text compare_text(STR("ABCDEF")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEF"), buffer.data(), buffer.size()); int compare_result; @@ -3679,7 +3679,7 @@ namespace { Compare_Text compare_text(STR("xxxABCDEFyyy")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("xxxABCDEFyyy"), buffer.data(), buffer.size()); int compare_result; @@ -3716,7 +3716,7 @@ namespace { Compare_Text compare_text(STR("xxxABCDEFyyy")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("xxxABCDEFyyy"), buffer.data(), buffer.size()); int compare_result; @@ -3753,7 +3753,7 @@ namespace { Compare_Text compare_text(STR("ABCDEF")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEF"), buffer.data(), buffer.size()); int compare_result; @@ -3790,7 +3790,7 @@ namespace { Compare_Text compare_text(STR("xxxABCDEFyyy")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("xxxABCDEFyyy"), buffer.data(), buffer.size()); int compare_result; @@ -3827,7 +3827,7 @@ namespace { Compare_Text compare_text(STR("xxxABCDEFyyy")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("xxxABCDEFyyy"), buffer.data(), buffer.size()); int compare_result; @@ -3864,7 +3864,7 @@ namespace { Compare_Text compare_text(STR("ABCDEF")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEF"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_first_of(Compare_Text(STR("ZCXF"))); @@ -3895,7 +3895,7 @@ namespace { Compare_Text compare_text(STR("ABCDEF")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEF"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_first_of(STR("ZCXF")); @@ -3926,7 +3926,7 @@ namespace { Compare_Text compare_text(STR("ABCDEF")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEF"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_first_of(STR("ZCXF"), 0, 4); @@ -3962,7 +3962,7 @@ namespace { Compare_Text compare_text(STR("ABCDEF")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEF"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_first_of(STR('C')); @@ -4003,7 +4003,7 @@ namespace { Compare_Text compare_text(STR("ABCDEFABCDE")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEFABCDE"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_last_of(Compare_Text(STR("ZCXE"))); @@ -4039,7 +4039,7 @@ namespace { Compare_Text compare_text(STR("ABCDEFABCDE")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEFABCDE"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_last_of(STR("ZCXE")); @@ -4080,7 +4080,7 @@ namespace { Compare_Text compare_text(STR("ABCDEFABCDE")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEFABCDE"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_last_of(STR("AZCXE"), 0, 4); @@ -4119,7 +4119,7 @@ namespace { Compare_Text compare_text(STR("ABCDEF")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEF"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_last_of(STR('C')); @@ -4160,7 +4160,7 @@ namespace { Compare_Text compare_text(STR("ABCDEF")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEF"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_first_not_of(Compare_Text(STR("ZAXB"))); @@ -4196,7 +4196,7 @@ namespace { Compare_Text compare_text(STR("ABCDEF")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEF"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_first_not_of(STR("ZAXB")); @@ -4232,7 +4232,7 @@ namespace { Compare_Text compare_text(STR("ABCDEF")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEF"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_first_not_of(STR("ZAXB"), 0, 4); @@ -4273,7 +4273,7 @@ namespace { Compare_Text compare_text(STR("ABCDEF")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEF"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_first_not_of(STR('A')); @@ -4314,7 +4314,7 @@ namespace { Compare_Text compare_text(STR("ABCDEFABCDE")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEFABCDE"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_last_not_of(Compare_Text(STR("ZEXD"))); @@ -4350,7 +4350,7 @@ namespace { Compare_Text compare_text(STR("ABCDEFABCDE")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEFABCDE"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_last_not_of(STR("ZEXD")); @@ -4386,7 +4386,7 @@ namespace { Compare_Text compare_text(STR("ABCDEFABCDE")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEFABCDE"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_last_not_of(STR("ZEXD"), 0, 4); @@ -4420,7 +4420,7 @@ namespace { Compare_Text compare_text(STR("ABCDEF")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEF"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_last_not_of(STR('F')); @@ -4460,7 +4460,7 @@ namespace TEST_FIXTURE(SetupFixture, test_hash) { // Test with actual string type. - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEFHIJKL"), buffer.data(), buffer.size()); size_t hash = etl::hash()(text); size_t compare_hash = etl::private_hash::generic_hash(reinterpret_cast(&text[0]), reinterpret_cast(&text[text.size()])); @@ -4475,7 +4475,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_memcpy_repair) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.assign(STR("ABCDEF")); @@ -4502,7 +4502,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_memcpy_repair_virtual) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.assign(STR("ABCDEF")); @@ -4530,7 +4530,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_truncate_over_many_operations) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); CHECK(!text.is_truncated()); @@ -4556,10 +4556,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_add_from_truncated) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text1(short_text.c_str(), buffer.data(), buffer.size()); - TextBufferS buffers; + TextBufferS buffers{0}; Text text2(short_text.c_str(), buffers.data(), buffers.size()); CHECK(!text1.is_truncated()); @@ -4574,10 +4574,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_add_to_truncated) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text1(longer_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text text2(short_text.c_str(), buffer2.data(), buffer2.size()); CHECK(text1.is_truncated()); @@ -4595,7 +4595,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_clear_truncated) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(longer_text.c_str(), buffer.data(), buffer.size()); CHECK(text.is_truncated()); @@ -4611,7 +4611,7 @@ namespace char buffer[sizeof(Text)]; std::fill_n(buffer, sizeof(Text), 0); - TextBuffer buffer2; + TextBuffer buffer2{0}; ::new (buffer) Text(STR("ABCDEF"), buffer2.data(), buffer2.size()); Text& text = *reinterpret_cast(buffer); @@ -4632,7 +4632,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_secure_after_assign) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.set_secure(); text.assign(STR("ABCDEF")); @@ -4647,7 +4647,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_secure_after_resize_down) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.set_secure(); text.assign(STR("ABCDEF")); @@ -4662,7 +4662,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_secure_after_erase) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.set_secure(); text.assign(STR("ABCDEF")); @@ -4679,7 +4679,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_secure_after_replace) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.set_secure(); text.assign(STR("ABCDEF")); @@ -4696,7 +4696,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_secure_after_clear) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.set_secure(); text.assign(STR("ABCDEF")); @@ -4713,11 +4713,11 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_secure_flag_after_copy) { - TextBuffer buffer1; + TextBuffer buffer1{0}; Text text1(STR("Hello World"), buffer1.data(), buffer1.size()); text1.set_secure(); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text text2(text1, buffer2.data(), buffer2.size()); TextBuffer buffer3; @@ -4736,8 +4736,8 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_initialize_free_space_empty_string) { - TextBuffer buffer1; - TextBuffer buffer2; + TextBuffer buffer1{0}; + TextBuffer buffer2{0}; Text text(buffer1.data(), buffer1.size()); Text empty(buffer2.data(), buffer2.size()); @@ -4755,8 +4755,8 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_initialize_free_space_part_filled_string) { - TextBuffer buffer1; - TextBuffer buffer2; + TextBuffer buffer1{0}; + TextBuffer buffer2{0}; Text initial(STR("ABC"), buffer1.data(), buffer1.size()); Text empty(buffer2.data(), buffer2.size()); Text text(initial, buffer2.data(), buffer2.size()); @@ -4775,7 +4775,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_update_after_c_string_max_size) { - TextBuffer buffer1; + TextBuffer buffer1{0}; Text text(buffer1.data(), buffer1.size()); text.initialize_free_space(); @@ -4791,7 +4791,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_update_after_c_string_shorter_size) { - TextBuffer buffer1; + TextBuffer buffer1{0}; Text text(buffer1.data(), buffer1.size()); text.initialize_free_space(); @@ -4807,7 +4807,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_update_after_c_string_greater_size) { - TextBuffer buffer1; + TextBuffer buffer1{0}; Text text(buffer1.data(), buffer1.size()); text.initialize_free_space(); diff --git a/test/test_string_u32_external_buffer.cpp b/test/test_string_u32_external_buffer.cpp index 17f6fa48..c991d550 100644 --- a/test/test_string_u32_external_buffer.cpp +++ b/test/test_string_u32_external_buffer.cpp @@ -120,7 +120,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_default_constructor) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); CHECK_EQUAL(text.size(), size_t(0)); @@ -197,7 +197,7 @@ namespace //************************************************************************* TEST(test_iterator_comparison_empty) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); CHECK(text.begin() == text.end()); @@ -214,7 +214,7 @@ namespace { const size_t INITIAL_SIZE = 5; const value_t INITIAL_VALUE = STR('A'); - TextBuffer buffer; + TextBuffer buffer{0}; Compare_Text compare_text(INITIAL_SIZE, INITIAL_VALUE); Text text(INITIAL_SIZE, INITIAL_VALUE, buffer.data(), buffer.size()); @@ -233,7 +233,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_constructor_size_excess) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.size() + 1, STR('A'), buffer.data(), buffer.size()); CHECK_EQUAL(buffer.size() - 1, text.size()); @@ -245,7 +245,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_constructor_char_pointer) { - TextBuffer buffer; + TextBuffer buffer{0}; Compare_Text compare_text(initial_text.c_str()); Text text(initial_text.c_str(), buffer.data(), buffer.size()); @@ -264,7 +264,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(longer_text.c_str(), buffer.data(), buffer.size()); CHECK(!text.empty()); @@ -281,7 +281,7 @@ namespace { Compare_Text compare_text(SIZE, STR('A')); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(SIZE, STR('A'), buffer.data(), buffer.size()); CHECK(!text.empty()); @@ -298,7 +298,7 @@ namespace { Compare_Text compare_text(SIZE, STR('A')); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(SIZE + 1, STR('A'), buffer.data(), buffer.size()); CHECK(!text.empty()); @@ -315,7 +315,7 @@ namespace { Compare_Text compare_text(initial_text.c_str(), initial_text.size() / 2); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), initial_text.size() / 2, buffer.data(), buffer.size()); CHECK(!text.empty()); @@ -332,7 +332,7 @@ namespace { Compare_Text compare_text(initial_text.c_str(), initial_text.size()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(longer_text.c_str(), longer_text.size(), buffer.data(), buffer.size()); CHECK(!text.empty()); @@ -349,7 +349,7 @@ namespace { Compare_Text compare_text(initial_text.begin(), initial_text.end()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(compare_text.begin(), compare_text.end(), buffer.data(), buffer.size()); CHECK(text.size() == SIZE); @@ -362,7 +362,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_constructor_range_excess) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(longer_text.begin(), longer_text.end(), buffer.data(), buffer.size()); bool is_equal = Equal(initial_text, text); @@ -377,7 +377,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_constructor_from_literal) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("Hello World"), buffer.data(), buffer.size()); bool is_equal = Equal(initial_text, text); @@ -391,7 +391,7 @@ namespace { etl::u32string_view view(initial_text.data(), initial_text.size()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(view, buffer.data(), buffer.size()); bool is_equal = Equal(initial_text, text); @@ -403,10 +403,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_copy_constructor) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text text2(text, buffer2.data(), buffer2.size()); CHECK(text2 == text); #if ETL_HAS_STRING_TRUNCATION_CHECKS @@ -417,11 +417,11 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_copy_constructor_i) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); IText& itext = text; - TextBuffer buffer2; + TextBuffer buffer2{0}; Text text2(itext, buffer2.data(), buffer2.size()); CHECK(text2 == text); #if ETL_HAS_STRING_TRUNCATION_CHECKS @@ -432,13 +432,13 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_copy_constructor_excess) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); - TextBufferL bufferl; + TextBufferL bufferl{0}; Text textl(longer_text.c_str(), bufferl.data(), bufferl.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text text2(textl, buffer2.data(), buffer2.size()); CHECK(text2 == text); #if ETL_HAS_STRING_TRUNCATION_CHECKS @@ -449,10 +449,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_copy_constructor_from_truncated) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(longer_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text text2(text, buffer2.data(), buffer2.size()); #if ETL_HAS_STRING_TRUNCATION_CHECKS @@ -466,10 +466,10 @@ namespace Compare_Text compare_text(initial_text.c_str()); Compare_Text compare_text2(compare_text, 2, 4); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text text2(text, buffer2.data(), buffer2.size(), 2, 4); bool is_equal = Equal(compare_text2, text2); @@ -485,10 +485,10 @@ namespace Compare_Text compare_text(longer_text.c_str()); Compare_Text compare_text2(compare_text, 2, 11); - TextBufferL bufferl; + TextBufferL bufferl{0}; Text textl(longer_text.c_str(), bufferl.data(), bufferl.size()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text2(textl, buffer.data(), buffer.size(), 2, 12); bool is_equal = Equal(compare_text2, text2); @@ -505,7 +505,7 @@ namespace Compare_Text compare_text = { STR('H'), STR('e'), STR('l') , STR('l') , STR('o') }; std::initializer_list il = { STR('H'), STR('e'), STR('l') , STR('l') , STR('o') }; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(il, buffer.data(), buffer.size()); bool is_equal = Equal(compare_text, text); @@ -524,7 +524,7 @@ namespace std::initializer_list il = { STR('H'), STR('e'), STR('l'), STR('l'), STR('o'), STR(' '), STR('W'), STR('o'), STR('r'), STR('l'), STR('d'), STR(' '), STR('T'), STR('h'), STR('e'), STR('r'), STR('e') }; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(il, buffer.data(), buffer.size()); bool is_equal = Equal(compare_text, text); @@ -538,10 +538,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_assignment) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.begin(), initial_text.end(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text other_text(buffer2.data(), buffer2.size()); other_text = text; @@ -557,10 +557,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_assignment_excess) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(longer_text.begin(), longer_text.end(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text other_text(buffer2.data(), buffer2.size()); other_text = text; @@ -576,10 +576,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_assignment_iterface) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text1(initial_text.begin(), initial_text.end(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text text2(buffer2.data(), buffer2.size()); IText& itext1 = text1; @@ -599,10 +599,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_assignment_iterface_excess) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text1(longer_text.begin(), longer_text.end(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text text2(buffer2.data(), buffer2.size()); IText& itext1 = text1; @@ -622,10 +622,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_self_assignment) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.begin(), initial_text.end(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text other_text(text, buffer2.data(), buffer2.size()); #include "etl/private/diagnostic_self_assign_overloaded_push.h" @@ -644,10 +644,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_self_assignment_excess) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(longer_text.begin(), longer_text.end(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text other_text(text, buffer2.data(), buffer2.size()); #include "etl/private/diagnostic_self_assign_overloaded_push.h" @@ -666,7 +666,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_assignment_from_literal) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text = STR("Hello World"); @@ -681,7 +681,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_assignment_from_literal_excess) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text = STR("Hello World There"); @@ -696,7 +696,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_assignment_from_literal_via_interface) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); IText& itext = text; @@ -712,7 +712,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_assignment_from_literal_via_interface_excess) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); IText& itext = text; @@ -728,10 +728,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_begin) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; const Text constText(initial_text.c_str(), buffer2.data(), buffer2.size()); CHECK_EQUAL(&text[0], text.begin()); @@ -741,10 +741,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_end) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; const Text constText(initial_text.c_str(), buffer2.data(), buffer2.size()); CHECK_EQUAL(&text[initial_text.size()], text.end()); @@ -757,7 +757,7 @@ namespace const size_t INITIAL_SIZE = 5; const size_t NEW_SIZE = 8; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), INITIAL_SIZE, buffer.data(), buffer.size()); text.resize(NEW_SIZE); @@ -774,7 +774,7 @@ namespace const size_t NEW_SIZE = 8; const value_t INITIAL_VALUE = STR('A'); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(INITIAL_SIZE, INITIAL_VALUE, buffer.data(), buffer.size()); text.resize(NEW_SIZE, INITIAL_VALUE); @@ -795,7 +795,7 @@ namespace const size_t INITIAL_SIZE = 5; const size_t NEW_SIZE = SIZE + 1; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(INITIAL_SIZE, STR('A'), buffer.data(), buffer.size()); text.resize(NEW_SIZE, STR('A')); CHECK_EQUAL(SIZE, text.size()); @@ -810,7 +810,7 @@ namespace const size_t INITIAL_SIZE = 5; const size_t NEW_SIZE = 2; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(INITIAL_SIZE, STR('A'), buffer.data(), buffer.size()); text.resize(NEW_SIZE); @@ -827,7 +827,7 @@ namespace const size_t NEW_SIZE = 2; const value_t INITIAL_VALUE = STR('A'); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(INITIAL_SIZE, INITIAL_VALUE, buffer.data(), buffer.size()); text.resize(NEW_SIZE, INITIAL_VALUE); @@ -851,7 +851,7 @@ namespace const value_t INITIAL_VALUE = STR('A'); const value_t FILL_VALUE = STR('B'); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(INITIAL_SIZE, INITIAL_VALUE, buffer.data(), buffer.size()); Text::pointer pbegin = &text.front(); @@ -879,7 +879,7 @@ namespace const size_t INITIAL_SIZE = 5; const size_t NEW_SIZE = SIZE + 1; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(INITIAL_SIZE, STR('A'), buffer.data(), buffer.size()); text.uninitialized_resize(NEW_SIZE); @@ -895,7 +895,7 @@ namespace const value_t INITIAL_VALUE = STR('A'); const value_t FILL_VALUE = STR('B'); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(INITIAL_SIZE, INITIAL_VALUE, buffer.data(), buffer.size()); Text::pointer pbegin = &text.front(); @@ -919,7 +919,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_empty_full) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.resize(text.max_size(), STR('A')); @@ -932,7 +932,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_empty_half) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.resize(text.max_size() / 2, STR('A')); @@ -945,7 +945,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_empty_empty) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); CHECK(text.empty()); @@ -957,7 +957,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_full_full) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.resize(text.max_size(), STR('A')); @@ -970,7 +970,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_full_half) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.resize(text.max_size() / 2, STR('A')); @@ -983,7 +983,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_full_empty) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); CHECK(!text.full()); @@ -997,7 +997,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); for (size_t i = 0UL; i < text.size(); ++i) @@ -1015,7 +1015,7 @@ namespace { const Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; const Text text(initial_text.c_str(), buffer.data(), buffer.size()); for (size_t i = 0UL; i < text.size(); ++i) @@ -1033,7 +1033,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); for (size_t i = 0UL; i < text.size(); ++i) @@ -1053,7 +1053,7 @@ namespace { const Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; const Text text(initial_text.c_str(), buffer.data(), buffer.size()); for (size_t i = 0UL; i < text.size(); ++i) @@ -1073,7 +1073,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); CHECK(text.front() == compare_text.front()); @@ -1087,7 +1087,7 @@ namespace { const Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; const Text text(initial_text.c_str(), buffer.data(), buffer.size()); CHECK(text.front() == compare_text.front()); @@ -1101,7 +1101,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); CHECK(text.back() == compare_text.back()); @@ -1115,7 +1115,7 @@ namespace { const Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; const Text text(initial_text.c_str(), buffer.data(), buffer.size()); CHECK(text.back() == compare_text.back()); @@ -1129,7 +1129,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(compare_text.begin(), compare_text.end(), buffer.data(), buffer.size()); bool is_equal = std::equal(text.data(), @@ -1147,7 +1147,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; const Text text(compare_text.begin(), compare_text.end(), buffer.data(), buffer.size()); bool is_equal = std::equal(text.data(), @@ -1165,12 +1165,12 @@ namespace { Compare_Text compare_input(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text input(initial_text.c_str(), buffer.data(), buffer.size()); Compare_Text compare_text; - TextBuffer buffer2; + TextBuffer buffer2{0}; Text text(buffer2.data(), buffer2.size()); compare_text.assign(compare_input); @@ -1188,12 +1188,12 @@ namespace { Compare_Text compare_input(initial_text.c_str()); - TextBufferL bufferl; + TextBufferL bufferl{0}; Text input(longer_text.c_str(), bufferl.data(), bufferl.size()); Compare_Text compare_text; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); compare_text.assign(compare_input); @@ -1211,7 +1211,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.assign(initial_text.c_str()); @@ -1227,7 +1227,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.assign(longer_text.c_str()); @@ -1243,7 +1243,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.assign(initial_text.c_str(), initial_text.size()); @@ -1259,7 +1259,7 @@ namespace { Compare_Text compare_text(longer_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.assign(longer_text.c_str(), longer_text.size()); @@ -1277,7 +1277,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.assign(compare_text.begin(), compare_text.end()); @@ -1292,7 +1292,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_assign_range_excess) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.assign(longer_text.begin(), longer_text.end()); @@ -1315,7 +1315,7 @@ namespace std::array compare_text; compare_text.fill(INITIAL_VALUE); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.assign(INITIAL_SIZE, INITIAL_VALUE); @@ -1337,7 +1337,7 @@ namespace std::array compare_text; compare_text.fill(INITIAL_VALUE); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.assign(EXCESS_SIZE, INITIAL_VALUE); @@ -1353,7 +1353,7 @@ namespace { Compare_Text compare_text; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); for (size_t i = 0UL; i < SIZE; ++i) @@ -1381,7 +1381,7 @@ namespace { Compare_Text compare_text; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); for (size_t i = 0UL; i < SIZE; ++i) @@ -1414,7 +1414,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); compare_text.pop_back(); @@ -1440,7 +1440,7 @@ namespace { Compare_Text compare_text; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.assign(initial_text.begin(), initial_text.begin() + INITIAL_SIZE); @@ -1461,7 +1461,7 @@ namespace TEST_FIXTURE(SetupFixture, test_insert_position_value_excess) { Compare_Text compare_text(initial_text.begin(), initial_text.end()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.begin(), initial_text.end(), buffer.data(), buffer.size()); const value_t INITIAL_VALUE = STR('A'); @@ -1507,7 +1507,7 @@ namespace TEST_FIXTURE(SetupFixture, test_insert_position_n_value) { Compare_Text compare_text; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); const size_t INITIAL_SIZE = 5UL; @@ -1534,7 +1534,7 @@ namespace TEST_FIXTURE(SetupFixture, test_insert_position_n_value_excess) { Compare_Text compare_text; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); const size_t INSERT_SIZE = 4UL; @@ -1608,7 +1608,7 @@ namespace for (size_t offset = 0UL; offset <= INITIAL_SIZE; ++offset) { Compare_Text compare_text; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.assign(initial_text.cbegin(), initial_text.cbegin() + INITIAL_SIZE); @@ -1632,7 +1632,7 @@ namespace const value_t INITIAL_VALUE = STR('A'); Compare_Text compare_text; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); size_t offset = 0UL; @@ -1691,7 +1691,7 @@ namespace for (size_t offset = 10UL; offset < length; ++offset) { Compare_Text compare_text = STR("ABCDEFGHIJKLMNOPQRSTUVWXYZ"); - TextBufferL bufferl; + TextBufferL bufferl{0}; Text text(bufferl.data(), bufferl.size()); text = STR("ABCDEFGHIJKLMNOPQRSTUVWXYZ"); @@ -1712,10 +1712,10 @@ namespace for (size_t offset = 0UL; offset <= short_text.size(); ++offset) { Compare_Text compare_text(short_text.cbegin(), short_text.cend()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.begin(), short_text.end(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text insert(insert_text.begin(), insert_text.end(), buffer2.data(), buffer2.size()); text.insert(offset, insert); @@ -1737,10 +1737,10 @@ namespace { Compare_Text compare_text(initial_text.cbegin(), initial_text.cend()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.begin(), initial_text.end(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text insert(insert_text.begin(), insert_text.end(), buffer2.data(), buffer2.size()); text.insert(offset, insert); @@ -1762,10 +1762,10 @@ namespace { Compare_Text compare_text(short_text.cbegin(), short_text.cend()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.begin(), short_text.end(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text insert(longer_text.begin(), longer_text.end(), buffer2.data(), buffer2.size()); insert.erase(insert.cbegin(), insert.cend()); @@ -1788,10 +1788,10 @@ namespace { Compare_Text compare_text(short_text.cbegin(), short_text.cend()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.begin(), short_text.end(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text insert(insert_text.begin(), insert_text.end(), buffer2.data(), buffer2.size()); text.insert(0, insert, 0, insert.size()); @@ -1838,10 +1838,10 @@ namespace { Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text append(insert_text.c_str(), buffer2.data(), buffer2.size()); // Non-overflow. @@ -1874,10 +1874,10 @@ namespace TEST_FIXTURE(SetupFixture, test_append_truncated_string) { #include "etl/private/diagnostic_array_bounds_push.h" - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); - TextBufferS buffers; + TextBufferS buffers{0}; Text append(short_text.c_str(), buffers.data(), buffers.size()); #if ETL_HAS_STRING_TRUNCATION_CHECKS CHECK(append.is_truncated()); @@ -1895,7 +1895,7 @@ namespace { Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); // Non-overflow. @@ -1928,10 +1928,10 @@ namespace { Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text append(insert_text.c_str(), buffer2.data(), buffer2.size()); // Whole string. @@ -1978,10 +1978,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_append_truncated_string_subpos_sublen) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); - TextBufferS buffer2; + TextBufferS buffer2{0}; Text append(short_text.c_str(), buffer2.data(), buffer2.size()); #if ETL_HAS_STRING_TRUNCATION_CHECKS CHECK(append.is_truncated()); @@ -1999,7 +1999,7 @@ namespace // Non-overflow. Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); // Whole string. @@ -2033,7 +2033,7 @@ namespace // Non-overflow. Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); // Non-overflow. @@ -2067,10 +2067,10 @@ namespace // Non-overflow. Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text append(insert_text.c_str(), buffer2.data(), buffer2.size()); compare_text.append(insert_text.begin(), insert_text.end()); @@ -2104,7 +2104,7 @@ namespace // Non-overflow short text, npos. Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); compare_text.replace(2, Compare_Text::npos, Compare_Text(STR("Replace"))); @@ -2208,7 +2208,7 @@ namespace // Non-overflow short text. Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, Compare_Text(STR("Replace"))); @@ -2270,7 +2270,7 @@ namespace // Non-overflow short text. Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); compare_text.replace(2, 4, Compare_Text(STR("Replace")), 1, 5); @@ -2388,7 +2388,7 @@ namespace // Non-overflow short text. Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); compare_text.replace(2, 4, Compare_Text(STR("Replace")).c_str()); @@ -2506,7 +2506,7 @@ namespace // Non-overflow short text. Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, Compare_Text(STR("Replace")).c_str()); @@ -2568,7 +2568,7 @@ namespace // Non-overflow short text. Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); compare_text.replace(2, 4, Compare_Text(STR("Replace")).c_str(), 5); @@ -2686,7 +2686,7 @@ namespace // Non-overflow short text. Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, Compare_Text(STR("Replace")).c_str(), 5); @@ -2756,7 +2756,7 @@ namespace // Non-overflow short text. Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); compare_text.replace(2, 4, 7, STR('A')); @@ -2874,7 +2874,7 @@ namespace // Non-overflow short text. Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, 7, STR('A')); @@ -2936,7 +2936,7 @@ namespace // Non-overflow short text. Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); Compare_Text replace(STR("Replace")); @@ -2999,7 +2999,7 @@ namespace TEST_FIXTURE(SetupFixture, test_erase_single_iterator) { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); Compare_Text::iterator citr = compare_text.erase(compare_text.begin() + 2); @@ -3017,7 +3017,7 @@ namespace TEST_FIXTURE(SetupFixture, test_erase_single_const_iterator) { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); Compare_Text::iterator citr = compare_text.erase(compare_text.cbegin() + 2); @@ -3035,7 +3035,7 @@ namespace TEST_FIXTURE(SetupFixture, test_erase_range) { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); Compare_Text::iterator citr = compare_text.erase(compare_text.cbegin() + 2, compare_text.cbegin() + 4); @@ -3052,7 +3052,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_clear) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); text.clear(); @@ -3067,7 +3067,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); bool is_equal = std::equal(text.begin(), text.end(), compare_text.begin()); @@ -3082,7 +3082,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); bool is_equal = std::equal(text.cbegin(), text.cend(), compare_text.cbegin()); @@ -3097,7 +3097,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); bool is_equal = std::equal(text.rbegin(), text.rend(), compare_text.rbegin()); @@ -3112,7 +3112,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); bool is_equal = std::equal(text.crbegin(), text.crend(), compare_text.crbegin()); @@ -3125,10 +3125,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_equal) { - TextBuffer buffer; + TextBuffer buffer{0}; const Text initial1(initial_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; const Text initial2(initial_text.c_str(), buffer2.data(), buffer2.size()); CHECK(initial1 == initial2); @@ -3147,10 +3147,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_not_equal) { - TextBuffer buffer; + TextBuffer buffer{0}; const Text initial1(initial_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; const Text initial2(initial_text.c_str(), buffer2.data(), buffer2.size()); CHECK(!(initial1 != initial2)); @@ -3169,10 +3169,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_less_than) { - TextBuffer buffer; + TextBuffer buffer{0}; const Text less(less_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; const Text initial(initial_text.c_str(), buffer2.data(), buffer2.size()); // String-String @@ -3209,10 +3209,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_less_than_or_equal) { - TextBuffer buffer; + TextBuffer buffer{0}; const Text less(less_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; const Text initial(initial_text.c_str(), buffer2.data(), buffer2.size()); // String-String @@ -3249,10 +3249,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_greater_than) { - TextBuffer buffer; + TextBuffer buffer{0}; const Text less(less_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; const Text initial(initial_text.c_str(), buffer2.data(), buffer2.size()); // String-String @@ -3289,10 +3289,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_greater_than_or_equal) { - TextBuffer buffer; + TextBuffer buffer{0}; const Text less(less_text.begin(), less_text.end(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; const Text initial(initial_text.begin(), initial_text.end(), buffer2.data(), buffer2.size()); // String-String @@ -3331,7 +3331,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); value_t buffer1[SIZE]; @@ -3357,7 +3357,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_copy_start_pos_too_large) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); value_t buffer1[SIZE]; @@ -3375,7 +3375,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); value_t buffer1[SIZE]; @@ -3403,7 +3403,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); value_t buffer1[SIZE]; @@ -3433,12 +3433,12 @@ namespace std::u32string compare_needle(STR("needle")); - TextBuffer buffer; + TextBuffer buffer{0}; Text needle(STR("needle"), buffer.data(), buffer.size()); std::u32string compare_haystack(the_haystack); - TextBufferL buffer2; + TextBufferL buffer2{0}; Text haystack(the_haystack, buffer2.data(), buffer2.size()); size_t position1 = 0; @@ -3469,7 +3469,7 @@ namespace std::u32string compare_haystack(the_haystack); - TextBufferL buffer; + TextBufferL buffer{0}; Text haystack(the_haystack, buffer.data(), buffer.size()); size_t position1 = 0; @@ -3500,7 +3500,7 @@ namespace std::u32string compare_haystack(the_haystack); - TextBufferL buffer; + TextBufferL buffer{0}; Text haystack(the_haystack, buffer.data(), buffer.size()); size_t position1 = 0; @@ -3529,12 +3529,12 @@ namespace std::u32string compare_needle(STR("needle")); - TextBufferL buffer; + TextBufferL buffer{0}; Text needle(STR("needle"), buffer.data(), buffer.size()); std::u32string compare_haystack(the_haystack); - TextBufferL buffer2; + TextBufferL buffer2{0}; Text haystack(the_haystack, buffer2.data(), buffer2.size()); size_t position1 = std::u32string::npos; @@ -3561,7 +3561,7 @@ namespace std::u32string compare_haystack(the_haystack); - TextBufferL buffer; + TextBufferL buffer{0}; Text haystack(the_haystack, buffer.data(), buffer.size()); const value_t* needle = STR("needle"); @@ -3577,7 +3577,7 @@ namespace position2 = haystack.rfind(needle, haystack.size() - 10); CHECK_EQUAL(position1, position2); - TextBufferL buffer2; + TextBufferL buffer2{0}; Text pin(STR("pin"), buffer2.data(), buffer2.size()); position2 = haystack.rfind(pin); CHECK_EQUAL(IText::npos, position2); @@ -3590,7 +3590,7 @@ namespace std::u32string compare_haystack(the_haystack); - TextBufferL buffer; + TextBufferL buffer{0}; Text haystack(the_haystack, buffer.data(), buffer.size()); const value_t* needle = STR("needle"); @@ -3618,7 +3618,7 @@ namespace std::u32string compare_haystack(the_haystack); - TextBufferL buffer; + TextBufferL buffer{0}; Text haystack(the_haystack, buffer.data(), buffer.size()); size_t position1 = std::u32string::npos; @@ -3641,7 +3641,7 @@ namespace { Compare_Text compare_text(STR("ABCDEF")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEF"), buffer.data(), buffer.size()); int compare_result; @@ -3678,7 +3678,7 @@ namespace { Compare_Text compare_text(STR("xxxABCDEFyyy")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("xxxABCDEFyyy"), buffer.data(), buffer.size()); int compare_result; @@ -3715,7 +3715,7 @@ namespace { Compare_Text compare_text(STR("xxxABCDEFyyy")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("xxxABCDEFyyy"), buffer.data(), buffer.size()); int compare_result; @@ -3752,7 +3752,7 @@ namespace { Compare_Text compare_text(STR("ABCDEF")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEF"), buffer.data(), buffer.size()); int compare_result; @@ -3789,7 +3789,7 @@ namespace { Compare_Text compare_text(STR("xxxABCDEFyyy")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("xxxABCDEFyyy"), buffer.data(), buffer.size()); int compare_result; @@ -3826,7 +3826,7 @@ namespace { Compare_Text compare_text(STR("xxxABCDEFyyy")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("xxxABCDEFyyy"), buffer.data(), buffer.size()); int compare_result; @@ -3863,7 +3863,7 @@ namespace { Compare_Text compare_text(STR("ABCDEF")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEF"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_first_of(Compare_Text(STR("ZCXF"))); @@ -3894,7 +3894,7 @@ namespace { Compare_Text compare_text(STR("ABCDEF")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEF"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_first_of(STR("ZCXF")); @@ -3925,7 +3925,7 @@ namespace { Compare_Text compare_text(STR("ABCDEF")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEF"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_first_of(STR("ZCXF"), 0, 4); @@ -3961,7 +3961,7 @@ namespace { Compare_Text compare_text(STR("ABCDEF")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEF"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_first_of(STR('C')); @@ -4002,7 +4002,7 @@ namespace { Compare_Text compare_text(STR("ABCDEFABCDE")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEFABCDE"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_last_of(Compare_Text(STR("ZCXE"))); @@ -4038,7 +4038,7 @@ namespace { Compare_Text compare_text(STR("ABCDEFABCDE")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEFABCDE"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_last_of(STR("ZCXE")); @@ -4079,7 +4079,7 @@ namespace { Compare_Text compare_text(STR("ABCDEFABCDE")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEFABCDE"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_last_of(STR("AZCXE"), 0, 4); @@ -4118,7 +4118,7 @@ namespace { Compare_Text compare_text(STR("ABCDEF")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEF"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_last_of(STR('C')); @@ -4159,7 +4159,7 @@ namespace { Compare_Text compare_text(STR("ABCDEF")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEF"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_first_not_of(Compare_Text(STR("ZAXB"))); @@ -4195,7 +4195,7 @@ namespace { Compare_Text compare_text(STR("ABCDEF")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEF"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_first_not_of(STR("ZAXB")); @@ -4231,7 +4231,7 @@ namespace { Compare_Text compare_text(STR("ABCDEF")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEF"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_first_not_of(STR("ZAXB"), 0, 4); @@ -4272,7 +4272,7 @@ namespace { Compare_Text compare_text(STR("ABCDEF")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEF"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_first_not_of(STR('A')); @@ -4313,7 +4313,7 @@ namespace { Compare_Text compare_text(STR("ABCDEFABCDE")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEFABCDE"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_last_not_of(Compare_Text(STR("ZEXD"))); @@ -4349,7 +4349,7 @@ namespace { Compare_Text compare_text(STR("ABCDEFABCDE")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEFABCDE"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_last_not_of(STR("ZEXD")); @@ -4385,7 +4385,7 @@ namespace { Compare_Text compare_text(STR("ABCDEFABCDE")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEFABCDE"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_last_not_of(STR("ZEXD"), 0, 4); @@ -4419,7 +4419,7 @@ namespace { Compare_Text compare_text(STR("ABCDEF")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEF"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_last_not_of(STR('F')); @@ -4459,7 +4459,7 @@ namespace TEST_FIXTURE(SetupFixture, test_hash) { // Test with actual string type. - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEFHIJKL"), buffer.data(), buffer.size()); size_t hash = etl::hash()(text); size_t compare_hash = etl::private_hash::generic_hash(reinterpret_cast(&text[0]), reinterpret_cast(&text[text.size()])); @@ -4474,7 +4474,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_memcpy_repair) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.assign(STR("ABCDEF")); @@ -4501,7 +4501,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_memcpy_repair_virtual) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.assign(STR("ABCDEF")); @@ -4529,7 +4529,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_truncate_over_many_operations) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); CHECK(!text.is_truncated()); @@ -4555,10 +4555,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_add_from_truncated) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text1(short_text.c_str(), buffer.data(), buffer.size()); - TextBufferS buffers; + TextBufferS buffers{0}; Text text2(short_text.c_str(), buffers.data(), buffers.size()); CHECK(!text1.is_truncated()); @@ -4573,10 +4573,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_add_to_truncated) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text1(longer_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text text2(short_text.c_str(), buffer2.data(), buffer2.size()); CHECK(text1.is_truncated()); @@ -4594,7 +4594,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_clear_truncated) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(longer_text.c_str(), buffer.data(), buffer.size()); CHECK(text.is_truncated()); @@ -4610,7 +4610,7 @@ namespace char buffer[sizeof(Text)]; std::fill_n(buffer, sizeof(Text), 0); - TextBuffer buffer2; + TextBuffer buffer2{0}; ::new (buffer) Text(STR("ABCDEF"), buffer2.data(), buffer2.size()); Text& text = *reinterpret_cast(buffer); @@ -4631,7 +4631,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_secure_after_assign) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.set_secure(); text.assign(STR("ABCDEF")); @@ -4646,7 +4646,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_secure_after_resize_down) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.set_secure(); text.assign(STR("ABCDEF")); @@ -4661,7 +4661,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_secure_after_erase) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.set_secure(); text.assign(STR("ABCDEF")); @@ -4678,7 +4678,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_secure_after_replace) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.set_secure(); text.assign(STR("ABCDEF")); @@ -4695,11 +4695,11 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_secure_flag_after_copy) { - TextBuffer buffer1; + TextBuffer buffer1{0}; Text text1(STR("Hello World"), buffer1.data(), buffer1.size()); text1.set_secure(); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text text2(text1, buffer2.data(), buffer2.size()); TextBuffer buffer3; @@ -4718,8 +4718,8 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_initialize_free_space_empty_string) { - TextBuffer buffer1; - TextBuffer buffer2; + TextBuffer buffer1{0}; + TextBuffer buffer2{0}; Text text(buffer1.data(), buffer1.size()); Text empty(buffer2.data(), buffer2.size()); @@ -4737,8 +4737,8 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_initialize_free_space_part_filled_string) { - TextBuffer buffer1; - TextBuffer buffer2; + TextBuffer buffer1{0}; + TextBuffer buffer2{0}; Text initial(STR("ABC"), buffer1.data(), buffer1.size()); Text empty(buffer2.data(), buffer2.size()); Text text(initial, buffer2.data(), buffer2.size()); @@ -4757,7 +4757,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_update_after_c_string_max_size) { - TextBuffer buffer1; + TextBuffer buffer1{0}; Text text(buffer1.data(), buffer1.size()); text.initialize_free_space(); @@ -4773,7 +4773,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_update_after_c_string_shorter_size) { - TextBuffer buffer1; + TextBuffer buffer1{0}; Text text(buffer1.data(), buffer1.size()); text.initialize_free_space(); @@ -4789,7 +4789,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_update_after_c_string_greater_size) { - TextBuffer buffer1; + TextBuffer buffer1{0}; Text text(buffer1.data(), buffer1.size()); text.initialize_free_space(); diff --git a/test/test_string_wchar_t_external_buffer.cpp b/test/test_string_wchar_t_external_buffer.cpp index a0d0edc4..28692c26 100644 --- a/test/test_string_wchar_t_external_buffer.cpp +++ b/test/test_string_wchar_t_external_buffer.cpp @@ -121,7 +121,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_default_constructor) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); CHECK_EQUAL(text.size(), size_t(0)); @@ -198,7 +198,7 @@ namespace //************************************************************************* TEST(test_iterator_comparison_empty) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); CHECK(text.begin() == text.end()); @@ -215,7 +215,7 @@ namespace { const size_t INITIAL_SIZE = 5; const value_t INITIAL_VALUE = STR('A'); - TextBuffer buffer; + TextBuffer buffer{0}; Compare_Text compare_text(INITIAL_SIZE, INITIAL_VALUE); Text text(INITIAL_SIZE, INITIAL_VALUE, buffer.data(), buffer.size()); @@ -234,7 +234,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_constructor_size_excess) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.size() + 1, STR('A'), buffer.data(), buffer.size()); CHECK_EQUAL(buffer.size() - 1, text.size()); @@ -246,7 +246,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_constructor_char_pointer) { - TextBuffer buffer; + TextBuffer buffer{0}; Compare_Text compare_text(initial_text.c_str()); Text text(initial_text.c_str(), buffer.data(), buffer.size()); @@ -265,7 +265,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(longer_text.c_str(), buffer.data(), buffer.size()); CHECK(!text.empty()); @@ -282,7 +282,7 @@ namespace { Compare_Text compare_text(SIZE, STR('A')); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(SIZE, STR('A'), buffer.data(), buffer.size()); CHECK(!text.empty()); @@ -299,7 +299,7 @@ namespace { Compare_Text compare_text(SIZE, STR('A')); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(SIZE + 1, STR('A'), buffer.data(), buffer.size()); CHECK(!text.empty()); @@ -316,7 +316,7 @@ namespace { Compare_Text compare_text(initial_text.c_str(), initial_text.size() / 2); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), initial_text.size() / 2, buffer.data(), buffer.size()); CHECK(!text.empty()); @@ -333,7 +333,7 @@ namespace { Compare_Text compare_text(initial_text.c_str(), initial_text.size()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(longer_text.c_str(), longer_text.size(), buffer.data(), buffer.size()); CHECK(!text.empty()); @@ -350,7 +350,7 @@ namespace { Compare_Text compare_text(initial_text.begin(), initial_text.end()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(compare_text.begin(), compare_text.end(), buffer.data(), buffer.size()); CHECK(text.size() == SIZE); @@ -363,7 +363,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_constructor_range_excess) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(longer_text.begin(), longer_text.end(), buffer.data(), buffer.size()); bool is_equal = Equal(initial_text, text); @@ -378,7 +378,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_constructor_from_literal) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("Hello World"), buffer.data(), buffer.size()); bool is_equal = Equal(initial_text, text); @@ -392,7 +392,7 @@ namespace { etl::wstring_view view(initial_text.data(), initial_text.size()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(view, buffer.data(), buffer.size()); bool is_equal = Equal(initial_text, text); @@ -404,10 +404,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_copy_constructor) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text text2(text, buffer2.data(), buffer2.size()); CHECK(text2 == text); #if ETL_HAS_STRING_TRUNCATION_CHECKS @@ -418,11 +418,11 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_copy_constructor_i) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); IText& itext = text; - TextBuffer buffer2; + TextBuffer buffer2{0}; Text text2(itext, buffer2.data(), buffer2.size()); CHECK(text2 == text); #if ETL_HAS_STRING_TRUNCATION_CHECKS @@ -433,13 +433,13 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_copy_constructor_excess) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); - TextBufferL bufferl; + TextBufferL bufferl{0}; Text textl(longer_text.c_str(), bufferl.data(), bufferl.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text text2(textl, buffer2.data(), buffer2.size()); CHECK(text2 == text); #if ETL_HAS_STRING_TRUNCATION_CHECKS @@ -450,10 +450,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_copy_constructor_from_truncated) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(longer_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text text2(text, buffer2.data(), buffer2.size()); #if ETL_HAS_STRING_TRUNCATION_CHECKS @@ -467,10 +467,10 @@ namespace Compare_Text compare_text(initial_text.c_str()); Compare_Text compare_text2(compare_text, 2, 4); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text text2(text, buffer2.data(), buffer2.size(), 2, 4); bool is_equal = Equal(compare_text2, text2); @@ -486,10 +486,10 @@ namespace Compare_Text compare_text(longer_text.c_str()); Compare_Text compare_text2(compare_text, 2, 11); - TextBufferL bufferl; + TextBufferL bufferl{0}; Text textl(longer_text.c_str(), bufferl.data(), bufferl.size()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text2(textl, buffer.data(), buffer.size(), 2, 12); bool is_equal = Equal(compare_text2, text2); @@ -506,7 +506,7 @@ namespace Compare_Text compare_text = { STR('H'), STR('e'), STR('l') , STR('l') , STR('o') }; std::initializer_list il = { STR('H'), STR('e'), STR('l') , STR('l') , STR('o') }; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(il, buffer.data(), buffer.size()); bool is_equal = Equal(compare_text, text); @@ -525,7 +525,7 @@ namespace std::initializer_list il = { STR('H'), STR('e'), STR('l'), STR('l'), STR('o'), STR(' '), STR('W'), STR('o'), STR('r'), STR('l'), STR('d'), STR(' '), STR('T'), STR('h'), STR('e'), STR('r'), STR('e') }; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(il, buffer.data(), buffer.size()); bool is_equal = Equal(compare_text, text); @@ -539,10 +539,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_assignment) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.begin(), initial_text.end(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text other_text(buffer2.data(), buffer2.size()); other_text = text; @@ -558,10 +558,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_assignment_excess) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(longer_text.begin(), longer_text.end(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text other_text(buffer2.data(), buffer2.size()); other_text = text; @@ -577,10 +577,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_assignment_iterface) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text1(initial_text.begin(), initial_text.end(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text text2(buffer2.data(), buffer2.size()); IText& itext1 = text1; @@ -600,10 +600,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_assignment_iterface_excess) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text1(longer_text.begin(), longer_text.end(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text text2(buffer2.data(), buffer2.size()); IText& itext1 = text1; @@ -623,10 +623,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_self_assignment) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.begin(), initial_text.end(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text other_text(text, buffer2.data(), buffer2.size()); #include "etl/private/diagnostic_self_assign_overloaded_push.h" @@ -645,10 +645,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_self_assignment_excess) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(longer_text.begin(), longer_text.end(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text other_text(text, buffer2.data(), buffer2.size()); #include "etl/private/diagnostic_self_assign_overloaded_push.h" @@ -667,7 +667,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_assignment_from_literal) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text = STR("Hello World"); @@ -682,7 +682,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_assignment_from_literal_excess) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text = STR("Hello World There"); @@ -697,7 +697,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_assignment_from_literal_via_interface) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); IText& itext = text; @@ -713,7 +713,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_assignment_from_literal_via_interface_excess) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); IText& itext = text; @@ -729,10 +729,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_begin) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; const Text constText(initial_text.c_str(), buffer2.data(), buffer2.size()); CHECK_EQUAL(&text[0], text.begin()); @@ -743,10 +743,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_end) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; const Text constText(initial_text.c_str(), buffer2.data(), buffer2.size()); CHECK_EQUAL(&text[initial_text.size()], text.end()); @@ -759,7 +759,7 @@ namespace const size_t INITIAL_SIZE = 5; const size_t NEW_SIZE = 8; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), INITIAL_SIZE, buffer.data(), buffer.size()); text.resize(NEW_SIZE); @@ -776,7 +776,7 @@ namespace const size_t NEW_SIZE = 8; const value_t INITIAL_VALUE = STR('A'); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(INITIAL_SIZE, INITIAL_VALUE, buffer.data(), buffer.size()); text.resize(NEW_SIZE, INITIAL_VALUE); @@ -797,7 +797,7 @@ namespace const size_t INITIAL_SIZE = 5; const size_t NEW_SIZE = SIZE + 1; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(INITIAL_SIZE, STR('A'), buffer.data(), buffer.size()); text.resize(NEW_SIZE, STR('A')); CHECK_EQUAL(SIZE, text.size()); @@ -812,7 +812,7 @@ namespace const size_t INITIAL_SIZE = 5; const size_t NEW_SIZE = 2; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(INITIAL_SIZE, STR('A'), buffer.data(), buffer.size()); text.resize(NEW_SIZE); @@ -829,7 +829,7 @@ namespace const size_t NEW_SIZE = 2; const value_t INITIAL_VALUE = STR('A'); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(INITIAL_SIZE, INITIAL_VALUE, buffer.data(), buffer.size()); text.resize(NEW_SIZE, INITIAL_VALUE); @@ -853,7 +853,7 @@ namespace const value_t INITIAL_VALUE = STR('A'); const value_t FILL_VALUE = STR('B'); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(INITIAL_SIZE, INITIAL_VALUE, buffer.data(), buffer.size()); Text::pointer pbegin = &text.front(); @@ -881,7 +881,7 @@ namespace const size_t INITIAL_SIZE = 5; const size_t NEW_SIZE = SIZE + 1; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(INITIAL_SIZE, STR('A'), buffer.data(), buffer.size()); text.uninitialized_resize(NEW_SIZE); @@ -897,7 +897,7 @@ namespace const value_t INITIAL_VALUE = STR('A'); const value_t FILL_VALUE = STR('B'); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(INITIAL_SIZE, INITIAL_VALUE, buffer.data(), buffer.size()); Text::pointer pbegin = &text.front(); @@ -921,7 +921,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_empty_full) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.resize(text.max_size(), STR('A')); @@ -934,7 +934,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_empty_half) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.resize(text.max_size() / 2, STR('A')); @@ -947,7 +947,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_empty_empty) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); CHECK(text.empty()); @@ -959,7 +959,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_full_full) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.resize(text.max_size(), STR('A')); @@ -972,7 +972,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_full_half) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.resize(text.max_size() / 2, STR('A')); @@ -985,7 +985,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_full_empty) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); CHECK(!text.full()); @@ -999,7 +999,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); for (size_t i = 0UL; i < text.size(); ++i) @@ -1017,7 +1017,7 @@ namespace { const Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; const Text text(initial_text.c_str(), buffer.data(), buffer.size()); for (size_t i = 0UL; i < text.size(); ++i) @@ -1035,7 +1035,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); for (size_t i = 0UL; i < text.size(); ++i) @@ -1055,7 +1055,7 @@ namespace { const Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; const Text text(initial_text.c_str(), buffer.data(), buffer.size()); for (size_t i = 0UL; i < text.size(); ++i) @@ -1075,7 +1075,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); CHECK(text.front() == compare_text.front()); @@ -1089,7 +1089,7 @@ namespace { const Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; const Text text(initial_text.c_str(), buffer.data(), buffer.size()); CHECK(text.front() == compare_text.front()); @@ -1103,7 +1103,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); CHECK(text.back() == compare_text.back()); @@ -1117,7 +1117,7 @@ namespace { const Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; const Text text(initial_text.c_str(), buffer.data(), buffer.size()); CHECK(text.back() == compare_text.back()); @@ -1131,7 +1131,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(compare_text.begin(), compare_text.end(), buffer.data(), buffer.size()); bool is_equal = std::equal(text.data(), @@ -1149,7 +1149,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; const Text text(compare_text.begin(), compare_text.end(), buffer.data(), buffer.size()); bool is_equal = std::equal(text.data(), @@ -1167,12 +1167,12 @@ namespace { Compare_Text compare_input(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text input(initial_text.c_str(), buffer.data(), buffer.size()); Compare_Text compare_text; - TextBuffer buffer2; + TextBuffer buffer2{0}; Text text(buffer2.data(), buffer2.size()); compare_text.assign(compare_input); @@ -1190,12 +1190,12 @@ namespace { Compare_Text compare_input(initial_text.c_str()); - TextBufferL bufferl; + TextBufferL bufferl{0}; Text input(longer_text.c_str(), bufferl.data(), bufferl.size()); Compare_Text compare_text; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); compare_text.assign(compare_input); @@ -1213,7 +1213,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.assign(initial_text.c_str()); @@ -1229,7 +1229,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.assign(longer_text.c_str()); @@ -1245,7 +1245,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.assign(initial_text.c_str(), initial_text.size()); @@ -1261,7 +1261,7 @@ namespace { Compare_Text compare_text(longer_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.assign(longer_text.c_str(), longer_text.size()); @@ -1279,7 +1279,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.assign(compare_text.begin(), compare_text.end()); @@ -1294,7 +1294,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_assign_range_excess) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.assign(longer_text.begin(), longer_text.end()); @@ -1317,7 +1317,7 @@ namespace std::array compare_text; compare_text.fill(INITIAL_VALUE); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.assign(INITIAL_SIZE, INITIAL_VALUE); @@ -1339,7 +1339,7 @@ namespace std::array compare_text; compare_text.fill(INITIAL_VALUE); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.assign(EXCESS_SIZE, INITIAL_VALUE); @@ -1355,7 +1355,7 @@ namespace { Compare_Text compare_text; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); for (size_t i = 0UL; i < SIZE; ++i) @@ -1383,7 +1383,7 @@ namespace { Compare_Text compare_text; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); for (size_t i = 0UL; i < SIZE; ++i) @@ -1416,7 +1416,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); compare_text.pop_back(); @@ -1442,7 +1442,7 @@ namespace { Compare_Text compare_text; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.assign(initial_text.begin(), initial_text.begin() + INITIAL_SIZE); @@ -1463,7 +1463,7 @@ namespace TEST_FIXTURE(SetupFixture, test_insert_position_value_excess) { Compare_Text compare_text(initial_text.begin(), initial_text.end()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.begin(), initial_text.end(), buffer.data(), buffer.size()); const value_t INITIAL_VALUE = STR('A'); @@ -1509,7 +1509,7 @@ namespace TEST_FIXTURE(SetupFixture, test_insert_position_n_value) { Compare_Text compare_text; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); const size_t INITIAL_SIZE = 5UL; @@ -1536,7 +1536,7 @@ namespace TEST_FIXTURE(SetupFixture, test_insert_position_n_value_excess) { Compare_Text compare_text; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); const size_t INSERT_SIZE = 4UL; @@ -1610,7 +1610,7 @@ namespace for (size_t offset = 0UL; offset <= INITIAL_SIZE; ++offset) { Compare_Text compare_text; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.assign(initial_text.cbegin(), initial_text.cbegin() + INITIAL_SIZE); @@ -1634,7 +1634,7 @@ namespace const value_t INITIAL_VALUE = STR('A'); Compare_Text compare_text; - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); size_t offset = 0UL; @@ -1693,7 +1693,7 @@ namespace for (size_t offset = 10UL; offset < length; ++offset) { Compare_Text compare_text = STR("ABCDEFGHIJKLMNOPQRSTUVWXYZ"); - TextBufferL bufferl; + TextBufferL bufferl{0}; Text text(bufferl.data(), bufferl.size()); text = STR("ABCDEFGHIJKLMNOPQRSTUVWXYZ"); @@ -1714,10 +1714,10 @@ namespace for (size_t offset = 0UL; offset <= short_text.size(); ++offset) { Compare_Text compare_text(short_text.cbegin(), short_text.cend()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.begin(), short_text.end(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text insert(insert_text.begin(), insert_text.end(), buffer2.data(), buffer2.size()); text.insert(offset, insert); @@ -1739,10 +1739,10 @@ namespace { Compare_Text compare_text(initial_text.cbegin(), initial_text.cend()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.begin(), initial_text.end(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text insert(insert_text.begin(), insert_text.end(), buffer2.data(), buffer2.size()); text.insert(offset, insert); @@ -1764,10 +1764,10 @@ namespace { Compare_Text compare_text(short_text.cbegin(), short_text.cend()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.begin(), short_text.end(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text insert(longer_text.begin(), longer_text.end(), buffer2.data(), buffer2.size()); insert.erase(insert.cbegin(), insert.cend()); @@ -1790,10 +1790,10 @@ namespace { Compare_Text compare_text(short_text.cbegin(), short_text.cend()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.begin(), short_text.end(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text insert(insert_text.begin(), insert_text.end(), buffer2.data(), buffer2.size()); text.insert(0, insert, 0, insert.size()); @@ -1840,10 +1840,10 @@ namespace { Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text append(insert_text.c_str(), buffer2.data(), buffer2.size()); // Non-overflow. @@ -1876,10 +1876,10 @@ namespace TEST_FIXTURE(SetupFixture, test_append_truncated_string) { #include "etl/private/diagnostic_array_bounds_push.h" - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); - TextBufferS buffers; + TextBufferS buffers{0}; Text append(short_text.c_str(), buffers.data(), buffers.size()); #if ETL_HAS_STRING_TRUNCATION_CHECKS CHECK(append.is_truncated()); @@ -1897,7 +1897,7 @@ namespace { Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); // Non-overflow. @@ -1930,10 +1930,10 @@ namespace { Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text append(insert_text.c_str(), buffer2.data(), buffer2.size()); // Whole string. @@ -1980,10 +1980,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_append_truncated_string_subpos_sublen) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); - TextBufferS buffer2; + TextBufferS buffer2{0}; Text append(short_text.c_str(), buffer2.data(), buffer2.size()); #if ETL_HAS_STRING_TRUNCATION_CHECKS CHECK(append.is_truncated()); @@ -2001,7 +2001,7 @@ namespace // Non-overflow. Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); // Whole string. @@ -2035,7 +2035,7 @@ namespace // Non-overflow. Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); // Non-overflow. @@ -2069,10 +2069,10 @@ namespace // Non-overflow. Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text append(insert_text.c_str(), buffer2.data(), buffer2.size()); compare_text.append(insert_text.begin(), insert_text.end()); @@ -2106,7 +2106,7 @@ namespace // Non-overflow short text, npos. Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); compare_text.replace(2, Compare_Text::npos, Compare_Text(STR("Replace"))); @@ -2210,7 +2210,7 @@ namespace // Non-overflow short text. Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, Compare_Text(STR("Replace"))); @@ -2272,7 +2272,7 @@ namespace // Non-overflow short text. Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); compare_text.replace(2, 4, Compare_Text(STR("Replace")), 1, 5); @@ -2390,7 +2390,7 @@ namespace // Non-overflow short text. Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); compare_text.replace(2, 4, Compare_Text(STR("Replace")).c_str()); @@ -2508,7 +2508,7 @@ namespace // Non-overflow short text. Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, Compare_Text(STR("Replace")).c_str()); @@ -2570,7 +2570,7 @@ namespace // Non-overflow short text. Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); compare_text.replace(2, 4, Compare_Text(STR("Replace")).c_str(), 5); @@ -2688,7 +2688,7 @@ namespace // Non-overflow short text. Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, Compare_Text(STR("Replace")).c_str(), 5); @@ -2758,7 +2758,7 @@ namespace // Non-overflow short text. Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); compare_text.replace(2, 4, 7, STR('A')); @@ -2876,7 +2876,7 @@ namespace // Non-overflow short text. Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); compare_text.replace(compare_text.begin() + 2, compare_text.begin() + 4, 7, STR('A')); @@ -2938,7 +2938,7 @@ namespace // Non-overflow short text. Compare_Text compare_text(short_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); Compare_Text replace(STR("Replace")); @@ -3001,7 +3001,7 @@ namespace TEST_FIXTURE(SetupFixture, test_erase_single_iterator) { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); Compare_Text::iterator citr = compare_text.erase(compare_text.begin() + 2); @@ -3019,7 +3019,7 @@ namespace TEST_FIXTURE(SetupFixture, test_erase_single_const_iterator) { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); Compare_Text::iterator citr = compare_text.erase(compare_text.cbegin() + 2); @@ -3037,7 +3037,7 @@ namespace TEST_FIXTURE(SetupFixture, test_erase_range) { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); Compare_Text::iterator citr = compare_text.erase(compare_text.cbegin() + 2, compare_text.cbegin() + 4); @@ -3054,7 +3054,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_clear) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); text.clear(); @@ -3069,7 +3069,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); bool is_equal = std::equal(text.begin(), text.end(), compare_text.begin()); @@ -3084,7 +3084,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); bool is_equal = std::equal(text.cbegin(), text.cend(), compare_text.cbegin()); @@ -3099,7 +3099,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); bool is_equal = std::equal(text.rbegin(), text.rend(), compare_text.rbegin()); @@ -3114,7 +3114,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); bool is_equal = std::equal(text.crbegin(), text.crend(), compare_text.crbegin()); @@ -3127,10 +3127,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_equal) { - TextBuffer buffer; + TextBuffer buffer{0}; const Text initial1(initial_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; const Text initial2(initial_text.c_str(), buffer2.data(), buffer2.size()); CHECK(initial1 == initial2); @@ -3149,10 +3149,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_not_equal) { - TextBuffer buffer; + TextBuffer buffer{0}; const Text initial1(initial_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; const Text initial2(initial_text.c_str(), buffer2.data(), buffer2.size()); CHECK(!(initial1 != initial2)); @@ -3171,10 +3171,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_less_than) { - TextBuffer buffer; + TextBuffer buffer{0}; const Text less(less_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; const Text initial(initial_text.c_str(), buffer2.data(), buffer2.size()); // String-String @@ -3211,10 +3211,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_less_than_or_equal) { - TextBuffer buffer; + TextBuffer buffer{0}; const Text less(less_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; const Text initial(initial_text.c_str(), buffer2.data(), buffer2.size()); // String-String @@ -3251,10 +3251,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_greater_than) { - TextBuffer buffer; + TextBuffer buffer{0}; const Text less(less_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; const Text initial(initial_text.c_str(), buffer2.data(), buffer2.size()); // String-String @@ -3291,10 +3291,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_greater_than_or_equal) { - TextBuffer buffer; + TextBuffer buffer{0}; const Text less(less_text.begin(), less_text.end(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; const Text initial(initial_text.begin(), initial_text.end(), buffer2.data(), buffer2.size()); // String-String @@ -3333,7 +3333,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); value_t buffer1[SIZE]; @@ -3359,7 +3359,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_copy_start_pos_too_large) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); value_t buffer1[SIZE]; @@ -3377,7 +3377,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); value_t buffer1[SIZE]; @@ -3405,7 +3405,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(initial_text.c_str(), buffer.data(), buffer.size()); value_t buffer1[SIZE]; @@ -3435,12 +3435,12 @@ namespace std::wstring compare_needle(STR("needle")); - TextBuffer buffer; + TextBuffer buffer{0}; Text needle(STR("needle"), buffer.data(), buffer.size()); std::wstring compare_haystack(the_haystack); - TextBufferL buffer2; + TextBufferL buffer2{0}; Text haystack(the_haystack, buffer2.data(), buffer2.size()); size_t position1 = 0; @@ -3471,7 +3471,7 @@ namespace std::wstring compare_haystack(the_haystack); - TextBufferL buffer; + TextBufferL buffer{0}; Text haystack(the_haystack, buffer.data(), buffer.size()); size_t position1 = 0; @@ -3502,7 +3502,7 @@ namespace std::wstring compare_haystack(the_haystack); - TextBufferL buffer; + TextBufferL buffer{0}; Text haystack(the_haystack, buffer.data(), buffer.size()); size_t position1 = 0; @@ -3531,12 +3531,12 @@ namespace std::wstring compare_needle(STR("needle")); - TextBufferL buffer; + TextBufferL buffer{0}; Text needle(STR("needle"), buffer.data(), buffer.size()); std::wstring compare_haystack(the_haystack); - TextBufferL buffer2; + TextBufferL buffer2{0}; Text haystack(the_haystack, buffer2.data(), buffer2.size()); size_t position1 = std::wstring::npos; @@ -3563,7 +3563,7 @@ namespace std::wstring compare_haystack(the_haystack); - TextBufferL buffer; + TextBufferL buffer{0}; Text haystack(the_haystack, buffer.data(), buffer.size()); const value_t* needle = STR("needle"); @@ -3579,7 +3579,7 @@ namespace position2 = haystack.rfind(needle, haystack.size() - 10); CHECK_EQUAL(position1, position2); - TextBufferL buffer2; + TextBufferL buffer2{0}; Text pin(STR("pin"), buffer2.data(), buffer2.size()); position2 = haystack.rfind(pin); CHECK_EQUAL(IText::npos, position2); @@ -3592,7 +3592,7 @@ namespace std::wstring compare_haystack(the_haystack); - TextBufferL buffer; + TextBufferL buffer{0}; Text haystack(the_haystack, buffer.data(), buffer.size()); const value_t* needle = STR("needle"); @@ -3620,7 +3620,7 @@ namespace std::wstring compare_haystack(the_haystack); - TextBufferL buffer; + TextBufferL buffer{0}; Text haystack(the_haystack, buffer.data(), buffer.size()); size_t position1 = std::wstring::npos; @@ -3643,7 +3643,7 @@ namespace { Compare_Text compare_text(STR("ABCDEF")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEF"), buffer.data(), buffer.size()); int compare_result; @@ -3680,7 +3680,7 @@ namespace { Compare_Text compare_text(STR("xxxABCDEFyyy")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("xxxABCDEFyyy"), buffer.data(), buffer.size()); int compare_result; @@ -3717,7 +3717,7 @@ namespace { Compare_Text compare_text(STR("xxxABCDEFyyy")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("xxxABCDEFyyy"), buffer.data(), buffer.size()); int compare_result; @@ -3754,7 +3754,7 @@ namespace { Compare_Text compare_text(STR("ABCDEF")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEF"), buffer.data(), buffer.size()); int compare_result; @@ -3791,7 +3791,7 @@ namespace { Compare_Text compare_text(STR("xxxABCDEFyyy")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("xxxABCDEFyyy"), buffer.data(), buffer.size()); int compare_result; @@ -3828,7 +3828,7 @@ namespace { Compare_Text compare_text(STR("xxxABCDEFyyy")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("xxxABCDEFyyy"), buffer.data(), buffer.size()); int compare_result; @@ -3865,7 +3865,7 @@ namespace { Compare_Text compare_text(STR("ABCDEF")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEF"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_first_of(Compare_Text(STR("ZCXF"))); @@ -3896,7 +3896,7 @@ namespace { Compare_Text compare_text(STR("ABCDEF")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEF"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_first_of(STR("ZCXF")); @@ -3927,7 +3927,7 @@ namespace { Compare_Text compare_text(STR("ABCDEF")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEF"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_first_of(STR("ZCXF"), 0, 4); @@ -3963,7 +3963,7 @@ namespace { Compare_Text compare_text(STR("ABCDEF")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEF"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_first_of(STR('C')); @@ -4004,7 +4004,7 @@ namespace { Compare_Text compare_text(STR("ABCDEFABCDE")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEFABCDE"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_last_of(Compare_Text(STR("ZCXE"))); @@ -4040,7 +4040,7 @@ namespace { Compare_Text compare_text(STR("ABCDEFABCDE")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEFABCDE"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_last_of(STR("ZCXE")); @@ -4081,7 +4081,7 @@ namespace { Compare_Text compare_text(STR("ABCDEFABCDE")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEFABCDE"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_last_of(STR("AZCXE"), 0, 4); @@ -4120,7 +4120,7 @@ namespace { Compare_Text compare_text(STR("ABCDEF")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEF"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_last_of(STR('C')); @@ -4161,7 +4161,7 @@ namespace { Compare_Text compare_text(STR("ABCDEF")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEF"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_first_not_of(Compare_Text(STR("ZAXB"))); @@ -4197,7 +4197,7 @@ namespace { Compare_Text compare_text(STR("ABCDEF")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEF"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_first_not_of(STR("ZAXB")); @@ -4233,7 +4233,7 @@ namespace { Compare_Text compare_text(STR("ABCDEF")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEF"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_first_not_of(STR("ZAXB"), 0, 4); @@ -4274,7 +4274,7 @@ namespace { Compare_Text compare_text(STR("ABCDEF")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEF"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_first_not_of(STR('A')); @@ -4315,7 +4315,7 @@ namespace { Compare_Text compare_text(STR("ABCDEFABCDE")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEFABCDE"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_last_not_of(Compare_Text(STR("ZEXD"))); @@ -4351,7 +4351,7 @@ namespace { Compare_Text compare_text(STR("ABCDEFABCDE")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEFABCDE"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_last_not_of(STR("ZEXD")); @@ -4387,7 +4387,7 @@ namespace { Compare_Text compare_text(STR("ABCDEFABCDE")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEFABCDE"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_last_not_of(STR("ZEXD"), 0, 4); @@ -4421,7 +4421,7 @@ namespace { Compare_Text compare_text(STR("ABCDEF")); - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEF"), buffer.data(), buffer.size()); size_t position1 = compare_text.find_last_not_of(STR('F')); @@ -4461,7 +4461,7 @@ namespace TEST_FIXTURE(SetupFixture, test_hash) { // Test with actual string type. - TextBuffer buffer; + TextBuffer buffer{0}; Text text(STR("ABCDEFHIJKL"), buffer.data(), buffer.size()); size_t hash = etl::hash()(text); size_t compare_hash = etl::private_hash::generic_hash(reinterpret_cast(&text[0]), reinterpret_cast(&text[text.size()])); @@ -4476,7 +4476,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_memcpy_repair) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.assign(STR("ABCDEF")); @@ -4503,7 +4503,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_memcpy_repair_virtual) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.assign(STR("ABCDEF")); @@ -4531,7 +4531,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_truncate_over_many_operations) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(short_text.c_str(), buffer.data(), buffer.size()); CHECK(!text.is_truncated()); @@ -4557,10 +4557,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_add_from_truncated) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text1(short_text.c_str(), buffer.data(), buffer.size()); - TextBufferS buffers; + TextBufferS buffers{0}; Text text2(short_text.c_str(), buffers.data(), buffers.size()); CHECK(!text1.is_truncated()); @@ -4575,10 +4575,10 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_add_to_truncated) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text1(longer_text.c_str(), buffer.data(), buffer.size()); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text text2(short_text.c_str(), buffer2.data(), buffer2.size()); CHECK(text1.is_truncated()); @@ -4596,7 +4596,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_clear_truncated) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(longer_text.c_str(), buffer.data(), buffer.size()); CHECK(text.is_truncated()); @@ -4612,7 +4612,7 @@ namespace char buffer[sizeof(Text)]; std::fill_n(buffer, sizeof(Text), 0); - TextBuffer buffer2; + TextBuffer buffer2{0}; ::new (buffer) Text(STR("ABCDEF"), buffer2.data(), buffer2.size()); Text& text = *reinterpret_cast(buffer); @@ -4633,7 +4633,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_secure_after_assign) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.set_secure(); text.assign(STR("ABCDEF")); @@ -4648,7 +4648,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_secure_after_resize_down) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.set_secure(); text.assign(STR("ABCDEF")); @@ -4663,7 +4663,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_secure_after_erase) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.set_secure(); text.assign(STR("ABCDEF")); @@ -4680,7 +4680,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_secure_after_replace) { - TextBuffer buffer; + TextBuffer buffer{0}; Text text(buffer.data(), buffer.size()); text.set_secure(); text.assign(STR("ABCDEF")); @@ -4697,11 +4697,11 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_secure_flag_after_copy) { - TextBuffer buffer1; + TextBuffer buffer1{0}; Text text1(STR("Hello World"), buffer1.data(), buffer1.size()); text1.set_secure(); - TextBuffer buffer2; + TextBuffer buffer2{0}; Text text2(text1, buffer2.data(), buffer2.size()); TextBuffer buffer3; @@ -4720,8 +4720,8 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_initialize_free_space_empty_string) { - TextBuffer buffer1; - TextBuffer buffer2; + TextBuffer buffer1{0}; + TextBuffer buffer2{0}; Text text(buffer1.data(), buffer1.size()); Text empty(buffer2.data(), buffer2.size()); @@ -4739,8 +4739,8 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_initialize_free_space_part_filled_string) { - TextBuffer buffer1; - TextBuffer buffer2; + TextBuffer buffer1{0}; + TextBuffer buffer2{0}; Text initial(STR("ABC"), buffer1.data(), buffer1.size()); Text empty(buffer2.data(), buffer2.size()); Text text(initial, buffer2.data(), buffer2.size()); @@ -4759,7 +4759,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_update_after_c_string_max_size) { - TextBuffer buffer1; + TextBuffer buffer1{0}; Text text(buffer1.data(), buffer1.size()); text.initialize_free_space(); @@ -4775,7 +4775,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_update_after_c_string_shorter_size) { - TextBuffer buffer1; + TextBuffer buffer1{0}; Text text(buffer1.data(), buffer1.size()); text.initialize_free_space(); @@ -4791,7 +4791,7 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_update_after_c_string_greater_size) { - TextBuffer buffer1; + TextBuffer buffer1{0}; Text text(buffer1.data(), buffer1.size()); text.initialize_free_space();