Update string_ref_test2.cpp

For ticket# 10838
This commit is contained in:
akumta 2015-02-25 10:49:14 -08:00
parent 7306c8c359
commit fa8301a56a

View File

@ -18,7 +18,7 @@
typedef boost::string_ref string_ref; typedef boost::string_ref string_ref;
void ends_with ( const char *arg ) { void ends_with ( const char *arg ) {
const size_t sz = strlen ( arg ); const size_t sz = std::strlen ( arg );
string_ref sr ( arg ); string_ref sr ( arg );
string_ref sr2 ( arg ); string_ref sr2 ( arg );
const char *p = arg; const char *p = arg;
@ -48,7 +48,7 @@ void ends_with ( const char *arg ) {
} }
void starts_with ( const char *arg ) { void starts_with ( const char *arg ) {
const size_t sz = strlen ( arg ); const size_t sz = std::strlen ( arg );
string_ref sr ( arg ); string_ref sr ( arg );
string_ref sr2 ( arg ); string_ref sr2 ( arg );
const char *p = arg + std::strlen ( arg ) - 1; const char *p = arg + std::strlen ( arg ) - 1;
@ -159,7 +159,7 @@ void find ( const char *arg ) {
// Find everything at the end // Find everything at the end
sr1 = arg; sr1 = arg;
p = arg + strlen ( arg ) - 1; p = arg + std::strlen ( arg ) - 1;
while ( !sr1.empty ()) { while ( !sr1.empty ()) {
string_ref::size_type pos = sr1.rfind(*p); string_ref::size_type pos = sr1.rfind(*p);
BOOST_CHECK ( pos == sr1.size () - 1 ); BOOST_CHECK ( pos == sr1.size () - 1 );
@ -180,7 +180,7 @@ void find ( const char *arg ) {
// Find everything at the end // Find everything at the end
sr1 = arg; sr1 = arg;
p = arg + strlen ( arg ) - 1; p = arg + std::strlen ( arg ) - 1;
while ( !sr1.empty ()) { while ( !sr1.empty ()) {
string_ref::size_type pos = sr1.find_last_of(*p); string_ref::size_type pos = sr1.find_last_of(*p);
BOOST_CHECK ( pos == sr1.size () - 1 ); BOOST_CHECK ( pos == sr1.size () - 1 );