text
stringlengths 0
2.2M
|
---|
position2 = text.find_first_of(STR('Z'));
|
CHECK_EQUAL(position1, position2);
|
position1 = compare_text.find_first_of(STR('F'), 3);
|
position2 = text.find_first_of(STR('F'), 3);
|
CHECK_EQUAL(position1, position2);
|
position1 = compare_text.find_first_of(STR('C'), 3);
|
position2 = text.find_first_of(STR('C'), 3);
|
CHECK_EQUAL(position1, position2);
|
position1 = compare_text.find_first_of(STR('C'), compare_text.size());
|
position2 = text.find_first_of(STR('C'), text.size());
|
CHECK_EQUAL(position1, position2);
|
position1 = compare_text.find_first_of(STR('C'), 100);
|
position2 = text.find_first_of(STR('C'), 100);
|
CHECK_EQUAL(position1, position2);
|
}
|
//*************************************************************************
|
TEST_FIXTURE(SetupFixture, test_find_last_of_string_position)
|
{
|
Compare_Text compare_text(STR("ABCDEFABCDE"));
|
TextBuffer buffer;
|
Text text(STR("ABCDEFABCDE"), buffer.data(), buffer.size());
|
size_t position1 = compare_text.find_last_of(Compare_Text(STR("ZCXE")));
|
size_t position2 = text.find_last_of(TextT(STR("ZCXE")));
|
CHECK_EQUAL(position1, position2);
|
position1 = compare_text.find_last_of(Compare_Text(STR("WXYZ")), 3);
|
position2 = text.find_last_of(TextT(STR("WXYZ")), 3);
|
CHECK_EQUAL(position1, position2);
|
position1 = compare_text.find_last_of(Compare_Text(STR("ZCXE")), 5);
|
position2 = text.find_last_of(TextT(STR("ZCXE")), 5);
|
CHECK_EQUAL(position1, position2);
|
position1 = compare_text.find_last_of(Compare_Text(STR("ZCXE")), compare_text.size());
|
position2 = text.find_last_of(TextT(STR("ZCXE")), text.size());
|
CHECK_EQUAL(position1, position2);
|
position1 = compare_text.find_last_of(Compare_Text(STR("ZCXE")), 100);
|
position2 = text.find_last_of(TextT(STR("ZCXE")), 100);
|
CHECK_EQUAL(position1, position2);
|
}
|
//*************************************************************************
|
TEST_FIXTURE(SetupFixture, test_find_last_of_pointer_position)
|
{
|
Compare_Text compare_text(STR("ABCDEFABCDE"));
|
TextBuffer buffer;
|
Text text(STR("ABCDEFABCDE"), buffer.data(), buffer.size());
|
size_t position1 = compare_text.find_last_of(STR("ZCXE"));
|
size_t position2 = text.find_last_of(STR("ZCXE"));
|
CHECK_EQUAL(position1, position2);
|
position1 = compare_text.find_last_of(STR("WXYZ"), 3);
|
position2 = text.find_last_of(STR("WXYZ"), 3);
|
CHECK_EQUAL(position1, position2);
|
position1 = compare_text.find_last_of(STR("ZCXE"), 5);
|
position2 = text.find_last_of(STR("ZCXE"), 5);
|
CHECK_EQUAL(position1, position2);
|
position1 = compare_text.find_last_of(STR("ZCXE"), 6);
|
position2 = text.find_last_of(STR("ZCXE"), 6);
|
CHECK_EQUAL(position1, position2);
|
position1 = compare_text.find_last_of(STR("ZCXE"), compare_text.size());
|
position2 = text.find_last_of(STR("ZCXE"), text.size());
|
CHECK_EQUAL(position1, position2);
|
position1 = compare_text.find_last_of(STR("ZCXE"), 100);
|
position2 = text.find_last_of(STR("ZCXE"), 100);
|
CHECK_EQUAL(position1, position2);
|
}
|
//*************************************************************************
|
TEST_FIXTURE(SetupFixture, test_find_last_of_pointer_position_n)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.