text stringlengths 0 2.2M |
|---|
bool is_equal = Equal(compare_text, text);
|
CHECK(is_equal);
|
#if ETL_STRING_TRUNCATION_CHECKS_ENABLED
|
CHECK(!text.is_truncated());
|
#endif
|
}
|
//*************************************************************************
|
TEST_FIXTURE(SetupFixture, test_constructor_char_pointer_excess)
|
{
|
Compare_Text compare_text(initial_text.c_str());
|
TextBuffer buffer;
|
Text text(longer_text.c_str(), buffer.data(), buffer.size());
|
CHECK(!text.empty());
|
bool is_equal = Equal(compare_text, text);
|
CHECK(is_equal);
|
#if ETL_STRING_TRUNCATION_CHECKS_ENABLED
|
CHECK(text.is_truncated());
|
#endif
|
}
|
//*************************************************************************
|
TEST_FIXTURE(SetupFixture, test_constructor_char_pointer_size)
|
{
|
Compare_Text compare_text(SIZE, STR('A'));
|
TextBuffer buffer;
|
Text text(SIZE, STR('A'), buffer.data(), buffer.size());
|
CHECK(!text.empty());
|
bool is_equal = Equal(compare_text, text);
|
CHECK(is_equal);
|
#if ETL_STRING_TRUNCATION_CHECKS_ENABLED
|
CHECK(!text.is_truncated());
|
#endif
|
}
|
//*************************************************************************
|
TEST_FIXTURE(SetupFixture, test_constructor_char_pointer_size_excess)
|
{
|
Compare_Text compare_text(SIZE, STR('A'));
|
TextBuffer buffer;
|
Text text(SIZE + 1, STR('A'), buffer.data(), buffer.size());
|
CHECK(!text.empty());
|
bool is_equal = Equal(compare_text, text);
|
CHECK(is_equal);
|
#if ETL_STRING_TRUNCATION_CHECKS_ENABLED
|
CHECK(text.is_truncated());
|
#endif
|
}
|
//*************************************************************************
|
TEST_FIXTURE(SetupFixture, test_constructor_size_char)
|
{
|
Compare_Text compare_text(initial_text.c_str(), initial_text.size() / 2);
|
TextBuffer buffer;
|
Text text(initial_text.c_str(), initial_text.size() / 2, buffer.data(), buffer.size());
|
CHECK(!text.empty());
|
bool is_equal = Equal(compare_text, text);
|
CHECK(is_equal);
|
#if ETL_STRING_TRUNCATION_CHECKS_ENABLED
|
CHECK(!text.is_truncated());
|
#endif
|
}
|
//*************************************************************************
|
TEST_FIXTURE(SetupFixture, test_constructor_size_char_excess)
|
{
|
Compare_Text compare_text(initial_text.c_str(), initial_text.size());
|
TextBuffer buffer;
|
Text text(longer_text.c_str(), longer_text.size(), buffer.data(), buffer.size());
|
CHECK(!text.empty());
|
bool is_equal = Equal(compare_text, text);
|
CHECK(is_equal);
|
#if ETL_STRING_TRUNCATION_CHECKS_ENABLED
|
CHECK(text.is_truncated());
|
#endif
|
}
|
//*************************************************************************
|
TEST_FIXTURE(SetupFixture, test_constructor_range)
|
{
|
Compare_Text compare_text(initial_text.begin(), initial_text.end());
|
TextBuffer buffer;
|
Text text(compare_text.begin(), compare_text.end(), buffer.data(), buffer.size());
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.