From 2b5de8003148bf2b4423ded5e767d3dfe6d92a5a Mon Sep 17 00:00:00 2001 From: Pavol Droba Date: Fri, 21 Jan 2005 16:49:06 +0000 Subject: [PATCH] Library adapted to use official version Boost.Range instead of the internal one. Internal version removed [SVN r26788] --- string/doc/Jamfile.v2 | 42 +++++----- string/example/replace_example.cpp | 7 +- string/example/split_example.cpp | 3 +- string/test/Jamfile | 10 +-- string/test/Jamfile.v2 | 8 +- string/test/container_test.cpp | 127 ----------------------------- 6 files changed, 28 insertions(+), 169 deletions(-) delete mode 100644 string/test/container_test.cpp diff --git a/string/doc/Jamfile.v2 b/string/doc/Jamfile.v2 index 5e99ba7..4a0bfcf 100644 --- a/string/doc/Jamfile.v2 +++ b/string/doc/Jamfile.v2 @@ -17,27 +17,27 @@ doxygen autodoc [ glob ../../../../boost/algorithm/string.hpp ] [ glob ../../../../boost/algorithm/string_regex.hpp ] - [ glob ../../../../boost/algorithm/string/classification.hpp ] - [ glob ../../../../boost/algorithm/string/iterator_range.hpp ] - [ glob ../../../../boost/algorithm/string/sequence_traits.hpp ] - [ glob ../../../../boost/algorithm/string/std_containers_traits.hpp ] - [ glob ../../../../boost/algorithm/string/collection_traits.hpp ] - [ glob ../../../../boost/algorithm/string/concept.hpp ] - [ glob ../../../../boost/algorithm/string/compare.hpp ] - [ glob ../../../../boost/algorithm/string/constants.hpp ] - [ glob ../../../../boost/algorithm/string/case_conv.hpp ] - [ glob ../../../../boost/algorithm/string/find.hpp ] - [ glob ../../../../boost/algorithm/string/finder.hpp ] - [ glob ../../../../boost/algorithm/string/find_iterator.hpp ] - [ glob ../../../../boost/algorithm/string/trim.hpp ] - [ glob ../../../../boost/algorithm/string/predicate.hpp ] - [ glob ../../../../boost/algorithm/string/split.hpp ] - [ glob ../../../../boost/algorithm/string/erase.hpp ] - [ glob ../../../../boost/algorithm/string/replace.hpp ] - [ glob ../../../../boost/algorithm/string/find_format.hpp ] - [ glob ../../../../boost/algorithm/string/formatter.hpp ] - [ glob ../../../../boost/algorithm/string/regex.hpp ] - [ glob ../../../../boost/algorithm/string/regex_find_format.hpp ] +# [ glob ../../../../boost/algorithm/string/classification.hpp ] +# [ glob ../../../../boost/algorithm/string/iterator_range.hpp ] +# [ glob ../../../../boost/algorithm/string/sequence_traits.hpp ] +# [ glob ../../../../boost/algorithm/string/std_containers_traits.hpp ] +# [ glob ../../../../boost/algorithm/string/collection_traits.hpp ] +# [ glob ../../../../boost/algorithm/string/concept.hpp ] +# [ glob ../../../../boost/algorithm/string/compare.hpp ] +# [ glob ../../../../boost/algorithm/string/constants.hpp ] +# [ glob ../../../../boost/algorithm/string/case_conv.hpp ] +# [ glob ../../../../boost/algorithm/string/find.hpp ] +# [ glob ../../../../boost/algorithm/string/finder.hpp ] +# [ glob ../../../../boost/algorithm/string/find_iterator.hpp ] +# [ glob ../../../../boost/algorithm/string/trim.hpp ] +# [ glob ../../../../boost/algorithm/string/predicate.hpp ] +# [ glob ../../../../boost/algorithm/string/split.hpp ] +# [ glob ../../../../boost/algorithm/string/erase.hpp ] +# [ glob ../../../../boost/algorithm/string/replace.hpp ] +# [ glob ../../../../boost/algorithm/string/find_format.hpp ] +# [ glob ../../../../boost/algorithm/string/formatter.hpp ] +# [ glob ../../../../boost/algorithm/string/regex.hpp ] +# [ glob ../../../../boost/algorithm/string/regex_find_format.hpp ] : HIDE_UNDOC_MEMBERS=YES EXTRACT_PRIVATE=NO diff --git a/string/example/replace_example.cpp b/string/example/replace_example.cpp index b176777..12089fa 100644 --- a/string/example/replace_example.cpp +++ b/string/example/replace_example.cpp @@ -10,9 +10,10 @@ #include #include #include -#include -#include -#include +//#include +//#include +//#include +#include //Following two includes contain second-layer function. //They are already included by first-layer header diff --git a/string/example/split_example.cpp b/string/example/split_example.cpp index ea4f25b..27e261c 100644 --- a/string/example/split_example.cpp +++ b/string/example/split_example.cpp @@ -12,7 +12,6 @@ #include #include #include -#include #include #include #include @@ -36,7 +35,7 @@ int main() It!=string_find_iterator(); ++It) { - cout << copy_iterator_range(*It) << endl; + cout << copy_range(*It) << endl; // shift all chars in the match by one transform( It->begin(), It->end(), diff --git a/string/test/Jamfile b/string/test/Jamfile index 247f734..99cbeef 100644 --- a/string/test/Jamfile +++ b/string/test/Jamfile @@ -17,15 +17,7 @@ DEPENDS all : test ; { test-suite algorithm/string - : [ run - container_test.cpp - : : - : - std::locale-support - std::facet-support - : container - ] - [ run + : [ run trim_test.cpp : : : diff --git a/string/test/Jamfile.v2 b/string/test/Jamfile.v2 index d633d22..d8e35b7 100644 --- a/string/test/Jamfile.v2 +++ b/string/test/Jamfile.v2 @@ -10,13 +10,7 @@ import testing ; test-suite algorithm/string - : [ run - container_test.cpp - : : - : - : container - ] - [ run + : [ run trim_test.cpp : : : diff --git a/string/test/container_test.cpp b/string/test/container_test.cpp deleted file mode 100644 index 1257e35..0000000 --- a/string/test/container_test.cpp +++ /dev/null @@ -1,127 +0,0 @@ -// Boost string_algo library substr_test.cpp file ------------------// - -// Copyright Pavol Droba 2002-2003. Use, modification and -// distribution is subject to the Boost Software License, Version -// 1.0. (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -// See http://www.boost.org for updates, documentation, and revision history. - -#include -// equals predicate is used for result comparison -#include - -// Include unit test framework -#include - -#include -#include -#include - -#include - -// test tools -#include - - -using namespace std; -using namespace boost; - -namespace algo = ::boost::algorithm; - -template< typename T > -void argument_cv_test( const T& C, const string& strResult ) -{ - BOOST_CHECK( equals( make_iterator_range(algo::begin(C),algo::end(C)), strResult ) ); - BOOST_CHECK( algo::size(C)==strResult.size() ); - BOOST_CHECK( algo::empty(C)==strResult.empty() ); -} - -template< typename T > -void argument_test( T& C, const string& strResult ) -{ - BOOST_CHECK( equals( make_iterator_range(algo::begin(C),algo::end(C)), strResult ) ); - BOOST_CHECK( algo::size(C)==strResult.size() ); - BOOST_CHECK( algo::empty(C)==strResult.empty() ); -} - -void container_test() -{ - BOOST_CHECKPOINT( "type test" ); - - // types test - BOOST_REQUIRE( (is_same< - algo::result_iterator_of::type, - string::iterator>::value) ); - BOOST_REQUIRE( (is_same< - algo::result_iterator_of::type, - string::const_iterator>::value) ); - BOOST_REQUIRE( (is_same< - algo::result_iterator_of::type, char*>::value) ); - BOOST_REQUIRE( (is_same< - algo::result_iterator_of::type, - const char*>::value) ); - BOOST_REQUIRE( (is_same< - algo::result_iterator_of::type, char*>::value) ); - BOOST_REQUIRE( (is_same< - algo::result_iterator_of::type, - const char*>::value) ); - BOOST_REQUIRE( (is_same< - algo::result_iterator_of< - pair >::type, string::iterator>::value) ); - BOOST_REQUIRE( (is_same< - algo::result_iterator_of< - const pair >::type, - string::iterator>::value) ); - - BOOST_CHECKPOINT( "non-empty sequence test" ); - - string str1("abc"); - vector vec1( str1.begin(), str1.end() ); - pair pair1= - make_pair( str1.begin(), str1.end() ); - char ach1[]="abc"; - char *pch1="abc"; - - // begin/end tests - argument_cv_test( str1, "abc" ); - argument_test( str1, "abc" ); - argument_cv_test( vec1, "abc" ); - argument_test( vec1, "abc" ); - argument_cv_test( pair1, "abc" ); - argument_test( pair1, "abc" ); - argument_cv_test( ach1, "abc" ); - argument_test( ach1, "abc" ); - argument_cv_test( pch1, "abc" ); - argument_test( pch1, "abc" ); - - BOOST_CHECKPOINT( "empty sequence test" ); - - string str2; - vector vec2( str2.begin(), str2.end() ); - pair pair2= - make_pair( str2.begin(), str2.end() ); - char ach2[]=""; - char *pch2=0; - - // begin/end tests - argument_cv_test( str2, "" ); - argument_test( str2, "" ); - argument_cv_test( vec2, "" ); - argument_test( vec2, "" ); - argument_cv_test( pair2, "" ); - argument_test( pair2, "" ); - argument_cv_test( ach2, "" ); - argument_test( ach2, "" ); - argument_cv_test( pch2, "" ); - argument_test( pch2, "" ); -}; - - -// test main -int test_main( int, char*[] ) -{ - container_test(); - - return 0; -}