Boost logo

Boost-Commit :

From: nesotto_at_[hidden]
Date: 2007-10-23 14:59:11


Author: nesotto
Date: 2007-10-23 14:59:11 EDT (Tue, 23 Oct 2007)
New Revision: 40370
URL: http://svn.boost.org/trac/boost/changeset/40370

Log:
applied patch from Ticket #1302 (new Patches) to handle char arrays correctly

Text files modified:
   trunk/libs/range/test/iterator_range.cpp | 15 ++++++++-------
   trunk/libs/range/test/sub_range.cpp | 17 +++++++++--------
   2 files changed, 17 insertions(+), 15 deletions(-)

Modified: trunk/libs/range/test/iterator_range.cpp
==============================================================================
--- trunk/libs/range/test/iterator_range.cpp (original)
+++ trunk/libs/range/test/iterator_range.cpp 2007-10-23 14:59:11 EDT (Tue, 23 Oct 2007)
@@ -19,6 +19,7 @@
 
 #include <boost/range/iterator_range.hpp>
 #include <boost/range/functions.hpp>
+#include <boost/range/as_literal.hpp>
 #include <boost/test/test_tools.hpp>
 #include <boost/test/unit_test.hpp>
 #include <iostream>
@@ -79,12 +80,12 @@
     BOOST_CHECK( rr.equal( r ) );
 
     rr = make_iterator_range( str.begin(), str.begin() + 5 );
- BOOST_CHECK( rr == "hello" );
- BOOST_CHECK( rr != "hell" );
- BOOST_CHECK( rr < "hello dude" );
- BOOST_CHECK( "hello" == rr );
- BOOST_CHECK( "hell" != rr );
- BOOST_CHECK( ! ("hello dude" < rr ) );
+ BOOST_CHECK( rr == as_literal("hello") );
+ BOOST_CHECK( rr != as_literal("hell") );
+ BOOST_CHECK( rr < as_literal("hello dude") );
+ BOOST_CHECK( as_literal("hello") == rr );
+ BOOST_CHECK( as_literal("hell") != rr );
+ BOOST_CHECK( ! (as_literal("hello dude") < rr ) );
     irange rrr = rr;
     BOOST_CHECK( rrr == rr );
     BOOST_CHECK( !( rrr != rr ) );
@@ -96,7 +97,7 @@
     BOOST_CHECK_EQUAL( cr[1], 'e' );
 
     rrr = make_iterator_range( str, 1, -1 );
- BOOST_CHECK( rrr == "ello worl" );
+ BOOST_CHECK( rrr == as_literal("ello worl") );
     rrr = make_iterator_range( rrr, -1, 1 );
     BOOST_CHECK( rrr == str );
 

Modified: trunk/libs/range/test/sub_range.cpp
==============================================================================
--- trunk/libs/range/test/sub_range.cpp (original)
+++ trunk/libs/range/test/sub_range.cpp 2007-10-23 14:59:11 EDT (Tue, 23 Oct 2007)
@@ -17,6 +17,7 @@
 #endif
 
 #include <boost/range/sub_range.hpp>
+#include <boost/range/as_literal.hpp>
 #include <boost/test/test_tools.hpp>
 #include <iostream>
 #include <string>
@@ -110,12 +111,12 @@
     BOOST_CHECK( rr.equal( r ) );
 
     rr = make_iterator_range( str.begin(), str.begin() + 5 );
- BOOST_CHECK( rr == "hello" );
- BOOST_CHECK( rr != "hell" );
- BOOST_CHECK( rr < "hello dude" );
- BOOST_CHECK( "hello" == rr );
- BOOST_CHECK( "hell" != rr );
- BOOST_CHECK( ! ("hello dude" < rr ) );
+ BOOST_CHECK( rr == as_literal("hello") );
+ BOOST_CHECK( rr != as_literal("hell") );
+ BOOST_CHECK( rr < as_literal("hello dude") );
+ BOOST_CHECK( as_literal("hello") == rr );
+ BOOST_CHECK( as_literal("hell") != rr );
+ BOOST_CHECK( ! (as_literal("hello dude") < rr ) );
     
     irange rrr = rr;
     BOOST_CHECK( rrr == rr );
@@ -128,13 +129,13 @@
     BOOST_CHECK_EQUAL( cr[1], 'e' );
 
     rrr = make_iterator_range( str, 1, -1 );
- BOOST_CHECK( rrr == "ello worl" );
+ BOOST_CHECK( rrr == as_literal("ello worl") );
     rrr = make_iterator_range( rrr, -1, 1 );
     BOOST_CHECK( rrr == str );
     rrr.front() = 'H';
     rrr.back() = 'D';
     rrr[1] = 'E';
- BOOST_CHECK( rrr == "HEllo worlD" );
+ BOOST_CHECK( rrr == as_literal("HEllo worlD") );
 }
 
 #include <boost/test/unit_test.hpp>


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