text
stringlengths
0
2.2M
Text text(STR("ABCDEF"), buffer.data(), buffer.size());
size_t position1 = compare_text.find_first_of(Compare_Text(STR("ZCXF")));
size_t position2 = text.find_first_of(TextT(STR("ZCXF")));
CHECK_EQUAL(position1, position2);
position1 = compare_text.find_first_of(Compare_Text(STR("WXYZ")));
position2 = text.find_first_of(TextT(STR("WXYZ")));
CHECK_EQUAL(position1, position2);
position1 = compare_text.find_first_of(Compare_Text(STR("ZCXF")), 3);
position2 = text.find_first_of(TextT(STR("ZCXF")), 3);
CHECK_EQUAL(position1, position2);
position1 = compare_text.find_first_of(Compare_Text(STR("ZCXF")), 100);
position2 = text.find_first_of(TextT(STR("ZCXF")), 100);
CHECK_EQUAL(position1, position2);
}
//*************************************************************************
TEST_FIXTURE(SetupFixture, test_find_first_of_pointer_position)
{
Compare_Text compare_text(STR("ABCDEF"));
TextBuffer buffer;
Text text(STR("ABCDEF"), buffer.data(), buffer.size());
size_t position1 = compare_text.find_first_of(STR("ZCXF"));
size_t position2 = text.find_first_of(STR("ZCXF"));
CHECK_EQUAL(position1, position2);
position1 = compare_text.find_first_of(STR("WXYZ"));
position2 = text.find_first_of(STR("WXYZ"));
CHECK_EQUAL(position1, position2);
position1 = compare_text.find_first_of(STR("ZCXF"), 3);
position2 = text.find_first_of(STR("ZCXF"), 3);
CHECK_EQUAL(position1, position2);
position1 = compare_text.find_first_of(STR("ZCXF"), 100);
position2 = text.find_first_of(STR("ZCXF"), 100);
CHECK_EQUAL(position1, position2);
}
//*************************************************************************
TEST_FIXTURE(SetupFixture, test_find_first_of_pointer_position_n)
{
Compare_Text compare_text(STR("ABCDEF"));
TextBuffer buffer;
Text text(STR("ABCDEF"), buffer.data(), buffer.size());
size_t position1 = compare_text.find_first_of(STR("ZCXF"), 0, 4);
size_t position2 = text.find_first_of(STR("ZCXF"), 0, 4);
CHECK_EQUAL(position1, position2);
position1 = compare_text.find_first_of(STR("WXYZ"), 0, 4);
position2 = text.find_first_of(STR("WXYZ"), 0, 4);
CHECK_EQUAL(position1, position2);
position1 = compare_text.find_first_of(STR("ZCXF"), 1, 3);
position2 = text.find_first_of(STR("ZCXF"), 1, 3);
CHECK_EQUAL(position1, position2);
position1 = compare_text.find_first_of(STR("ZCXF"), 3, 3);
position2 = text.find_first_of(STR("ZCXF"), 3, 3);
CHECK_EQUAL(position1, position2);
position1 = compare_text.find_first_of(STR("ZCXF"), 100);
position2 = text.find_first_of(STR("ZCXF"), 100);
CHECK_EQUAL(position1, position2);
}
//*************************************************************************
TEST_FIXTURE(SetupFixture, test_find_first_of_character_position)
{
Compare_Text compare_text(STR("ABCDEF"));
TextBuffer buffer;
Text text(STR("ABCDEF"), buffer.data(), buffer.size());
size_t position1 = compare_text.find_first_of(STR('C'));
size_t position2 = text.find_first_of(STR('C'));
CHECK_EQUAL(position1, position2);
position1 = compare_text.find_first_of(STR('Z'));