diff --git a/test/string_view_test2.cpp b/test/string_view_test2.cpp index 7a1c880..65fa04b 100644 --- a/test/string_view_test2.cpp +++ b/test/string_view_test2.cpp @@ -130,24 +130,29 @@ void find ( const char *arg ) { p = arg; // for all possible chars, see if we find them in the right place. // Note that strchr will/might do the _wrong_ thing if we search for NULL - for ( int ch = 1; ch < 256; ++ch ) { + + for ( unsigned char ch = 1u; ; ++ch ) { string_view::size_type pos = sr1.find(ch); const char *strp = std::strchr ( arg, ch ); BOOST_CHECK (( strp == NULL ) == ( pos == string_view::npos )); if ( strp != NULL ) BOOST_CHECK ( ptr_diff ( strp, arg ) == pos ); - } + if (ch == 255u) + break; + } sr1 = arg; p = arg; // for all possible chars, see if we find them in the right place. // Note that strchr will/might do the _wrong_ thing if we search for NULL - for ( int ch = 1; ch < 256; ++ch ) { + for ( unsigned char ch = 1u; ; ++ch ) { string_view::size_type pos = sr1.rfind(ch); const char *strp = std::strrchr ( arg, ch ); BOOST_CHECK (( strp == NULL ) == ( pos == string_view::npos )); if ( strp != NULL ) BOOST_CHECK ( ptr_diff ( strp, arg ) == pos ); + if (ch == 255u) + break; } diff --git a/test/string_view_test_io.cpp b/test/string_view_test_io.cpp index e1cb307..34d2345 100644 --- a/test/string_view_test_io.cpp +++ b/test/string_view_test_io.cpp @@ -75,7 +75,7 @@ struct context BOOST_AUTO_TEST_CASE_TEMPLATE(string_view_output, CharT, char_types) { typedef CharT char_type; - typedef std::basic_string< char_type > string_type; + //typedef std::basic_string< char_type > string_type; typedef std::basic_ostringstream< char_type > ostream_type; typedef boost::basic_string_view< char_type > string_view_type; @@ -90,7 +90,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(string_view_output, CharT, char_types) BOOST_AUTO_TEST_CASE_TEMPLATE(padding, CharT, char_types) { typedef CharT char_type; - typedef std::basic_string< char_type > string_type; + //typedef std::basic_string< char_type > string_type; typedef std::basic_ostringstream< char_type > ostream_type; typedef boost::basic_string_view< char_type > string_view_type; @@ -134,7 +134,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(padding, CharT, char_types) BOOST_AUTO_TEST_CASE_TEMPLATE(padding_fill, CharT, char_types) { typedef CharT char_type; - typedef std::basic_string< char_type > string_type; + //typedef std::basic_string< char_type > string_type; typedef std::basic_ostringstream< char_type > ostream_type; typedef boost::basic_string_view< char_type > string_view_type; @@ -153,7 +153,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(padding_fill, CharT, char_types) BOOST_AUTO_TEST_CASE_TEMPLATE(alignment, CharT, char_types) { typedef CharT char_type; - typedef std::basic_string< char_type > string_type; + //typedef std::basic_string< char_type > string_type; typedef std::basic_ostringstream< char_type > ostream_type; typedef boost::basic_string_view< char_type > string_view_type;