Define small functions inline, improve replace and insert coverage

This commit is contained in:
Krystian Stasiowski
2020-02-21 11:26:27 -05:00
parent 165f811334
commit 14a846faac
2 changed files with 139 additions and 232 deletions

View File

@ -937,6 +937,20 @@ testInsert()
BOOST_TEST(s == "abcd");
}
// insert(size_type, static_string) checked
{
static_string<10> s1 = "ad";
static_string<10> s2 = "bc";
BOOST_TEST(s1.insert(1, s2) == "abcd");
}
// insert(size_type, static_string, size_type, size_type)
{
static_string<10> s1 = "ad";
static_string<10> s2 = "abcd";
BOOST_TEST(s1.insert(1, s2, 1, 2) == "abcd");
}
// insert(size_type index, T const& t)
{
struct T
@ -5735,11 +5749,23 @@ testReplace()
static_string<20> fs1 = "helloworld";
BOOST_TEST(fs1.replace(0, fs1.size(), fs1) == "helloworld");
}
// replace(size_type pos1, size_type n1, const basic_string& str); unchecked
{
static_string<20> fs1 = "helloworld";
static_string<15> fs2 = "helloworld";
BOOST_TEST(fs1.replace(0, fs1.size(), fs2) == "helloworld");
}
// replace(size_type pos1, size_type n1, const basic_string& str, size_type pos2, size_type n2 = npos);
{
static_string<20> fs1 = "helloworld";
BOOST_TEST(fs1.replace(0, fs1.size(), fs1, 0, fs1.size()) == "helloworld");
}
// replace(size_type pos1, size_type n1, const basic_string& str, size_type pos2, size_type n2 = npos); unchecked
{
static_string<20> fs1 = "helloworld";
static_string<15> fs2 = "helloworld";
BOOST_TEST(fs1.replace(0, fs1.size(), fs2, 0, fs2.size()) == "helloworld");
}
// replace(size_type pos1, size_type n1, const T& t);
{
static_string<20> fs1 = "helloworld";
@ -5765,6 +5791,12 @@ testReplace()
static_string<20> fs1 = "helloworld";
BOOST_TEST(fs1.replace(fs1.begin(), fs1.end(), fs1) == "helloworld");
}
// replace(const_iterator i1, const_iterator i2, const basic_string& str); unchecked
{
static_string<20> fs1 = "helloworld";
static_string<15> fs2 = "helloworld";
BOOST_TEST(fs1.replace(fs1.begin(), fs1.end(), fs2) == "helloworld");
}
// replace(const_iterator i1, const_iterator i2, const T& t);
{
static_string<20> fs1 = "helloworld";