mirror of
https://github.com/ETLCPP/etl.git
synced 2026-04-30 19:09:10 +08:00
Strings may use external buffers if the 'max size' template parameter is zero.
This commit is contained in:
parent
504e7bc8e6
commit
585251a870
@ -3052,48 +3052,6 @@ namespace
|
||||
CHECK_EQUAL(IText::npos, position2);
|
||||
}
|
||||
|
||||
////*************************************************************************
|
||||
//TEST_FIXTURE(SetupFixture, test_substr)
|
||||
//{
|
||||
// Compare_Text compare_text(initial_text.c_str());
|
||||
|
||||
// TextBuffer buffer;
|
||||
// Text text(initial_text.c_str());
|
||||
|
||||
// Compare_Text compare_result;
|
||||
|
||||
// TextBuffer buffer2;
|
||||
// Text result;
|
||||
|
||||
// // Equal.
|
||||
// compare_result = compare_text.substr(compare_text.size());
|
||||
// result = text.substr(text.size());
|
||||
// CHECK(Equal(compare_result, result));
|
||||
|
||||
// // Whole string.
|
||||
// compare_result = compare_text.substr();
|
||||
// result = text.substr();
|
||||
// CHECK(Equal(compare_result, result));
|
||||
|
||||
// // Starting from position 2.
|
||||
// compare_result = compare_text.substr(2);
|
||||
// result = text.substr(2);
|
||||
// CHECK(Equal(compare_result, result));
|
||||
|
||||
// // Starting from position 2 for 3 characters.
|
||||
// compare_result = compare_text.substr(2, 3);
|
||||
// result = text.substr(2, 3);
|
||||
// CHECK(Equal(compare_result, result));
|
||||
|
||||
// // Starting from position 2 for too many characters.
|
||||
// compare_result = compare_text.substr(2, compare_text.size());
|
||||
// result = text.substr(2, text.size());
|
||||
// CHECK(Equal(compare_result, result));
|
||||
|
||||
// // Starting from beyond the end of the string.
|
||||
// CHECK_THROW(text.substr(text.size() + 1), etl::string_out_of_bounds);
|
||||
//}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_compare_string)
|
||||
{
|
||||
|
||||
@ -3052,48 +3052,6 @@ namespace
|
||||
CHECK_EQUAL(IText::npos, position2);
|
||||
}
|
||||
|
||||
////*************************************************************************
|
||||
//TEST_FIXTURE(SetupFixture, test_substr)
|
||||
//{
|
||||
// Compare_Text compare_text(initial_text.c_str());
|
||||
|
||||
// TextBuffer buffer;
|
||||
// Text text(initial_text.c_str());
|
||||
|
||||
// Compare_Text compare_result;
|
||||
|
||||
// TextBuffer buffer2;
|
||||
// Text result;
|
||||
|
||||
// // Equal.
|
||||
// compare_result = compare_text.substr(compare_text.size());
|
||||
// result = text.substr(text.size());
|
||||
// CHECK(Equal(compare_result, result));
|
||||
|
||||
// // Whole string.
|
||||
// compare_result = compare_text.substr();
|
||||
// result = text.substr();
|
||||
// CHECK(Equal(compare_result, result));
|
||||
|
||||
// // Starting from position 2.
|
||||
// compare_result = compare_text.substr(2);
|
||||
// result = text.substr(2);
|
||||
// CHECK(Equal(compare_result, result));
|
||||
|
||||
// // Starting from position 2 for 3 characters.
|
||||
// compare_result = compare_text.substr(2, 3);
|
||||
// result = text.substr(2, 3);
|
||||
// CHECK(Equal(compare_result, result));
|
||||
|
||||
// // Starting from position 2 for too many characters.
|
||||
// compare_result = compare_text.substr(2, compare_text.size());
|
||||
// result = text.substr(2, text.size());
|
||||
// CHECK(Equal(compare_result, result));
|
||||
|
||||
// // Starting from beyond the end of the string.
|
||||
// CHECK_THROW(text.substr(text.size() + 1), etl::u16string_out_of_bounds);
|
||||
//}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_compare_string)
|
||||
{
|
||||
|
||||
@ -3052,48 +3052,6 @@ namespace
|
||||
CHECK_EQUAL(IText::npos, position2);
|
||||
}
|
||||
|
||||
////*************************************************************************
|
||||
//TEST_FIXTURE(SetupFixture, test_substr)
|
||||
//{
|
||||
// Compare_Text compare_text(initial_text.c_str());
|
||||
|
||||
// TextBuffer buffer;
|
||||
// Text text(initial_text.c_str());
|
||||
|
||||
// Compare_Text compare_result;
|
||||
|
||||
// TextBuffer buffer2;
|
||||
// Text result;
|
||||
|
||||
// // Equal.
|
||||
// compare_result = compare_text.substr(compare_text.size());
|
||||
// result = text.substr(text.size());
|
||||
// CHECK(Equal(compare_result, result));
|
||||
|
||||
// // Whole string.
|
||||
// compare_result = compare_text.substr();
|
||||
// result = text.substr();
|
||||
// CHECK(Equal(compare_result, result));
|
||||
|
||||
// // Starting from position 2.
|
||||
// compare_result = compare_text.substr(2);
|
||||
// result = text.substr(2);
|
||||
// CHECK(Equal(compare_result, result));
|
||||
|
||||
// // Starting from position 2 for 3 characters.
|
||||
// compare_result = compare_text.substr(2, 3);
|
||||
// result = text.substr(2, 3);
|
||||
// CHECK(Equal(compare_result, result));
|
||||
|
||||
// // Starting from position 2 for too many characters.
|
||||
// compare_result = compare_text.substr(2, compare_text.size());
|
||||
// result = text.substr(2, text.size());
|
||||
// CHECK(Equal(compare_result, result));
|
||||
|
||||
// // Starting from beyond the end of the string.
|
||||
// CHECK_THROW(text.substr(text.size() + 1), etl::u32string_out_of_bounds);
|
||||
//}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_compare_string)
|
||||
{
|
||||
|
||||
@ -3052,48 +3052,6 @@ namespace
|
||||
CHECK_EQUAL(IText::npos, position2);
|
||||
}
|
||||
|
||||
////*************************************************************************
|
||||
//TEST_FIXTURE(SetupFixture, test_substr)
|
||||
//{
|
||||
// Compare_Text compare_text(initial_text.c_str());
|
||||
|
||||
// TextBuffer buffer;
|
||||
// Text text(initial_text.c_str());
|
||||
|
||||
// Compare_Text compare_result;
|
||||
|
||||
// TextBuffer buffer2;
|
||||
// Text result;
|
||||
|
||||
// // Equal.
|
||||
// compare_result = compare_text.substr(compare_text.size());
|
||||
// result = text.substr(text.size());
|
||||
// CHECK(Equal(compare_result, result));
|
||||
|
||||
// // Whole string.
|
||||
// compare_result = compare_text.substr();
|
||||
// result = text.substr();
|
||||
// CHECK(Equal(compare_result, result));
|
||||
|
||||
// // Starting from position 2.
|
||||
// compare_result = compare_text.substr(2);
|
||||
// result = text.substr(2);
|
||||
// CHECK(Equal(compare_result, result));
|
||||
|
||||
// // Starting from position 2 for 3 characters.
|
||||
// compare_result = compare_text.substr(2, 3);
|
||||
// result = text.substr(2, 3);
|
||||
// CHECK(Equal(compare_result, result));
|
||||
|
||||
// // Starting from position 2 for too many characters.
|
||||
// compare_result = compare_text.substr(2, compare_text.size());
|
||||
// result = text.substr(2, text.size());
|
||||
// CHECK(Equal(compare_result, result));
|
||||
|
||||
// // Starting from beyond the end of the string.
|
||||
// CHECK_THROW(text.substr(text.size() + 1), etl::wstring_out_of_bounds);
|
||||
//}
|
||||
|
||||
//*************************************************************************
|
||||
TEST_FIXTURE(SetupFixture, test_compare_string)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user