From cca6da5cba89ae69fa7bc135fe95df4514941b67 Mon Sep 17 00:00:00 2001 From: Nicola Musatti Date: Tue, 25 Sep 2007 22:53:44 +0000 Subject: [PATCH] Merge from trunk [SVN r39533] --- include/boost/filesystem/path.hpp | 2 +- src/operations.cpp | 8 ++++---- test/fstream_test.cpp | 10 ++++++++-- test/lpath.hpp | 2 +- test/operations_test.cpp | 4 ++-- test/wide_test.cpp | 11 ++++++++++- 6 files changed, 26 insertions(+), 11 deletions(-) diff --git a/include/boost/filesystem/path.hpp b/include/boost/filesystem/path.hpp index cbf1a9a..68ef79b 100644 --- a/include/boost/filesystem/path.hpp +++ b/include/boost/filesystem/path.hpp @@ -607,7 +607,7 @@ namespace boost template const char * what( const char * sys_err_what, - const Path & path1, const Path & path2, std::string & target ) + const Path & /*path1*/, const Path & /*path2*/, std::string & /*target*/ ) { return sys_err_what; } diff --git a/src/operations.cpp b/src/operations.cpp index 6dbf093..30e9cf5 100644 --- a/src/operations.cpp +++ b/src/operations.cpp @@ -650,8 +650,8 @@ namespace boost #endif BOOST_FILESYSTEM_DECL error_code - create_symlink_api( const std::wstring & to_ph, - const std::wstring & from_ph ) + create_symlink_api( const std::wstring & /*to_ph*/, + const std::wstring & /*from_ph*/ ) { return error_code( ERROR_NOT_SUPPORTED, system_category ); } BOOST_FILESYSTEM_DECL error_code @@ -830,8 +830,8 @@ namespace boost #endif BOOST_FILESYSTEM_DECL error_code - create_symlink_api( const std::string & to_ph, - const std::string & from_ph ) + create_symlink_api( const std::string & /*to_ph*/, + const std::string & /*from_ph*/ ) { return error_code( ERROR_NOT_SUPPORTED, system_category ); } BOOST_FILESYSTEM_DECL error_code diff --git a/test/fstream_test.cpp b/test/fstream_test.cpp index 3c681ef..7b1386b 100644 --- a/test/fstream_test.cpp +++ b/test/fstream_test.cpp @@ -37,6 +37,8 @@ namespace fs = boost::filesystem; namespace { + bool cleanup = true; + template< class Path > void test( const Path & p ) { @@ -141,12 +143,16 @@ namespace BOOST_CHECK( tfs.is_open() ); } # endif + + if ( cleanup ) fs::remove( p ); + } // test } // unnamed namespace -int test_main( int, char*[] ) +int test_main( int argc, char*[] ) { - + if ( argc > 1 ) cleanup = false; + // test fs::path std::cout << "path tests:\n"; test( fs::path( "fstream_test_foo" ) ); diff --git a/test/lpath.hpp b/test/lpath.hpp index 6fd625b..7fe86fa 100644 --- a/test/lpath.hpp +++ b/test/lpath.hpp @@ -34,7 +34,7 @@ namespace std static size_t length(const char_type* s) { const char_type* b=s; for(;*s!=0L;++s){} return s-b; } - static const char_type* find(const char_type* s, size_t n, const char_type& a) + static const char_type* find(const char_type* /*s*/, size_t /*n*/, const char_type& /*a*/) { return 0; } // copy semantics will do for wide_test diff --git a/test/operations_test.cpp b/test/operations_test.cpp index e50bb26..b759723 100644 --- a/test/operations_test.cpp +++ b/test/operations_test.cpp @@ -21,7 +21,7 @@ namespace fs = boost::filesystem; #include #include -#include +//#include #include using boost::bind; @@ -396,7 +396,7 @@ int test_main( int argc, char * argv[] ) BOOST_CHECK( fs::is_directory( d1 ) ); BOOST_CHECK( BOOST_FS_IS_EMPTY( d1 ) ); - boost::function_requires< boost::InputIteratorConcept< fs::directory_iterator > >(); +// boost::function_requires< boost::InputIteratorConcept< fs::directory_iterator > >(); bool dir_itr_exception(false); try { fs::directory_iterator it( "" ); } diff --git a/test/wide_test.cpp b/test/wide_test.cpp index 395cfaa..fcf0dc2 100644 --- a/test/wide_test.cpp +++ b/test/wide_test.cpp @@ -38,6 +38,8 @@ namespace fs = boost::filesystem; namespace { + bool cleanup = true; + template< class Path > void create_file( const Path & ph, const std::string & contents ) { @@ -90,6 +92,11 @@ namespace ++count; } BOOST_CHECK( count == 1 ); + if ( cleanup ) + { + fs::remove( dir / file ); + fs::remove( dir ); + } } // test boost::detail::utf8_codecvt_facet - even though it is not used by @@ -114,9 +121,11 @@ namespace // test_main ---------------------------------------------------------------// -int test_main( int argc, char * argv[] ) +int test_main( int argc, char * /*argv*/[] ) { + if ( argc > 1 ) cleanup = false; + // So that tests are run with known encoding, use Boost UTF-8 codecvt std::locale global_loc = std::locale(); std::locale loc( global_loc, new fs::detail::utf8_codecvt_facet );