|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r86218 - in branches/release: boost/algorithm/string libs/algorithm/string/test
From: marshall_at_[hidden]
Date: 2013-10-09 14:09:40
Author: marshall
Date: 2013-10-09 14:09:40 EDT (Wed, 09 Oct 2013)
New Revision: 86218
URL: http://svn.boost.org/trac/boost/changeset/86218
Log:
Merge bug fix for #9063 to release
Properties modified:
branches/release/boost/algorithm/string/find_iterator.hpp (contents, props changed)
branches/release/libs/algorithm/string/test/find_test.cpp (contents, props changed)
Text files modified:
branches/release/boost/algorithm/string/find_iterator.hpp | 7 +------
branches/release/libs/algorithm/string/test/find_test.cpp | 28 +++++++++++++++-------------
2 files changed, 16 insertions(+), 19 deletions(-)
Modified: branches/release/boost/algorithm/string/find_iterator.hpp
==============================================================================
--- branches/release/boost/algorithm/string/find_iterator.hpp Wed Oct 9 13:04:12 2013 (r86217)
+++ branches/release/boost/algorithm/string/find_iterator.hpp 2013-10-09 14:09:40 EDT (Wed, 09 Oct 2013) (r86218)
@@ -132,12 +132,7 @@
// increment
void increment()
{
- if(m_Match.begin() == m_Match.end())
- m_Match=this->do_find(m_Match.end(),m_End);
- else {
- input_iterator_type last = m_Match.begin();
- m_Match=this->do_find(++last,m_End);
- }
+ m_Match=this->do_find(m_Match.end(),m_End);
}
// comparison
Modified: branches/release/libs/algorithm/string/test/find_test.cpp
==============================================================================
--- branches/release/libs/algorithm/string/test/find_test.cpp Wed Oct 9 13:04:12 2013 (r86217)
+++ branches/release/libs/algorithm/string/test/find_test.cpp 2013-10-09 14:09:40 EDT (Wed, 09 Oct 2013) (r86218)
@@ -181,6 +181,21 @@
( (cv_result.begin()-str1.begin()) == 3) &&
( (cv_result.end()-str1.begin()) == 6) );
+ string s1("abc def ghi jkl");
+ find_iterator<string::iterator> fEnd;
+
+ find_iterator<string::iterator> fxIt = make_find_iterator(s1,
+ token_finder(is_alnum(), token_compress_on));
+ BOOST_CHECK((fxIt != fEnd) && (*fxIt == string("abc")));
+ ++fxIt;
+ BOOST_CHECK((fxIt != fEnd) && (*fxIt == string("def")));
+ ++fxIt;
+ BOOST_CHECK((fxIt != fEnd) && (*fxIt == string("ghi")));
+ ++fxIt;
+ BOOST_CHECK((fxIt != fEnd) && (*fxIt == string("jkl")));
+ ++fxIt;
+ BOOST_CHECK(fxIt == fEnd);
+
nc_result=find_token( str1, is_any_of("abc"), token_compress_off );
BOOST_CHECK(
( (nc_result.begin()-str1.begin()) == 3) &&
@@ -251,19 +266,6 @@
osstr << find_first( str1, "abc" );
BOOST_CHECK( osstr.str()=="abc" );
- // Empty string test
- BOOST_TEST_CHECKPOINT( "overlapping" );
-
- std::string overlap_target("aaaa");
- std::vector<boost::iterator_range<std::string::iterator> > overlap_results;
- boost::algorithm::find_all(overlap_results, overlap_target, string("aaa"));
- BOOST_CHECK( overlap_results.size() == 2 );
-
- std::string overlap_target2("aaaabbbbaaaa");
- boost::algorithm::find_all(overlap_results, overlap_target2, string("bb"));
- BOOST_CHECK( overlap_results.size() == 3 );
- boost::algorithm::find_all(overlap_results, overlap_target2, string("aa"));
- BOOST_CHECK( overlap_results.size() == 6 );
}
// test main
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk