Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r52922 - in trunk: boost/filesystem libs/filesystem/test
From: bdawes_at_[hidden]
Date: 2009-05-11 15:51:46


Author: bemandawes
Date: 2009-05-11 15:51:44 EDT (Mon, 11 May 2009)
New Revision: 52922
URL: http://svn.boost.org/trac/boost/changeset/52922

Log:
Filesystem: fix #3008, improving namespace discipline to avoid naming conflicts with the C++0x std library.
Text files modified:
   trunk/boost/filesystem/operations.hpp | 4
   trunk/libs/filesystem/test/path_test.cpp | 97 +++++++++++++++++++--------------------
   2 files changed, 50 insertions(+), 51 deletions(-)

Modified: trunk/boost/filesystem/operations.hpp
==============================================================================
--- trunk/boost/filesystem/operations.hpp (original)
+++ trunk/boost/filesystem/operations.hpp 2009-05-11 15:51:44 EDT (Mon, 11 May 2009)
@@ -659,9 +659,9 @@
       { return is_symlink<wpath>( ph ); }
 
     inline bool is_empty( const path & ph )
- { return is_empty<path>( ph ); }
+ { return boost::filesystem::is_empty<path>( ph ); }
     inline bool is_empty( const wpath & ph )
- { return is_empty<wpath>( ph ); }
+ { return boost::filesystem::is_empty<wpath>( ph ); }
 
     inline bool equivalent( const path & ph1, const path & ph2 )
       { return equivalent<path>( ph1, ph2 ); }

Modified: trunk/libs/filesystem/test/path_test.cpp
==============================================================================
--- trunk/libs/filesystem/test/path_test.cpp (original)
+++ trunk/libs/filesystem/test/path_test.cpp 2009-05-11 15:51:44 EDT (Mon, 11 May 2009)
@@ -27,8 +27,7 @@
 
 namespace fs = boost::filesystem;
 using boost::filesystem::path;
-using boost::next;
-using boost::prior;
+
 
 #include <boost/detail/lightweight_test.hpp>
 
@@ -480,18 +479,18 @@
 
   itr_ck = "foo";
   BOOST_TEST( *itr_ck.begin() == std::string( "foo" ) );
- BOOST_TEST( next( itr_ck.begin() ) == itr_ck.end() );
- BOOST_TEST( *prior( itr_ck.end() ) == std::string( "foo" ) );
- BOOST_TEST( prior( itr_ck.end() ) == itr_ck.begin() );
+ BOOST_TEST( boost::next( itr_ck.begin() ) == itr_ck.end() );
+ BOOST_TEST( *boost::prior( itr_ck.end() ) == std::string( "foo" ) );
+ BOOST_TEST( boost::prior( itr_ck.end() ) == itr_ck.begin() );
 
   itr_ck = path( "/foo" );
   BOOST_TEST( *itr_ck.begin() == std::string( "/" ) );
- BOOST_TEST( *next( itr_ck.begin() ) == std::string( "foo" ) );
- BOOST_TEST( next(next( itr_ck.begin() )) == itr_ck.end() );
- BOOST_TEST( next( itr_ck.begin() ) == prior( itr_ck.end() ) );
- BOOST_TEST( *prior( itr_ck.end() ) == std::string( "foo" ) );
- BOOST_TEST( *prior(prior( itr_ck.end() )) == std::string( "/" ) );
- BOOST_TEST( prior(prior( itr_ck.end() )) == itr_ck.begin() );
+ BOOST_TEST( *boost::next( itr_ck.begin() ) == std::string( "foo" ) );
+ BOOST_TEST( boost::next(boost::next( itr_ck.begin() )) == itr_ck.end() );
+ BOOST_TEST( boost::next( itr_ck.begin() ) == boost::prior( itr_ck.end() ) );
+ BOOST_TEST( *boost::prior( itr_ck.end() ) == std::string( "foo" ) );
+ BOOST_TEST( *boost::prior(boost::prior( itr_ck.end() )) == std::string( "/" ) );
+ BOOST_TEST( boost::prior(boost::prior( itr_ck.end() )) == itr_ck.begin() );
 
   itr_ck = "/foo/bar";
   itr = itr_ck.begin();
@@ -1106,65 +1105,65 @@
 
     itr_ck = path( "c:" );
     BOOST_TEST( *itr_ck.begin() == std::string( "c:" ) );
- BOOST_TEST( next( itr_ck.begin() ) == itr_ck.end() );
- BOOST_TEST( prior( itr_ck.end() ) == itr_ck.begin() );
- BOOST_TEST( *prior( itr_ck.end() ) == std::string( "c:" ) );
+ BOOST_TEST( boost::next( itr_ck.begin() ) == itr_ck.end() );
+ BOOST_TEST( boost::prior( itr_ck.end() ) == itr_ck.begin() );
+ BOOST_TEST( *boost::prior( itr_ck.end() ) == std::string( "c:" ) );
 
     itr_ck = path( "c:/" );
     BOOST_TEST( *itr_ck.begin() == std::string( "c:" ) );
- BOOST_TEST( *next( itr_ck.begin() ) == std::string( "/" ) );
- BOOST_TEST( next( next( itr_ck.begin() )) == itr_ck.end() );
- BOOST_TEST( prior( prior( itr_ck.end() )) == itr_ck.begin() );
- BOOST_TEST( *prior( itr_ck.end() ) == std::string( "/" ) );
- BOOST_TEST( *prior( prior( itr_ck.end() )) == std::string( "c:" ) );
+ BOOST_TEST( *boost::next( itr_ck.begin() ) == std::string( "/" ) );
+ BOOST_TEST( boost::next( boost::next( itr_ck.begin() )) == itr_ck.end() );
+ BOOST_TEST( boost::prior( boost::prior( itr_ck.end() )) == itr_ck.begin() );
+ BOOST_TEST( *boost::prior( itr_ck.end() ) == std::string( "/" ) );
+ BOOST_TEST( *boost::prior( boost::prior( itr_ck.end() )) == std::string( "c:" ) );
 
     itr_ck = path( "c:foo" );
     BOOST_TEST( *itr_ck.begin() == std::string( "c:" ) );
- BOOST_TEST( *next( itr_ck.begin() ) == std::string( "foo" ) );
- BOOST_TEST( next(next( itr_ck.begin() )) == itr_ck.end() );
- BOOST_TEST( prior(prior( itr_ck.end() )) == itr_ck.begin() );
- BOOST_TEST( *prior( itr_ck.end() ) == std::string( "foo" ) );
- BOOST_TEST( *prior(prior( itr_ck.end() )) == std::string( "c:" ) );
+ BOOST_TEST( *boost::next( itr_ck.begin() ) == std::string( "foo" ) );
+ BOOST_TEST( boost::next(boost::next( itr_ck.begin() )) == itr_ck.end() );
+ BOOST_TEST( boost::prior(boost::prior( itr_ck.end() )) == itr_ck.begin() );
+ BOOST_TEST( *boost::prior( itr_ck.end() ) == std::string( "foo" ) );
+ BOOST_TEST( *boost::prior(boost::prior( itr_ck.end() )) == std::string( "c:" ) );
 
     itr_ck = path( "c:/foo" );
     BOOST_TEST( *itr_ck.begin() == std::string( "c:" ) );
- BOOST_TEST( *next( itr_ck.begin() ) == std::string( "/" ) );
- BOOST_TEST( *next( next( itr_ck.begin() )) == std::string( "foo" ) );
- BOOST_TEST( next( next( next( itr_ck.begin() ))) == itr_ck.end() );
- BOOST_TEST( prior( prior( prior( itr_ck.end() ))) == itr_ck.begin() );
- BOOST_TEST( *prior( itr_ck.end() ) == std::string( "foo" ) );
- BOOST_TEST( *prior( prior( itr_ck.end() )) == std::string( "/" ) );
- BOOST_TEST( *prior( prior( prior( itr_ck.end() ))) == std::string( "c:" ) );
+ BOOST_TEST( *boost::next( itr_ck.begin() ) == std::string( "/" ) );
+ BOOST_TEST( *boost::next( boost::next( itr_ck.begin() )) == std::string( "foo" ) );
+ BOOST_TEST( boost::next( boost::next( boost::next( itr_ck.begin() ))) == itr_ck.end() );
+ BOOST_TEST( boost::prior( boost::prior( boost::prior( itr_ck.end() ))) == itr_ck.begin() );
+ BOOST_TEST( *boost::prior( itr_ck.end() ) == std::string( "foo" ) );
+ BOOST_TEST( *boost::prior( boost::prior( itr_ck.end() )) == std::string( "/" ) );
+ BOOST_TEST( *boost::prior( boost::prior( boost::prior( itr_ck.end() ))) == std::string( "c:" ) );
 
     itr_ck = path( "//net" );
     BOOST_TEST( *itr_ck.begin() == std::string( "//net" ) );
- BOOST_TEST( next( itr_ck.begin() ) == itr_ck.end() );
- BOOST_TEST( prior( itr_ck.end() ) == itr_ck.begin() );
- BOOST_TEST( *prior( itr_ck.end() ) == std::string( "//net" ) );
+ BOOST_TEST( boost::next( itr_ck.begin() ) == itr_ck.end() );
+ BOOST_TEST( boost::prior( itr_ck.end() ) == itr_ck.begin() );
+ BOOST_TEST( *boost::prior( itr_ck.end() ) == std::string( "//net" ) );
 
     itr_ck = path( "//net/" );
     CHECK_EQUAL( *itr_ck.begin(), "//net" );
- CHECK_EQUAL( *next( itr_ck.begin() ), "/" );
- BOOST_TEST( next(next( itr_ck.begin() )) == itr_ck.end() );
- BOOST_TEST( prior(prior( itr_ck.end() )) == itr_ck.begin() );
- CHECK_EQUAL( *prior( itr_ck.end() ), "/" );
- CHECK_EQUAL( *prior(prior( itr_ck.end() )), "//net" );
+ CHECK_EQUAL( *boost::next( itr_ck.begin() ), "/" );
+ BOOST_TEST( boost::next(boost::next( itr_ck.begin() )) == itr_ck.end() );
+ BOOST_TEST( boost::prior(boost::prior( itr_ck.end() )) == itr_ck.begin() );
+ CHECK_EQUAL( *boost::prior( itr_ck.end() ), "/" );
+ CHECK_EQUAL( *boost::prior(boost::prior( itr_ck.end() )), "//net" );
 
     itr_ck = path( "//net/foo" );
     BOOST_TEST( *itr_ck.begin() == std::string( "//net" ) );
- BOOST_TEST( *next( itr_ck.begin() ) == std::string( "/" ) );
- BOOST_TEST( *next(next( itr_ck.begin() )) == std::string( "foo" ) );
- BOOST_TEST( next(next(next( itr_ck.begin() ))) == itr_ck.end() );
- BOOST_TEST( prior(prior(prior( itr_ck.end() ))) == itr_ck.begin() );
- BOOST_TEST( *prior( itr_ck.end() ) == std::string( "foo" ) );
- BOOST_TEST( *prior(prior( itr_ck.end() )) == std::string( "/" ) );
- BOOST_TEST( *prior(prior(prior( itr_ck.end() ))) == std::string( "//net" ) );
+ BOOST_TEST( *boost::next( itr_ck.begin() ) == std::string( "/" ) );
+ BOOST_TEST( *boost::next(boost::next( itr_ck.begin() )) == std::string( "foo" ) );
+ BOOST_TEST( boost::next(boost::next(boost::next( itr_ck.begin() ))) == itr_ck.end() );
+ BOOST_TEST( boost::prior(boost::prior(boost::prior( itr_ck.end() ))) == itr_ck.begin() );
+ BOOST_TEST( *boost::prior( itr_ck.end() ) == std::string( "foo" ) );
+ BOOST_TEST( *boost::prior(boost::prior( itr_ck.end() )) == std::string( "/" ) );
+ BOOST_TEST( *boost::prior(boost::prior(boost::prior( itr_ck.end() ))) == std::string( "//net" ) );
 
     itr_ck = path( "prn:" );
     BOOST_TEST( *itr_ck.begin() == std::string( "prn:" ) );
- BOOST_TEST( next( itr_ck.begin() ) == itr_ck.end() );
- BOOST_TEST( prior( itr_ck.end() ) == itr_ck.begin() );
- BOOST_TEST( *prior( itr_ck.end() ) == std::string( "prn:" ) );
+ BOOST_TEST( boost::next( itr_ck.begin() ) == itr_ck.end() );
+ BOOST_TEST( boost::prior( itr_ck.end() ) == itr_ck.begin() );
+ BOOST_TEST( *boost::prior( itr_ck.end() ) == std::string( "prn:" ) );
   } // Windows
 
   else


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