Use beast::string_view alias

This commit is contained in:
Vinnie Falco
2017-07-20 08:12:16 -07:00
parent f50a37b778
commit 84ece031f2
36 changed files with 319 additions and 288 deletions
+13 -13
View File
@@ -123,13 +123,13 @@ public:
}
{
static_string<3> s1(
boost::string_ref("123"));
string_view("123"));
BEAST_EXPECT(s1 == "123");
BEAST_EXPECT(*s1.end() == 0);
try
{
static_string<2> s2(
boost::string_ref("123"));
string_view("123"));
fail("", __FILE__, __LINE__);
}
catch(std::length_error const&)
@@ -232,13 +232,13 @@ public:
}
{
static_string<3> s1;
s1 = boost::string_ref("123");
s1 = string_view("123");
BEAST_EXPECT(s1 == "123");
BEAST_EXPECT(*s1.end() == 0);
try
{
static_string<1> s2;
s2 = boost::string_ref("123");
s2 = string_view("123");
fail("", __FILE__, __LINE__);
}
catch(std::length_error const&)
@@ -370,15 +370,15 @@ public:
}
{
static_string<5> s1;
s1.assign(boost::string_ref("123"));
s1.assign(string_view("123"));
BEAST_EXPECT(s1 == "123");
BEAST_EXPECT(*s1.end() == 0);
s1.assign(boost::string_ref("12345"));
s1.assign(string_view("12345"));
BEAST_EXPECT(s1 == "12345");
BEAST_EXPECT(*s1.end() == 0);
try
{
s1.assign(boost::string_ref("1234567"));
s1.assign(string_view("1234567"));
fail("", __FILE__, __LINE__);
}
catch(std::length_error const&)
@@ -483,7 +483,7 @@ public:
}
{
static_string<3> s("123");
boost::string_ref sv = s;
string_view sv = s;
BEAST_EXPECT(static_string<5>(sv) == "123");
}
}
@@ -750,13 +750,13 @@ public:
}
{
static_string<5> s1("123");
s1.insert(1, boost::string_ref("UV"));
s1.insert(1, string_view("UV"));
BEAST_EXPECT(s1 == "1UV23");
BEAST_EXPECT(*s1.end() == 0);
try
{
static_string<4> s2("123");
s2.insert(1, boost::string_ref("UV"));
s2.insert(1, string_view("UV"));
fail("", __FILE__, __LINE__);
}
catch(std::length_error const&)
@@ -766,7 +766,7 @@ public:
try
{
static_string<5> s2("123");
s2.insert(5, boost::string_ref("UV"));
s2.insert(5, string_view("UV"));
fail("", __FILE__, __LINE__);
}
catch(std::out_of_range const&)
@@ -1024,7 +1024,7 @@ public:
}
}
{
boost::string_ref s1("XYZ");
string_view s1("XYZ");
static_string<5> s2("12");
s2.append(s1);
BEAST_EXPECT(s2 == "12XYZ");
@@ -1124,7 +1124,7 @@ public:
}
}
{
boost::string_ref s1("34");
string_view s1("34");
static_string<4> s2("12");
s2 += s1;
BEAST_EXPECT(s2 == "1234");