From dc96b440beebc363e90222a7ba65ec09ae208f11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorsten=20J=C3=B8rgen=20Ottosen?= Date: Thu, 18 May 2006 19:17:04 +0000 Subject: [PATCH] v2 upgrade [SVN r34011] --- test/Jamfile | 4 + test/algorithm_example.cpp | 5 +- test/array.cpp | 8 +- test/extension_mechanism.cpp | 14 ++-- test/iterator_pair.cpp | 8 +- test/iterator_range.cpp | 22 ++++-- test/partial_workaround.cpp | 7 +- test/reversible_range.cpp | 39 ++-------- test/std_container.cpp | 8 +- test/string.cpp | 146 ++++++++++++++++++++++------------- 10 files changed, 136 insertions(+), 125 deletions(-) diff --git a/test/Jamfile b/test/Jamfile index 4a8ef6d..b00b99d 100755 --- a/test/Jamfile +++ b/test/Jamfile @@ -17,6 +17,7 @@ rule range-test ( name : includes * ) return [ run $(name).cpp ../../test/build/boost_unit_test_framework + ../../regex/build/boost_regex : : : $(BOOST_ROOT) @@ -36,6 +37,9 @@ test-suite range : [ range-test reversible_range ] [ range-test const_ranges ] [ range-test extension_mechanism ] +# [ range-test test ] +# [ range-test algorithm ] +# [ range-test adaptors ] # [ range-test mfc : $(VC71_ROOT)/atlmfc/include ] ; diff --git a/test/algorithm_example.cpp b/test/algorithm_example.cpp index cd6e0e0..3bfb71f 100755 --- a/test/algorithm_example.cpp +++ b/test/algorithm_example.cpp @@ -17,6 +17,7 @@ #include #include +#include #include #include #include @@ -70,12 +71,8 @@ void check_algorithm() typedef std::vector::iterator iterator; std::pair my_view( boost::begin( my_vector ), boost::begin( my_vector ) + N ); - char str_val[] = "a string"; - char* str = str_val; - BOOST_CHECK_EQUAL( my_generic_replace( my_vector, 4, 2 ), 3u ); BOOST_CHECK_EQUAL( my_generic_replace( my_view, 4, 2 ), N ); - BOOST_CHECK_EQUAL( my_generic_replace( str, 'a', 'b' ), 0u ); } diff --git a/test/array.cpp b/test/array.cpp index d2f00b0..db7054d 100755 --- a/test/array.cpp +++ b/test/array.cpp @@ -42,16 +42,16 @@ void check_array() BOOST_STATIC_ASSERT(( is_same< range_const_iterator::type, const int* >::value )); BOOST_STATIC_ASSERT(( is_same< range_difference::type, std::ptrdiff_t >::value )); BOOST_STATIC_ASSERT(( is_same< range_size::type, std::size_t >::value )); - BOOST_STATIC_ASSERT(( is_same< range_result_iterator::type, int* >::value )); - BOOST_STATIC_ASSERT(( is_same< range_result_iterator::type, const int* >::value )); + BOOST_STATIC_ASSERT(( is_same< range_iterator::type, int* >::value )); + BOOST_STATIC_ASSERT(( is_same< range_iterator::type, const int* >::value )); BOOST_STATIC_ASSERT(( is_same< range_value::type, const int >::value )); BOOST_STATIC_ASSERT(( is_same< range_iterator::type, const int* >::value )); BOOST_STATIC_ASSERT(( is_same< range_const_iterator::type, const int* >::value )); BOOST_STATIC_ASSERT(( is_same< range_difference::type, std::ptrdiff_t >::value )); BOOST_STATIC_ASSERT(( is_same< range_size::type, std::size_t >::value )); - BOOST_STATIC_ASSERT(( is_same< range_result_iterator::type, const int* >::value )); - BOOST_STATIC_ASSERT(( is_same< range_result_iterator::type, const int* >::value )); + BOOST_STATIC_ASSERT(( is_same< range_iterator::type, const int* >::value )); + BOOST_STATIC_ASSERT(( is_same< range_iterator::type, const int* >::value )); #endif BOOST_CHECK_EQUAL( begin( my_array ), my_array ); diff --git a/test/extension_mechanism.cpp b/test/extension_mechanism.cpp index 0a272c3..2fd7929 100755 --- a/test/extension_mechanism.cpp +++ b/test/extension_mechanism.cpp @@ -25,7 +25,7 @@ // Generic range algorithm // template< class Rng > -typename boost::range_result_iterator::type foo_algo( Rng& r ) +typename boost::range_iterator::type foo_algo( Rng& r ) { // // This will only compile for Rng = UDT if the qualified calls @@ -57,32 +57,28 @@ namespace Foo // to be defined because X defines the proper set of // nested types. // - inline X::iterator boost_range_begin( X& x ) + inline X::iterator range_begin( X& x ) { return x.vec.begin(); } - inline X::const_iterator boost_range_begin( const X& x ) + inline X::const_iterator range_begin( const X& x ) { return x.vec.begin(); } - inline X::iterator boost_range_end( X& x ) + inline X::iterator range_end( X& x ) { return x.vec.end(); } - inline X::const_iterator boost_range_end( const X& x ) + inline X::const_iterator range_end( const X& x ) { return x.vec.end(); } - inline X::size_type boost_range_size( const X& x ) - { - return x.vec.size(); - } } void check_extension() diff --git a/test/iterator_pair.cpp b/test/iterator_pair.cpp index 74358ef..db82f64 100755 --- a/test/iterator_pair.cpp +++ b/test/iterator_pair.cpp @@ -46,8 +46,8 @@ void check_iterator_pair() BOOST_STATIC_ASSERT(( is_same< range_difference::type, detail::iterator_traits::difference_type >::value )); BOOST_STATIC_ASSERT(( is_same< range_size::type, std::size_t >::value )); - BOOST_STATIC_ASSERT(( is_same< range_result_iterator::type, pair_t::first_type >::value )); - BOOST_STATIC_ASSERT(( is_same< range_result_iterator::type, const_pair_t::first_type >::value )); + BOOST_STATIC_ASSERT(( is_same< range_iterator::type, pair_t::first_type >::value )); + BOOST_STATIC_ASSERT(( is_same< range_iterator::type, const_pair_t::first_type >::value )); BOOST_STATIC_ASSERT(( is_same< range_value::type, detail::iterator_traits::value_type>::value )); @@ -56,8 +56,8 @@ void check_iterator_pair() BOOST_STATIC_ASSERT(( is_same< range_difference::type, detail::iterator_traits::difference_type >::value )); BOOST_STATIC_ASSERT(( is_same< range_size::type, std::size_t >::value )); - BOOST_STATIC_ASSERT(( is_same< range_result_iterator::type, const_pair_tt::first_type >::value )); - BOOST_STATIC_ASSERT(( is_same< range_result_iterator::type, const_pair_tt::first_type >::value )); + BOOST_STATIC_ASSERT(( is_same< range_iterator::type, const_pair_tt::first_type >::value )); + BOOST_STATIC_ASSERT(( is_same< range_iterator::type, const_pair_tt::first_type >::value )); BOOST_CHECK( begin( pair ) == pair.first ); BOOST_CHECK( end( pair ) == pair.second ); diff --git a/test/iterator_range.cpp b/test/iterator_range.cpp index 20696aa..152ac76 100755 --- a/test/iterator_range.cpp +++ b/test/iterator_range.cpp @@ -8,6 +8,7 @@ // For more information, see http://www.boost.org/libs/range/ // +//#include #include @@ -16,7 +17,6 @@ # pragma warn -8057 // unused argument argc/argv in Boost.Test #endif - #include #include #include @@ -26,7 +26,7 @@ using namespace boost; using namespace std; - + void check_reference_type(); void check_iterator_range() @@ -65,6 +65,12 @@ void check_iterator_range() BOOST_CHECK_EQUAL( distance( r.begin(), r.end() ), distance( begin( r2 ), end( r2 ) ) ); cout << r << r2; + + +#ifndef BOOST_NO_STD_WSTRING + wcout << make_iterator_range( wstring( L"a wide string" ) ) + << make_iterator_range( L"another wide string" ); +#endif string res = copy_range( r ); BOOST_CHECK( equal( res.begin(), res.end(), r.begin() ) ); @@ -94,7 +100,7 @@ void check_iterator_range() rrr = make_iterator_range( rrr, -1, 1 ); BOOST_CHECK( rrr == str ); - check_reference_type(); + check_reference_type(); } @@ -121,13 +127,13 @@ test_suite* init_unit_test_suite( int argc, char* argv[] ) template< class Container > int test_iter_range( Container& a_cont ) { - typedef BOOST_DEDUCED_TYPENAME range_result_iterator::type citer_type; + typedef BOOST_DEDUCED_TYPENAME range_iterator::type citer_type; typedef iterator_range riter_type; riter_type a_riter( make_iterator_range( a_cont ) ); - a_riter.front(); - a_riter.back(); - int i = a_riter[0]; - return i; + a_riter.front(); + a_riter.back(); + int i = a_riter[0]; + return i; } diff --git a/test/partial_workaround.cpp b/test/partial_workaround.cpp index ba014ae..8ac6f66 100755 --- a/test/partial_workaround.cpp +++ b/test/partial_workaround.cpp @@ -17,18 +17,15 @@ #endif #ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION +//#define BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION 1 #include #include #include #include #include -#include -#include -#include -#include -#include +#include #include #include diff --git a/test/reversible_range.cpp b/test/reversible_range.cpp index 26d953a..c3d943e 100755 --- a/test/reversible_range.cpp +++ b/test/reversible_range.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -31,7 +32,7 @@ using namespace std; void check_iterator() { - typedef vector vec_t; + typedef vector vec_t; typedef vec_t::iterator iterator; typedef pair pair_t; typedef range_reverse_iterator::type rev_iterator; @@ -40,15 +41,8 @@ void check_iterator() vec_t vec; pair_t p = make_pair( vec.begin(), vec.end() ); rev_pair_t rp = make_pair( rbegin( p ), rend( p ) ); - char* str = "mutable"; - const char* cstr = "not mutable"; - char a[] = "mutable"; - const char ca[] = "not mutable"; - wchar_t* wstr = L"mutable"; - const wchar_t* cwstr= L"not mutable"; - wchar_t wa[] = L"mutable"; - const wchar_t cwa[]= L"not mutable"; - + int a[] = {1,2,3,4,5,6,7,8,9,10}; + const int ca[] = {1,2,3,4,5,6,7,8,9,10,11,12}; BOOST_CHECK( rbegin( vec ) == range_reverse_iterator::type( vec.end() ) ); BOOST_CHECK( rend( vec ) == range_reverse_iterator::type( vec.begin() ) ); BOOST_CHECK( std::distance( rbegin( vec ), rend( vec ) ) == std::distance( begin( vec ), end( vec ) ) ); @@ -58,33 +52,16 @@ void check_iterator() BOOST_CHECK( std::distance( rbegin( p ), rend( p ) ) == std::distance( begin( rp ), end( rp ) ) ); BOOST_CHECK( std::distance( begin( p ), end( p ) ) == std::distance( rbegin( rp ), rend( rp ) ) ); - BOOST_CHECK_EQUAL( &*begin( str ), &*( rend( str ) - 1 ) ); - BOOST_CHECK_EQUAL( &*( end( str ) - 1 ), &*rbegin( str ) ); - BOOST_CHECK_EQUAL( &*begin( cstr ), &*( rend( cstr ) - 1 ) ); - BOOST_CHECK_EQUAL( &*( end( cstr ) - 1 ), &*rbegin( cstr ) ); - - BOOST_CHECK_EQUAL( &*begin( a ), &*( rend( a ) - 1 ) ); - BOOST_CHECK_EQUAL( &*( end( a ) - 1 ), &*rbegin( a ) ); - BOOST_CHECK_EQUAL( &*begin( ca ), &*( rend( ca ) - 1 ) ); - BOOST_CHECK_EQUAL( &*( end( ca ) - 1 ), &*rbegin( ca ) ); - - BOOST_CHECK_EQUAL( &*begin( wstr ), &*( rend( wstr ) - 1 ) ); - BOOST_CHECK_EQUAL( &*( end( wstr ) - 1 ), &*rbegin( wstr ) ); - BOOST_CHECK_EQUAL( &*begin( cwstr ), &*( rend( cwstr ) - 1 ) ); - BOOST_CHECK_EQUAL( &*( end( cwstr ) - 1 ), &*rbegin( cwstr ) ); - - BOOST_CHECK_EQUAL( &*begin( wa ), &*( rend( wa ) - 1 ) ); - BOOST_CHECK_EQUAL( &*( end( wa ) - 1 ), &*rbegin( wa ) ); - BOOST_CHECK_EQUAL( &*begin( cwa ), &*( rend( cwa ) - 1 ) ); - BOOST_CHECK_EQUAL( &*( end( cwa ) - 1 ), &*rbegin( cwa ) ); + BOOST_CHECK_EQUAL( &*begin( a ), &*( rend( a ) ) ); + BOOST_CHECK_EQUAL( &*( end( a ) ), &*rbegin( a ) ); + BOOST_CHECK_EQUAL( &*begin( ca ), &*( rend( ca ) ) ); + BOOST_CHECK_EQUAL( &*( end( ca ) ), &*rbegin( ca ) ); } -#include using boost::unit_test::test_suite; - test_suite* init_unit_test_suite( int argc, char* argv[] ) { test_suite* test = BOOST_TEST_SUITE( "Range Test Suite" ); diff --git a/test/std_container.cpp b/test/std_container.cpp index a61e8d1..e26d2a3 100755 --- a/test/std_container.cpp +++ b/test/std_container.cpp @@ -35,15 +35,13 @@ void check_std_container() BOOST_STATIC_ASSERT(( is_same< range_value::type, vec_t::value_type >::value )); BOOST_STATIC_ASSERT(( is_same< range_iterator::type, vec_t::iterator >::value )); - BOOST_STATIC_ASSERT(( is_same< range_const_iterator::type, vec_t::const_iterator >::value )); + BOOST_STATIC_ASSERT(( is_same< range_iterator::type, vec_t::const_iterator >::value )); BOOST_STATIC_ASSERT(( is_same< range_difference::type, vec_t::difference_type >::value )); BOOST_STATIC_ASSERT(( is_same< range_size::type, vec_t::size_type >::value )); - BOOST_STATIC_ASSERT(( is_same< range_result_iterator::type, vec_t::iterator >::value )); - BOOST_STATIC_ASSERT(( is_same< range_result_iterator::type, vec_t::const_iterator >::value )); + BOOST_STATIC_ASSERT(( is_same< range_iterator::type, vec_t::iterator >::value )); + BOOST_STATIC_ASSERT(( is_same< range_iterator::type, vec_t::const_iterator >::value )); BOOST_STATIC_ASSERT(( is_same< range_value::type, vec_t::value_type >::value )); - BOOST_STATIC_ASSERT(( is_same< range_iterator::type, vec_t::iterator >::value )); - BOOST_STATIC_ASSERT(( is_same< range_const_iterator::type, vec_t::const_iterator >::value )); BOOST_STATIC_ASSERT(( is_same< range_difference::type, vec_t::difference_type >::value )); BOOST_STATIC_ASSERT(( is_same< range_size::type, vec_t::size_type >::value )); diff --git a/test/string.cpp b/test/string.cpp index 36f103b..9d4b252 100755 --- a/test/string.cpp +++ b/test/string.cpp @@ -17,7 +17,10 @@ # pragma warn -8057 // unused argument argc/argv in Boost.Test #endif -#include +#include +#include +#include +#include #include #include #include @@ -26,36 +29,66 @@ #include #include +template< class T > +inline BOOST_DEDUCED_TYPENAME boost::range_iterator::type +str_begin( T& r ) +{ + return boost::begin( as_literal(r) ); +} + +template< class T > +inline BOOST_DEDUCED_TYPENAME boost::range_iterator::type +str_end( T& r ) +{ + return boost::end( as_literal(r) ); +} + +template< class T > +inline BOOST_DEDUCED_TYPENAME boost::range_size::type +str_size( const T& r ) +{ + return boost::size( as_literal(r) ); +} + +template< class T > +inline bool +str_empty( T& r ) +{ + return boost::empty( as_literal(r) ); +} + template< typename Container, typename T > BOOST_DEDUCED_TYPENAME boost::range_iterator::type find( Container& c, T value ) { - return std::find( boost::begin( c ), boost::end( c ), value ); + return std::find( str_begin(c), str_end(c), + value ); } template< typename Container, typename T > -BOOST_DEDUCED_TYPENAME boost::range_const_iterator::type +BOOST_DEDUCED_TYPENAME boost::range_iterator::type find( const Container& c, T value ) { - return std::find( boost::begin( c ), boost::end( c ), value ); + return std::find( str_begin(c), str_end(c), + value ); } template< typename Container, typename T > BOOST_DEDUCED_TYPENAME boost::range_iterator::type find_mutable( Container& c, T value ) -{ - boost::size( c ); - boost::end( c ); - return std::find( boost::begin( c ), boost::end( c ), value ); +{ + str_size( c ); + return std::find( str_begin(c), str_end(c), + value ); } template< typename Container, typename T > -BOOST_DEDUCED_TYPENAME boost::range_const_iterator::type +BOOST_DEDUCED_TYPENAME boost::range_iterator::type find_const( const Container& c, T value ) { - boost::size( c ); - boost::end( c ); - return std::find( boost::begin( c ), boost::end( c ), value ); + str_size( c ); + return std::find( str_begin(c), str_end(c), + value ); } @@ -72,62 +105,66 @@ void check_char() { typedef char* char_iterator_t; typedef char char_array_t[10]; - const char* char_s = "a string"; - char my_string[] = "another string"; - const unsigned my_string_length = 14; - char* char_s2 = "a string"; + const char* char_s = "a string"; + char my_string[] = "another string"; + const char my_const_string[] = "another string"; + const unsigned my_string_length = 14; + char* char_s2 = "a string"; BOOST_STATIC_ASSERT(( is_same< range_value::type, detail::iterator_traits::value_type>::value )); BOOST_STATIC_ASSERT(( is_same< range_iterator::type, char_iterator_t >::value )); - BOOST_STATIC_ASSERT(( is_same< range_const_iterator::type, const char* >::value )); + BOOST_STATIC_ASSERT(( is_same< range_difference::type, ::std::ptrdiff_t >::value )); BOOST_STATIC_ASSERT(( is_same< range_size::type, std::size_t >::value )); - BOOST_STATIC_ASSERT(( is_same< range_result_iterator::type, char_iterator_t >::value )); - BOOST_STATIC_ASSERT(( is_same< range_result_iterator::type, const char* >::value )); + BOOST_STATIC_ASSERT(( is_same< range_iterator::type, char_iterator_t >::value )); + BOOST_STATIC_ASSERT(( is_same< range_iterator::type, const char* >::value )); BOOST_STATIC_ASSERT(( is_same< range_value::type, char>::value )); BOOST_STATIC_ASSERT(( is_same< range_iterator::type, char* >::value )); - BOOST_STATIC_ASSERT(( is_same< range_const_iterator::type, const char* >::value )); + BOOST_STATIC_ASSERT(( is_same< range_iterator::type, const char* >::value )); BOOST_STATIC_ASSERT(( is_same< range_difference::type, ::std::ptrdiff_t >::value )); BOOST_STATIC_ASSERT(( is_same< range_size::type, std::size_t >::value )); - BOOST_STATIC_ASSERT(( is_same< range_result_iterator::type, char* >::value )); - BOOST_STATIC_ASSERT(( is_same< range_result_iterator::type, const char* >::value )); + BOOST_STATIC_ASSERT(( is_same< range_iterator::type, char* >::value )); + BOOST_STATIC_ASSERT(( is_same< range_iterator::type, const char* >::value )); - BOOST_CHECK_EQUAL( begin( char_s ), char_s ); - std::size_t sz = size( char_s ); - const char* end1 = begin( char_s ) + sz; - BOOST_CHECK_EQUAL( end( char_s ), end1 ); - BOOST_CHECK_EQUAL( empty( char_s ), (char_s == 0 || char_s[0] == char()) ); + BOOST_CHECK_EQUAL( str_begin( char_s ), char_s ); + std::size_t sz = str_size(char_s); + const char* str_end1 = str_begin( char_s ) + sz; + BOOST_CHECK_EQUAL( str_end( char_s ), str_end1 ); + BOOST_CHECK_EQUAL( str_empty( char_s ), (char_s == 0 || char_s[0] == char()) ); BOOST_CHECK_EQUAL( sz, std::char_traits::length( char_s ) ); /* - BOOST_CHECK_EQUAL( begin( char_s2 ), char_s2 ); + BOOST_CHECK_EQUAL( str_begin( char_s2 ), char_s2 ); std::size_t sz2 = size( char_s2 ); - const char* end12 = begin( char_s2 ) + sz; - BOOST_CHECK_EQUAL( end( char_s2 ), end12 ); + const char* str_end12 = str_begin( char_s2 ) + sz; + BOOST_CHECK_EQUAL( str_end( char_s2 ), str_end12 ); BOOST_CHECK_EQUAL( empty( char_s2 ), (char_s2 == 0 || char_s2[0] == char()) ); BOOST_CHECK_EQUAL( sz2, std::char_traits::length( char_s2 ) ); */ - BOOST_CHECK_EQUAL( begin( my_string ), my_string ); - range_iterator::type end2 = begin( my_string ) + size( my_string ); - range_iterator::type end3 = end( my_string ); - BOOST_CHECK_EQUAL( end3, end2 ); - BOOST_CHECK_EQUAL( empty( my_string ), (my_string == 0 || my_string[0] == char()) ); - BOOST_CHECK_EQUAL( size( my_string ), my_string_length ); - BOOST_CHECK_EQUAL( size( my_string ), std::char_traits::length( my_string ) ); + BOOST_CHECK_EQUAL( str_begin( my_string ), my_string ); + range_iterator::type str_end2 = str_begin( my_string ) + str_size(my_string); + range_iterator::type str_end3 = str_end(my_string); + BOOST_CHECK_EQUAL( str_end3, str_end2 ); + BOOST_CHECK_EQUAL( str_empty( my_string ), (my_string == 0 || my_string[0] == char()) ); + BOOST_CHECK_EQUAL( str_size( my_string ), my_string_length ); + BOOST_CHECK_EQUAL( str_size( my_string ), std::char_traits::length( my_string ) ); char to_search = 'n'; - BOOST_CHECK( find_mutable( char_s, to_search ) != end( char_s ) ); - BOOST_CHECK( find_const( char_s, to_search ) != end( char_s ) ); + BOOST_CHECK( find_mutable( char_s, to_search ) != str_end( char_s ) ); + BOOST_CHECK( find_const( char_s, to_search ) != str_end(char_s) ); - BOOST_CHECK( find_mutable( my_string, to_search ) != end( my_string ) ); - BOOST_CHECK( find_const( my_string, to_search ) != end( my_string ) ); + BOOST_CHECK( find_mutable( my_string, to_search ) != str_end(my_string) ); + BOOST_CHECK( find_const( my_string, to_search ) != str_end(my_string) ); - BOOST_CHECK( find_mutable( char_s2, to_search ) != end( char_s2 ) ); - BOOST_CHECK( find_const( char_s2, to_search ) != end( char_s2 ) ); + BOOST_CHECK( find_mutable( char_s2, to_search ) != str_end(char_s) ); + BOOST_CHECK( find_const( char_s2, to_search ) != str_end(char_s2) ); + + BOOST_CHECK( find_const( as_array( my_string ), to_search ) != str_end(my_string) ); + BOOST_CHECK( find_const( as_array( my_const_string ), to_search ) != str_end(my_string) ); } @@ -148,31 +185,31 @@ void check_string() BOOST_STATIC_ASSERT(( is_same< range_value::type, detail::iterator_traits::value_type>::value )); BOOST_STATIC_ASSERT(( is_same< range_iterator::type, wchar_iterator_t >::value )); - BOOST_STATIC_ASSERT(( is_same< range_const_iterator::type, const wchar_t* >::value )); + BOOST_STATIC_ASSERT(( is_same< range_iterator::type, const wchar_t* >::value )); BOOST_STATIC_ASSERT(( is_same< range_difference::type, detail::iterator_traits::difference_type >::value )); BOOST_STATIC_ASSERT(( is_same< range_size::type, std::size_t >::value )); - BOOST_STATIC_ASSERT(( is_same< range_result_iterator::type, wchar_iterator_t >::value )); - BOOST_STATIC_ASSERT(( is_same< range_result_iterator::type, const wchar_t* >::value )); + BOOST_STATIC_ASSERT(( is_same< range_iterator::type, wchar_iterator_t >::value )); + BOOST_STATIC_ASSERT(( is_same< range_iterator::type, const wchar_t* >::value )); - std::size_t sz = size( char_ws ); - BOOST_CHECK_EQUAL( begin( char_ws ), char_ws ); - BOOST_CHECK_EQUAL( end( char_ws ), (begin( char_ws ) + sz) ); - BOOST_CHECK_EQUAL( empty( char_ws ), (char_ws == 0 || char_ws[0] == wchar_t()) ); + std::size_t sz = str_size( char_ws ); + BOOST_CHECK_EQUAL( str_begin( char_ws ), char_ws ); + BOOST_CHECK_EQUAL( str_end(char_ws), (str_begin( char_ws ) + sz) ); + BOOST_CHECK_EQUAL( str_empty( char_ws ), (char_ws == 0 || char_ws[0] == wchar_t()) ); BOOST_CHECK_EQUAL( sz, std::char_traits::length( char_ws ) ); /* std::size_t sz2 = size( char_ws2 ); - BOOST_CHECK_EQUAL( begin( char_ws2 ), char_ws2 ); - BOOST_CHECK_EQUAL( end( char_ws2 ), (begin( char_ws2 ) + sz2) ); + BOOST_CHECK_EQUAL( str_begin( char_ws2 ), char_ws2 ); + BOOST_CHECK_EQUAL( str_end( char_ws2 ), (begin( char_ws2 ) + sz2) ); BOOST_CHECK_EQUAL( empty( char_ws2 ), (char_ws2 == 0 || char_ws2[0] == wchar_t()) ); BOOST_CHECK_EQUAL( sz2, std::char_traits::length( char_ws2 ) ); */ wchar_t to_search = L'n'; - BOOST_CHECK( find( char_ws, to_search ) != end( char_ws ) ); + BOOST_CHECK( find( char_ws, to_search ) != str_end(char_ws) ); #if BOOST_WORKAROUND(_MSC_VER, BOOST_TESTED_AT(1300)) - BOOST_CHECK( find( my_wstring, to_search ) != end( my_wstring ) ); + BOOST_CHECK( find( my_wstring, to_search ) != str_end(my_wstring) ); #endif #endif @@ -181,7 +218,6 @@ void check_string() } - #include using boost::unit_test::test_suite;