mirror of
https://github.com/ETLCPP/etl.git
synced 2026-04-30 19:09:10 +08:00
Merge branch 'pull-request/#1196-Added-back-in-support-for-populating-non-8-bit-strings-with-8-bit-data' into development
This commit is contained in:
commit
11c509bb44
@ -2705,10 +2705,10 @@ namespace etl
|
||||
/// Copy characters using pointers.
|
||||
/// Returns a pointer to the character after the last copied.
|
||||
//*********************************************************************
|
||||
template <typename TIterator1, typename TIterator2>
|
||||
template <typename TIterator1>
|
||||
static
|
||||
typename etl::enable_if<etl::is_pointer<TIterator1>::value && etl::is_pointer<TIterator2>::value, TIterator2>::type
|
||||
copy_characters(TIterator1 from, size_t n, TIterator2 to)
|
||||
typename etl::enable_if<etl::is_pointer<typename etl::remove_reference<TIterator1>::type>::value && sizeof(typename etl::remove_pointer<typename etl::remove_cvref<TIterator1>::type>::type) == sizeof(value_type), iterator>::type
|
||||
copy_characters(TIterator1 from, size_t n, iterator to)
|
||||
{
|
||||
etl::mem_move(from, n, to);
|
||||
|
||||
@ -2719,10 +2719,10 @@ namespace etl
|
||||
/// Copy characters using non-pointers.
|
||||
/// Returns an iterator to the character after the last copied.
|
||||
//*********************************************************************
|
||||
template <typename TIterator1, typename TIterator2>
|
||||
template <typename TIterator1>
|
||||
static
|
||||
typename etl::enable_if<!etl::is_pointer<TIterator1>::value || !etl::is_pointer<TIterator2>::value, TIterator2>::type
|
||||
copy_characters(TIterator1 from, size_t n, TIterator2 to)
|
||||
typename etl::enable_if<!(etl::is_pointer<typename etl::remove_reference<TIterator1>::type>::value && sizeof(typename etl::remove_pointer<typename etl::remove_cvref<TIterator1>::type>::type) == sizeof(value_type)), iterator>::type
|
||||
copy_characters(TIterator1 from, size_t n, iterator to)
|
||||
{
|
||||
size_t count = 0;
|
||||
|
||||
|
||||
@ -441,7 +441,7 @@ namespace etl
|
||||
u16string_ext(TIterator first, TIterator last, value_type* buffer, size_type buffer_size, typename etl::enable_if<!etl::is_integral<TIterator>::value, int>::type = 0)
|
||||
: iu16string(buffer, buffer_size - 1U)
|
||||
{
|
||||
if (this->is_within_buffer(etl::addressof(*first)))
|
||||
if (this->is_within_buffer(reinterpret_cast<const_iterator>(etl::addressof(*first))))
|
||||
{
|
||||
this->current_size = etl::distance(first, last);
|
||||
}
|
||||
|
||||
@ -441,7 +441,7 @@ namespace etl
|
||||
u32string_ext(TIterator first, TIterator last, value_type* buffer, size_type buffer_size, typename etl::enable_if<!etl::is_integral<TIterator>::value, int>::type = 0)
|
||||
: iu32string(buffer, buffer_size - 1U)
|
||||
{
|
||||
if (this->is_within_buffer(etl::addressof(*first)))
|
||||
if (this->is_within_buffer(reinterpret_cast<const_iterator>(etl::addressof(*first))))
|
||||
{
|
||||
this->current_size = etl::distance(first, last);
|
||||
}
|
||||
|
||||
@ -441,7 +441,7 @@ namespace etl
|
||||
wstring_ext(TIterator first, TIterator last, value_type* buffer, size_type buffer_size, typename etl::enable_if<!etl::is_integral<TIterator>::value, int>::type = 0)
|
||||
: iwstring(buffer, buffer_size - 1U)
|
||||
{
|
||||
if (this->is_within_buffer(etl::addressof(*first)))
|
||||
if (this->is_within_buffer(reinterpret_cast<const_iterator>(etl::addressof(*first))))
|
||||
{
|
||||
this->current_size = etl::distance(first, last);
|
||||
}
|
||||
|
||||
@ -303,6 +303,36 @@ namespace
|
||||
#endif
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_constructor_8bit_range)
|
||||
{
|
||||
std::string text8Bit{"8-bit"};
|
||||
TextSTD compare_text(text8Bit.begin(), text8Bit.end());
|
||||
|
||||
Text text(text8Bit.begin(), text8Bit.end());
|
||||
|
||||
bool is_equal = Equal(text8Bit, text);
|
||||
CHECK(is_equal);
|
||||
CHECK_EQUAL(text8Bit.size(), text.size());
|
||||
CHECK_FALSE(text.empty());
|
||||
CHECK_FALSE(text.is_truncated());
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_constructor_8bit_const_range)
|
||||
{
|
||||
std::string const text8Bit{"8-bit"};
|
||||
TextSTD compare_text(text8Bit.begin(), text8Bit.end());
|
||||
|
||||
Text text(text8Bit.begin(), text8Bit.end());
|
||||
|
||||
bool is_equal = Equal(text8Bit, text);
|
||||
CHECK(is_equal);
|
||||
CHECK_EQUAL(text8Bit.size(), text.size());
|
||||
CHECK_FALSE(text.empty());
|
||||
CHECK_FALSE(text.is_truncated());
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_constructor_from_literal)
|
||||
{
|
||||
@ -1202,6 +1232,34 @@ namespace
|
||||
#endif
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_assign_range_8bit)
|
||||
{
|
||||
std::string text8Bit{"8-bit"};
|
||||
|
||||
Text text;
|
||||
|
||||
text.assign(text8Bit.begin(), text8Bit.end());
|
||||
|
||||
bool is_equal = Equal(text8Bit, text);
|
||||
CHECK(is_equal);
|
||||
CHECK_FALSE(text.is_truncated());
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_assign_range_8bit_const)
|
||||
{
|
||||
std::string const text8Bit{"8-bit"};
|
||||
|
||||
Text text;
|
||||
|
||||
text.assign(text8Bit.begin(), text8Bit.end());
|
||||
|
||||
bool is_equal = Equal(text8Bit, text);
|
||||
CHECK(is_equal);
|
||||
CHECK_FALSE(text.is_truncated());
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_assign_size_value)
|
||||
{
|
||||
|
||||
@ -405,6 +405,61 @@ namespace
|
||||
CHECK(!text.empty());
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_constructor_from_range_16bit)
|
||||
{
|
||||
TextBuffer buffer{0};
|
||||
Text text(initial_text.begin(), initial_text.end(), buffer.data(), buffer.size());
|
||||
|
||||
bool is_equal = Equal(initial_text, text);
|
||||
CHECK(is_equal);
|
||||
CHECK_EQUAL(SIZE, text.size());
|
||||
CHECK_FALSE(text.empty());
|
||||
CHECK_FALSE(text.is_truncated());
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_constructor_from_range_16bit_const)
|
||||
{
|
||||
const View u16View{STR("16-bit")};
|
||||
TextBuffer buffer{0};
|
||||
Text text(u16View.begin(), u16View.end(), buffer.data(), buffer.size());
|
||||
|
||||
bool is_equal = Equal(u16View, text);
|
||||
CHECK(is_equal);
|
||||
CHECK_EQUAL(u16View.size(), text.size());
|
||||
CHECK_FALSE(text.empty());
|
||||
CHECK_FALSE(text.is_truncated());
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_constructor_from_range_8bit)
|
||||
{
|
||||
std::string text8Bit{"8-bit"};
|
||||
TextBuffer buffer{0};
|
||||
Text text(text8Bit.begin(), text8Bit.end(), buffer.data(), buffer.size());
|
||||
|
||||
bool is_equal = Equal(text8Bit, text);
|
||||
CHECK(is_equal);
|
||||
CHECK_EQUAL(text8Bit.size(), text.size());
|
||||
CHECK_FALSE(text.empty());
|
||||
CHECK_FALSE(text.is_truncated());
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_constructor_from_range_8bit_const)
|
||||
{
|
||||
std::string const text8Bit{"8-bit"};
|
||||
TextBuffer buffer{0};
|
||||
Text text(text8Bit.begin(), text8Bit.end(), buffer.data(), buffer.size());
|
||||
|
||||
bool is_equal = Equal(text8Bit, text);
|
||||
CHECK(is_equal);
|
||||
CHECK_EQUAL(text8Bit.size(), text.size());
|
||||
CHECK_FALSE(text.empty());
|
||||
CHECK_FALSE(text.is_truncated());
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_copy_constructor)
|
||||
{
|
||||
@ -1396,6 +1451,38 @@ namespace
|
||||
#endif
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_assign_range_8bit)
|
||||
{
|
||||
std::string text8Bit{"8-bit"};
|
||||
|
||||
TextBuffer buffer{0};
|
||||
Text text(buffer.data(), buffer.size());
|
||||
|
||||
text.assign(text8Bit.begin(), text8Bit.end());
|
||||
|
||||
bool is_equal = Equal(text8Bit, text);
|
||||
CHECK(is_equal);
|
||||
CHECK_FALSE(text.is_truncated());
|
||||
CHECK_EQUAL(text8Bit.size(), text.size());
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_assign_range_8bit_const)
|
||||
{
|
||||
std::string const text8Bit{"8-bit"};
|
||||
|
||||
TextBuffer buffer{0};
|
||||
Text text(buffer.data(), buffer.size());
|
||||
|
||||
text.assign(text8Bit.begin(), text8Bit.end());
|
||||
|
||||
bool is_equal = Equal(text8Bit, text);
|
||||
CHECK(is_equal);
|
||||
CHECK_FALSE(text.is_truncated());
|
||||
CHECK_EQUAL(text8Bit.size(), text.size());
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_assign_size_value)
|
||||
{
|
||||
|
||||
@ -303,6 +303,36 @@ namespace
|
||||
#endif
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_constructor_8bit_range)
|
||||
{
|
||||
std::string text8Bit{"8-bit"};
|
||||
TextSTD compare_text(text8Bit.begin(), text8Bit.end());
|
||||
|
||||
Text text(text8Bit.begin(), text8Bit.end());
|
||||
|
||||
bool is_equal = Equal(text8Bit, text);
|
||||
CHECK(is_equal);
|
||||
CHECK_EQUAL(text8Bit.size(), text.size());
|
||||
CHECK_FALSE(text.empty());
|
||||
CHECK_FALSE(text.is_truncated());
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_constructor_8bit_const_range)
|
||||
{
|
||||
std::string const text8Bit{"8-bit"};
|
||||
TextSTD compare_text(text8Bit.begin(), text8Bit.end());
|
||||
|
||||
Text text(text8Bit.begin(), text8Bit.end());
|
||||
|
||||
bool is_equal = Equal(text8Bit, text);
|
||||
CHECK(is_equal);
|
||||
CHECK_EQUAL(text8Bit.size(), text.size());
|
||||
CHECK_FALSE(text.empty());
|
||||
CHECK_FALSE(text.is_truncated());
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_constructor_from_literal)
|
||||
{
|
||||
@ -1202,6 +1232,34 @@ namespace
|
||||
#endif
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_assign_range_8bit)
|
||||
{
|
||||
std::string text8Bit{"8-bit"};
|
||||
|
||||
Text text;
|
||||
|
||||
text.assign(text8Bit.begin(), text8Bit.end());
|
||||
|
||||
bool is_equal = Equal(text8Bit, text);
|
||||
CHECK(is_equal);
|
||||
CHECK_FALSE(text.is_truncated());
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_assign_range_8bit_const)
|
||||
{
|
||||
std::string const text8Bit{"8-bit"};
|
||||
|
||||
Text text;
|
||||
|
||||
text.assign(text8Bit.begin(), text8Bit.end());
|
||||
|
||||
bool is_equal = Equal(text8Bit, text);
|
||||
CHECK(is_equal);
|
||||
CHECK_FALSE(text.is_truncated());
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_assign_size_value)
|
||||
{
|
||||
|
||||
@ -405,6 +405,61 @@ namespace
|
||||
CHECK(!text.empty());
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_constructor_from_range_32bit)
|
||||
{
|
||||
TextBuffer buffer{0};
|
||||
Text text(initial_text.begin(), initial_text.end(), buffer.data(), buffer.size());
|
||||
|
||||
bool is_equal = Equal(initial_text, text);
|
||||
CHECK(is_equal);
|
||||
CHECK_EQUAL(SIZE, text.size());
|
||||
CHECK_FALSE(text.empty());
|
||||
CHECK_FALSE(text.is_truncated());
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_constructor_from_range_32bit_const)
|
||||
{
|
||||
const View u32View{STR("32-bit")};
|
||||
TextBuffer buffer{0};
|
||||
Text text(u32View.begin(), u32View.end(), buffer.data(), buffer.size());
|
||||
|
||||
bool is_equal = Equal(u32View, text);
|
||||
CHECK(is_equal);
|
||||
CHECK_EQUAL(u32View.size(), text.size());
|
||||
CHECK_FALSE(text.empty());
|
||||
CHECK_FALSE(text.is_truncated());
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_constructor_from_range_8bit)
|
||||
{
|
||||
std::string text8Bit{"8-bit"};
|
||||
TextBuffer buffer{0};
|
||||
Text text(text8Bit.begin(), text8Bit.end(), buffer.data(), buffer.size());
|
||||
|
||||
bool is_equal = Equal(text8Bit, text);
|
||||
CHECK(is_equal);
|
||||
CHECK_EQUAL(text8Bit.size(), text.size());
|
||||
CHECK_FALSE(text.empty());
|
||||
CHECK_FALSE(text.is_truncated());
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_constructor_from_range_8bit_const)
|
||||
{
|
||||
std::string const text8Bit{"8-bit"};
|
||||
TextBuffer buffer{0};
|
||||
Text text(text8Bit.begin(), text8Bit.end(), buffer.data(), buffer.size());
|
||||
|
||||
bool is_equal = Equal(text8Bit, text);
|
||||
CHECK(is_equal);
|
||||
CHECK_EQUAL(text8Bit.size(), text.size());
|
||||
CHECK_FALSE(text.empty());
|
||||
CHECK_FALSE(text.is_truncated());
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_copy_constructor)
|
||||
{
|
||||
@ -1396,6 +1451,38 @@ namespace
|
||||
#endif
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_assign_range_8bit)
|
||||
{
|
||||
std::string text8Bit{"8-bit"};
|
||||
|
||||
TextBuffer buffer{0};
|
||||
Text text(buffer.data(), buffer.size());
|
||||
|
||||
text.assign(text8Bit.begin(), text8Bit.end());
|
||||
|
||||
bool is_equal = Equal(text8Bit, text);
|
||||
CHECK(is_equal);
|
||||
CHECK_FALSE(text.is_truncated());
|
||||
CHECK_EQUAL(text8Bit.size(), text.size());
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_assign_range_8bit_const)
|
||||
{
|
||||
std::string const text8Bit{"8-bit"};
|
||||
|
||||
TextBuffer buffer{0};
|
||||
Text text(buffer.data(), buffer.size());
|
||||
|
||||
text.assign(text8Bit.begin(), text8Bit.end());
|
||||
|
||||
bool is_equal = Equal(text8Bit, text);
|
||||
CHECK(is_equal);
|
||||
CHECK_FALSE(text.is_truncated());
|
||||
CHECK_EQUAL(text8Bit.size(), text.size());
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_assign_size_value)
|
||||
{
|
||||
|
||||
@ -304,6 +304,36 @@ namespace
|
||||
#endif
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_constructor_8bit_range)
|
||||
{
|
||||
std::string text8Bit{"8-bit"};
|
||||
TextSTD compare_text(text8Bit.begin(), text8Bit.end());
|
||||
|
||||
Text text(text8Bit.begin(), text8Bit.end());
|
||||
|
||||
bool is_equal = Equal(text8Bit, text);
|
||||
CHECK(is_equal);
|
||||
CHECK_EQUAL(text8Bit.size(), text.size());
|
||||
CHECK_FALSE(text.empty());
|
||||
CHECK_FALSE(text.is_truncated());
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_constructor_8bit_const_range)
|
||||
{
|
||||
std::string const text8Bit{"8-bit"};
|
||||
TextSTD compare_text(text8Bit.begin(), text8Bit.end());
|
||||
|
||||
Text text(text8Bit.begin(), text8Bit.end());
|
||||
|
||||
bool is_equal = Equal(text8Bit, text);
|
||||
CHECK(is_equal);
|
||||
CHECK_EQUAL(text8Bit.size(), text.size());
|
||||
CHECK_FALSE(text.empty());
|
||||
CHECK_FALSE(text.is_truncated());
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_constructor_from_literal)
|
||||
{
|
||||
@ -1203,6 +1233,34 @@ namespace
|
||||
#endif
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_assign_range_8bit)
|
||||
{
|
||||
std::string text8Bit{"8-bit"};
|
||||
|
||||
Text text;
|
||||
|
||||
text.assign(text8Bit.begin(), text8Bit.end());
|
||||
|
||||
bool is_equal = Equal(text8Bit, text);
|
||||
CHECK(is_equal);
|
||||
CHECK_FALSE(text.is_truncated());
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_assign_range_8bit_const)
|
||||
{
|
||||
std::string const text8Bit{"8-bit"};
|
||||
|
||||
Text text;
|
||||
|
||||
text.assign(text8Bit.begin(), text8Bit.end());
|
||||
|
||||
bool is_equal = Equal(text8Bit, text);
|
||||
CHECK(is_equal);
|
||||
CHECK_FALSE(text.is_truncated());
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_assign_size_value)
|
||||
{
|
||||
|
||||
@ -408,6 +408,61 @@ namespace
|
||||
CHECK(!text.empty());
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_constructor_from_range_32bit)
|
||||
{
|
||||
TextBuffer buffer{0};
|
||||
Text text(initial_text.begin(), initial_text.end(), buffer.data(), buffer.size());
|
||||
|
||||
bool is_equal = Equal(initial_text, text);
|
||||
CHECK(is_equal);
|
||||
CHECK_EQUAL(SIZE, text.size());
|
||||
CHECK_FALSE(text.empty());
|
||||
CHECK_FALSE(text.is_truncated());
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_constructor_from_range_32bit_const)
|
||||
{
|
||||
const View wstrView{STR("wchar")};
|
||||
TextBuffer buffer{0};
|
||||
Text text(wstrView.begin(), wstrView.end(), buffer.data(), buffer.size());
|
||||
|
||||
bool is_equal = Equal(wstrView, text);
|
||||
CHECK(is_equal);
|
||||
CHECK_EQUAL(wstrView.size(), text.size());
|
||||
CHECK_FALSE(text.empty());
|
||||
CHECK_FALSE(text.is_truncated());
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_constructor_from_range_8bit)
|
||||
{
|
||||
std::string text8Bit{"8-bit"};
|
||||
TextBuffer buffer{0};
|
||||
Text text(text8Bit.begin(), text8Bit.end(), buffer.data(), buffer.size());
|
||||
|
||||
bool is_equal = Equal(text8Bit, text);
|
||||
CHECK(is_equal);
|
||||
CHECK_EQUAL(text8Bit.size(), text.size());
|
||||
CHECK_FALSE(text.empty());
|
||||
CHECK_FALSE(text.is_truncated());
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_constructor_from_range_8bit_const)
|
||||
{
|
||||
std::string const text8Bit{"8-bit"};
|
||||
TextBuffer buffer{0};
|
||||
Text text(text8Bit.begin(), text8Bit.end(), buffer.data(), buffer.size());
|
||||
|
||||
bool is_equal = Equal(text8Bit, text);
|
||||
CHECK(is_equal);
|
||||
CHECK_EQUAL(text8Bit.size(), text.size());
|
||||
CHECK_FALSE(text.empty());
|
||||
CHECK_FALSE(text.is_truncated());
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_copy_constructor)
|
||||
{
|
||||
@ -1399,6 +1454,38 @@ namespace
|
||||
#endif
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_assign_range_8bit)
|
||||
{
|
||||
std::string text8Bit{"8-bit"};
|
||||
|
||||
TextBuffer buffer{0};
|
||||
Text text(buffer.data(), buffer.size());
|
||||
|
||||
text.assign(text8Bit.begin(), text8Bit.end());
|
||||
|
||||
bool is_equal = Equal(text8Bit, text);
|
||||
CHECK(is_equal);
|
||||
CHECK_FALSE(text.is_truncated());
|
||||
CHECK_EQUAL(text8Bit.size(), text.size());
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_assign_range_8bit_const)
|
||||
{
|
||||
std::string const text8Bit{"8-bit"};
|
||||
|
||||
TextBuffer buffer{0};
|
||||
Text text(buffer.data(), buffer.size());
|
||||
|
||||
text.assign(text8Bit.begin(), text8Bit.end());
|
||||
|
||||
bool is_equal = Equal(text8Bit, text);
|
||||
CHECK(is_equal);
|
||||
CHECK_FALSE(text.is_truncated());
|
||||
CHECK_EQUAL(text8Bit.size(), text.size());
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_assign_size_value)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user