text stringlengths 0 2.2M |
|---|
CHECK(is_equal);
|
#if ETL_STRING_TRUNCATION_CHECKS_ENABLED
|
CHECK(!text.is_truncated());
|
#endif
|
}
|
//*************************************************************************
|
TEST_FIXTURE(SetupFixture, test_assign_string)
|
{
|
Compare_Text compare_input(initial_text.c_str());
|
TextBuffer buffer;
|
Text input(initial_text.c_str(), buffer.data(), buffer.size());
|
Compare_Text compare_text;
|
TextBuffer buffer2;
|
Text text(buffer2.data(), buffer2.size());
|
compare_text.assign(compare_input);
|
text.assign(input);
|
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_assign_string_excess)
|
{
|
Compare_Text compare_input(initial_text.c_str());
|
TextBufferL bufferl;
|
Text input(longer_text.c_str(), bufferl.data(), bufferl.size());
|
Compare_Text compare_text;
|
TextBuffer buffer;
|
Text text(buffer.data(), buffer.size());
|
compare_text.assign(compare_input);
|
text.assign(input);
|
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_assign_pointer)
|
{
|
Compare_Text compare_text(initial_text.c_str());
|
TextBuffer buffer;
|
Text text(buffer.data(), buffer.size());
|
text.assign(initial_text.c_str());
|
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_assign_pointer_excess)
|
{
|
Compare_Text compare_text(initial_text.c_str());
|
TextBuffer buffer;
|
Text text(buffer.data(), buffer.size());
|
text.assign(longer_text.c_str());
|
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_assign_pointer_length)
|
{
|
Compare_Text compare_text(initial_text.c_str());
|
TextBuffer buffer;
|
Text text(buffer.data(), buffer.size());
|
text.assign(initial_text.c_str(), initial_text.size());
|
bool is_equal = Equal(compare_text, text);
|
CHECK(is_equal);
|
#if ETL_STRING_TRUNCATION_CHECKS_ENABLED
|
CHECK(!text.is_truncated());
|
#endif
|
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.