Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r63687 - in branches/release: boost boost/filesystem boost/filesystem/detail boost/filesystem/v2 boost/filesystem/v3 libs/filesystem libs/filesystem/build libs/filesystem/doc libs/filesystem/example libs/filesystem/src libs/filesystem/test libs/filesystem/test/msvc libs/filesystem/v2 libs/filesystem/v2/build libs/filesystem/v2/doc libs/filesystem/v2/example libs/filesystem/v2/src libs/filesystem/v2/test libs/filesystem/v2/test/msvc libs/filesystem/v2/test/msvc/convenience_test libs/filesystem/v2/test/msvc/deprecated_test libs/filesystem/v2/test/msvc/filesystem_dll libs/filesystem/v2/test/msvc/fstream_test libs/filesystem/v2/test/msvc/large_file_support_test libs/filesystem/v2/test/msvc/mbcopy libs/filesystem/v2/test/msvc/mbpath libs/filesystem/v2/test/msvc/operations_test libs/filesystem/v2/test/msvc/path_test libs/filesystem/v2/test/msvc/simple_ls libs/filesystem/v2/test/msvc/system_dll libs/filesystem/v2/test/msvc/wide_test libs/filesystem/v3 libs/filesystem/v3/build libs/filesystem/v3/doc libs/filesystem/v3/example libs/filesystem/v3/example/test libs/filesystem/v3/src libs/filesystem/v3/test libs/filesystem/v3/test/msvc libs/filesystem/v3/test/msvc/convenience_test libs/filesystem/v3/test/msvc/deprecated_test libs/filesystem/v3/test/msvc/error_demo libs/filesystem/v3/test/msvc/filesystem_dll libs/filesystem/v3/test/msvc/fstream_test libs/filesystem/v3/test/msvc/operations_test libs/filesystem/v3/test/msvc/operations_unit_test libs/filesystem/v3/test/msvc/path_test libs/filesystem/v3/test/msvc/path_test_dynamic_link libs/filesystem/v3/test/msvc/path_unit_test libs/filesystem/v3/test/msvc/simple_ls libs/filesystem/v3/test/msvc/system_dll libs/filesystem/v3/test/msvc/tchar_example libs/filesystem/v3/test/msvc/tut0 libs/filesystem/v3/test/msvc/tut1 libs/filesystem/v3/test/msvc/tut2 libs/filesystem/v3/test/msvc/tut3 libs/filesystem/v3/test/msvc/tut4 libs/filesystem/v3/test/msvc/wide_test libs/filesystem/v3/test/msvc10 libs/filesystem/v3/test/msvc10/convenience_test libs/filesystem/v3/test/msvc10/deprecated_test libs/filesystem/v3/test/msvc10/filesystem_dll libs/filesystem/v3/test/msvc10/fstream_test libs/filesystem/v3/test/msvc10/operations_test libs/filesystem/v3/test/msvc10/operations_unit_test libs/filesystem/v3/test/msvc10/path_test libs/filesystem/v3/test/msvc10/path_unit_test libs/filesystem/v3/test/msvc10/system_dll libs/filesystem/v3/test/msvc10/tut1 libs/filesystem/v3/test/msvc10/tut2 libs/filesystem/v3/test/msvc10/tut3 libs/filesystem/v3/test/msvc10/tut4
From: bdawes_at_[hidden]
Date: 2010-07-06 07:17:56


Author: bemandawes
Date: 2010-07-06 07:17:54 EDT (Tue, 06 Jul 2010)
New Revision: 63687
URL: http://svn.boost.org/trac/boost/changeset/63687

Log:
Merge v2, v3, from trunk
Added:
   branches/release/boost/filesystem/config.hpp
      - copied unchanged from r63676, /trunk/boost/filesystem/config.hpp
   branches/release/boost/filesystem/convenience.hpp
      - copied unchanged from r63676, /trunk/boost/filesystem/convenience.hpp
   branches/release/boost/filesystem/detail/
      - copied from r63676, /trunk/boost/filesystem/detail/
   branches/release/boost/filesystem/detail/utf8_codecvt_facet.hpp
      - copied unchanged from r63676, /trunk/boost/filesystem/detail/utf8_codecvt_facet.hpp
   branches/release/boost/filesystem/exception.hpp
      - copied unchanged from r63676, /trunk/boost/filesystem/exception.hpp
   branches/release/boost/filesystem/fstream.hpp
      - copied unchanged from r63676, /trunk/boost/filesystem/fstream.hpp
   branches/release/boost/filesystem/operations.hpp
      - copied unchanged from r63676, /trunk/boost/filesystem/operations.hpp
   branches/release/boost/filesystem/path.hpp
      - copied unchanged from r63676, /trunk/boost/filesystem/path.hpp
   branches/release/boost/filesystem/v2/
      - copied from r63676, /trunk/boost/filesystem/v2/
   branches/release/boost/filesystem/v2/config.hpp
      - copied unchanged from r63676, /trunk/boost/filesystem/v2/config.hpp
   branches/release/boost/filesystem/v2/convenience.hpp
      - copied unchanged from r63676, /trunk/boost/filesystem/v2/convenience.hpp
   branches/release/boost/filesystem/v2/exception.hpp
      - copied unchanged from r63676, /trunk/boost/filesystem/v2/exception.hpp
   branches/release/boost/filesystem/v2/fstream.hpp
      - copied unchanged from r63676, /trunk/boost/filesystem/v2/fstream.hpp
   branches/release/boost/filesystem/v2/operations.hpp
      - copied unchanged from r63676, /trunk/boost/filesystem/v2/operations.hpp
   branches/release/boost/filesystem/v2/path.hpp
      - copied unchanged from r63676, /trunk/boost/filesystem/v2/path.hpp
   branches/release/boost/filesystem/v3/
      - copied from r63676, /trunk/boost/filesystem/v3/
   branches/release/boost/filesystem/v3/config.hpp
      - copied unchanged from r63676, /trunk/boost/filesystem/v3/config.hpp
   branches/release/boost/filesystem/v3/convenience.hpp
      - copied unchanged from r63676, /trunk/boost/filesystem/v3/convenience.hpp
   branches/release/boost/filesystem/v3/exception.hpp
      - copied unchanged from r63676, /trunk/boost/filesystem/v3/exception.hpp
   branches/release/boost/filesystem/v3/fstream.hpp
      - copied unchanged from r63676, /trunk/boost/filesystem/v3/fstream.hpp
   branches/release/boost/filesystem/v3/operations.hpp
      - copied unchanged from r63676, /trunk/boost/filesystem/v3/operations.hpp
   branches/release/boost/filesystem/v3/path.hpp
      - copied unchanged from r63676, /trunk/boost/filesystem/v3/path.hpp
   branches/release/boost/filesystem/v3/path_traits.hpp
      - copied unchanged from r63676, /trunk/boost/filesystem/v3/path_traits.hpp
   branches/release/libs/filesystem/build/
      - copied from r63676, /trunk/libs/filesystem/build/
   branches/release/libs/filesystem/build/Jamfile.v2
      - copied unchanged from r63676, /trunk/libs/filesystem/build/Jamfile.v2
   branches/release/libs/filesystem/index.html
      - copied unchanged from r63676, /trunk/libs/filesystem/index.html
   branches/release/libs/filesystem/v2/
      - copied from r63676, /trunk/libs/filesystem/v2/
   branches/release/libs/filesystem/v2/build/
      - copied from r63676, /trunk/libs/filesystem/v2/build/
   branches/release/libs/filesystem/v2/build/Jamfile.v2
      - copied unchanged from r63676, /trunk/libs/filesystem/v2/build/Jamfile.v2
   branches/release/libs/filesystem/v2/doc/
      - copied from r63676, /trunk/libs/filesystem/v2/doc/
   branches/release/libs/filesystem/v2/doc/design.htm
      - copied unchanged from r63676, /trunk/libs/filesystem/v2/doc/design.htm
   branches/release/libs/filesystem/v2/doc/do-list.htm
      - copied unchanged from r63676, /trunk/libs/filesystem/v2/doc/do-list.htm
   branches/release/libs/filesystem/v2/doc/faq.htm
      - copied unchanged from r63676, /trunk/libs/filesystem/v2/doc/faq.htm
   branches/release/libs/filesystem/v2/doc/i18n.html
      - copied unchanged from r63676, /trunk/libs/filesystem/v2/doc/i18n.html
   branches/release/libs/filesystem/v2/doc/index.htm
      - copied unchanged from r63676, /trunk/libs/filesystem/v2/doc/index.htm
   branches/release/libs/filesystem/v2/doc/portability_guide.htm
      - copied unchanged from r63676, /trunk/libs/filesystem/v2/doc/portability_guide.htm
   branches/release/libs/filesystem/v2/doc/reference.html
      - copied unchanged from r63676, /trunk/libs/filesystem/v2/doc/reference.html
   branches/release/libs/filesystem/v2/example/
      - copied from r63676, /trunk/libs/filesystem/v2/example/
   branches/release/libs/filesystem/v2/example/Jamfile.v2
      - copied unchanged from r63676, /trunk/libs/filesystem/v2/example/Jamfile.v2
   branches/release/libs/filesystem/v2/example/file_size.cpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v2/example/file_size.cpp
   branches/release/libs/filesystem/v2/example/mbcopy.cpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v2/example/mbcopy.cpp
   branches/release/libs/filesystem/v2/example/mbpath.cpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v2/example/mbpath.cpp
   branches/release/libs/filesystem/v2/example/mbpath.hpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v2/example/mbpath.hpp
   branches/release/libs/filesystem/v2/example/path_table.cpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v2/example/path_table.cpp
   branches/release/libs/filesystem/v2/example/simple_ls.cpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v2/example/simple_ls.cpp
   branches/release/libs/filesystem/v2/src/
      - copied from r63676, /trunk/libs/filesystem/v2/src/
   branches/release/libs/filesystem/v2/src/v2_operations.cpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v2/src/v2_operations.cpp
   branches/release/libs/filesystem/v2/src/v2_path.cpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v2/src/v2_path.cpp
   branches/release/libs/filesystem/v2/src/v2_portability.cpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v2/src/v2_portability.cpp
   branches/release/libs/filesystem/v2/test/
      - copied from r63676, /trunk/libs/filesystem/v2/test/
   branches/release/libs/filesystem/v2/test/Jamfile.v2
      - copied unchanged from r63676, /trunk/libs/filesystem/v2/test/Jamfile.v2
   branches/release/libs/filesystem/v2/test/convenience_test.cpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v2/test/convenience_test.cpp
   branches/release/libs/filesystem/v2/test/deprecated_test.cpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v2/test/deprecated_test.cpp
   branches/release/libs/filesystem/v2/test/equivalent.cpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v2/test/equivalent.cpp
   branches/release/libs/filesystem/v2/test/fstream_test.cpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v2/test/fstream_test.cpp
   branches/release/libs/filesystem/v2/test/large_file_support_test.cpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v2/test/large_file_support_test.cpp
   branches/release/libs/filesystem/v2/test/lpath.hpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v2/test/lpath.hpp
   branches/release/libs/filesystem/v2/test/msvc/
      - copied from r63676, /trunk/libs/filesystem/v2/test/msvc/
   branches/release/libs/filesystem/v2/test/msvc/common.vsprops
      - copied unchanged from r63676, /trunk/libs/filesystem/v2/test/msvc/common.vsprops
   branches/release/libs/filesystem/v2/test/msvc/convenience_test/
      - copied from r63676, /trunk/libs/filesystem/v2/test/msvc/convenience_test/
   branches/release/libs/filesystem/v2/test/msvc/convenience_test/convenience_test.vcproj
      - copied unchanged from r63676, /trunk/libs/filesystem/v2/test/msvc/convenience_test/convenience_test.vcproj
   branches/release/libs/filesystem/v2/test/msvc/deprecated_test/
      - copied from r63676, /trunk/libs/filesystem/v2/test/msvc/deprecated_test/
   branches/release/libs/filesystem/v2/test/msvc/deprecated_test/deprecated_test.vcproj
      - copied unchanged from r63676, /trunk/libs/filesystem/v2/test/msvc/deprecated_test/deprecated_test.vcproj
   branches/release/libs/filesystem/v2/test/msvc/filesystem-v2.sln
      - copied unchanged from r63676, /trunk/libs/filesystem/v2/test/msvc/filesystem-v2.sln
   branches/release/libs/filesystem/v2/test/msvc/filesystem_dll/
      - copied from r63676, /trunk/libs/filesystem/v2/test/msvc/filesystem_dll/
   branches/release/libs/filesystem/v2/test/msvc/filesystem_dll/filesystem_dll.vcproj
      - copied unchanged from r63676, /trunk/libs/filesystem/v2/test/msvc/filesystem_dll/filesystem_dll.vcproj
   branches/release/libs/filesystem/v2/test/msvc/fstream_test/
      - copied from r63676, /trunk/libs/filesystem/v2/test/msvc/fstream_test/
   branches/release/libs/filesystem/v2/test/msvc/fstream_test/fstream_test.vcproj
      - copied unchanged from r63676, /trunk/libs/filesystem/v2/test/msvc/fstream_test/fstream_test.vcproj
   branches/release/libs/filesystem/v2/test/msvc/large_file_support_test/
      - copied from r63676, /trunk/libs/filesystem/v2/test/msvc/large_file_support_test/
   branches/release/libs/filesystem/v2/test/msvc/large_file_support_test/large_file_support_test.vcproj
      - copied unchanged from r63676, /trunk/libs/filesystem/v2/test/msvc/large_file_support_test/large_file_support_test.vcproj
   branches/release/libs/filesystem/v2/test/msvc/mbcopy/
      - copied from r63676, /trunk/libs/filesystem/v2/test/msvc/mbcopy/
   branches/release/libs/filesystem/v2/test/msvc/mbcopy/mbcopy.vcproj
      - copied unchanged from r63676, /trunk/libs/filesystem/v2/test/msvc/mbcopy/mbcopy.vcproj
   branches/release/libs/filesystem/v2/test/msvc/mbpath/
      - copied from r63676, /trunk/libs/filesystem/v2/test/msvc/mbpath/
   branches/release/libs/filesystem/v2/test/msvc/mbpath/mbpath.vcproj
      - copied unchanged from r63676, /trunk/libs/filesystem/v2/test/msvc/mbpath/mbpath.vcproj
   branches/release/libs/filesystem/v2/test/msvc/operations_test/
      - copied from r63676, /trunk/libs/filesystem/v2/test/msvc/operations_test/
   branches/release/libs/filesystem/v2/test/msvc/operations_test/operations_test.vcproj
      - copied unchanged from r63676, /trunk/libs/filesystem/v2/test/msvc/operations_test/operations_test.vcproj
   branches/release/libs/filesystem/v2/test/msvc/path_test/
      - copied from r63676, /trunk/libs/filesystem/v2/test/msvc/path_test/
   branches/release/libs/filesystem/v2/test/msvc/path_test/path_test.vcproj
      - copied unchanged from r63676, /trunk/libs/filesystem/v2/test/msvc/path_test/path_test.vcproj
   branches/release/libs/filesystem/v2/test/msvc/simple_ls/
      - copied from r63676, /trunk/libs/filesystem/v2/test/msvc/simple_ls/
   branches/release/libs/filesystem/v2/test/msvc/simple_ls/simple_ls.vcproj
      - copied unchanged from r63676, /trunk/libs/filesystem/v2/test/msvc/simple_ls/simple_ls.vcproj
   branches/release/libs/filesystem/v2/test/msvc/system_dll/
      - copied from r63676, /trunk/libs/filesystem/v2/test/msvc/system_dll/
   branches/release/libs/filesystem/v2/test/msvc/system_dll/system_dll.vcproj
      - copied unchanged from r63676, /trunk/libs/filesystem/v2/test/msvc/system_dll/system_dll.vcproj
   branches/release/libs/filesystem/v2/test/msvc/wide_test/
      - copied from r63676, /trunk/libs/filesystem/v2/test/msvc/wide_test/
   branches/release/libs/filesystem/v2/test/msvc/wide_test/wide_test.vcproj
      - copied unchanged from r63676, /trunk/libs/filesystem/v2/test/msvc/wide_test/wide_test.vcproj
   branches/release/libs/filesystem/v2/test/operations_test.cpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v2/test/operations_test.cpp
   branches/release/libs/filesystem/v2/test/path_test.cpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v2/test/path_test.cpp
   branches/release/libs/filesystem/v2/test/wide_test.cpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v2/test/wide_test.cpp
   branches/release/libs/filesystem/v3/
      - copied from r63676, /trunk/libs/filesystem/v3/
   branches/release/libs/filesystem/v3/build/
      - copied from r63676, /trunk/libs/filesystem/v3/build/
   branches/release/libs/filesystem/v3/build/Jamfile.v2
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/build/Jamfile.v2
   branches/release/libs/filesystem/v3/doc/
      - copied from r63676, /trunk/libs/filesystem/v3/doc/
   branches/release/libs/filesystem/v3/doc/Jamfile.v2
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/doc/Jamfile.v2
   branches/release/libs/filesystem/v3/doc/POSIX_filename_encoding.txt
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/doc/POSIX_filename_encoding.txt
   branches/release/libs/filesystem/v3/doc/deprecated.html
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/doc/deprecated.html
   branches/release/libs/filesystem/v3/doc/design.htm
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/doc/design.htm
   branches/release/libs/filesystem/v3/doc/do_list.html
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/doc/do_list.html
   branches/release/libs/filesystem/v3/doc/faq.htm
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/doc/faq.htm
   branches/release/libs/filesystem/v3/doc/index.htm
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/doc/index.htm
   branches/release/libs/filesystem/v3/doc/path_table.cpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/doc/path_table.cpp
   branches/release/libs/filesystem/v3/doc/path_table.txt
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/doc/path_table.txt
   branches/release/libs/filesystem/v3/doc/portability_guide.htm
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/doc/portability_guide.htm
   branches/release/libs/filesystem/v3/doc/reference.html
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/doc/reference.html
   branches/release/libs/filesystem/v3/doc/tutorial.html
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/doc/tutorial.html
   branches/release/libs/filesystem/v3/doc/v3.html
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/doc/v3.html
   branches/release/libs/filesystem/v3/doc/v3_design.html
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/doc/v3_design.html
   branches/release/libs/filesystem/v3/example/
      - copied from r63676, /trunk/libs/filesystem/v3/example/
   branches/release/libs/filesystem/v3/example/Jamfile.v2
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/example/Jamfile.v2
   branches/release/libs/filesystem/v3/example/error_demo.cpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/example/error_demo.cpp
   branches/release/libs/filesystem/v3/example/file_size.cpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/example/file_size.cpp
   branches/release/libs/filesystem/v3/example/mbcopy.cpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/example/mbcopy.cpp
   branches/release/libs/filesystem/v3/example/mbpath.cpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/example/mbpath.cpp
   branches/release/libs/filesystem/v3/example/mbpath.hpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/example/mbpath.hpp
   branches/release/libs/filesystem/v3/example/path_info.cpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/example/path_info.cpp
   branches/release/libs/filesystem/v3/example/simple_ls.cpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/example/simple_ls.cpp
   branches/release/libs/filesystem/v3/example/tchar.cpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/example/tchar.cpp
   branches/release/libs/filesystem/v3/example/test/
      - copied from r63676, /trunk/libs/filesystem/v3/example/test/
   branches/release/libs/filesystem/v3/example/test/Jamfile.v2
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/example/test/Jamfile.v2
   branches/release/libs/filesystem/v3/example/test/bld.bat
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/example/test/bld.bat
   branches/release/libs/filesystem/v3/example/test/bld.sh
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/example/test/bld.sh
   branches/release/libs/filesystem/v3/example/test/setup.bat
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/example/test/setup.bat
   branches/release/libs/filesystem/v3/example/test/setup.sh
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/example/test/setup.sh
   branches/release/libs/filesystem/v3/example/tut0.cpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/example/tut0.cpp
   branches/release/libs/filesystem/v3/example/tut1.cpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/example/tut1.cpp
   branches/release/libs/filesystem/v3/example/tut2.cpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/example/tut2.cpp
   branches/release/libs/filesystem/v3/example/tut3.cpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/example/tut3.cpp
   branches/release/libs/filesystem/v3/example/tut4.cpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/example/tut4.cpp
   branches/release/libs/filesystem/v3/example/tut5.cpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/example/tut5.cpp
   branches/release/libs/filesystem/v3/index.html
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/index.html
   branches/release/libs/filesystem/v3/src/
      - copied from r63676, /trunk/libs/filesystem/v3/src/
   branches/release/libs/filesystem/v3/src/codecvt_error_category.cpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/src/codecvt_error_category.cpp
   branches/release/libs/filesystem/v3/src/operations.cpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/src/operations.cpp
   branches/release/libs/filesystem/v3/src/path.cpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/src/path.cpp
   branches/release/libs/filesystem/v3/src/path_traits.cpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/src/path_traits.cpp
   branches/release/libs/filesystem/v3/src/portability.cpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/src/portability.cpp
   branches/release/libs/filesystem/v3/src/unique_path.cpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/src/unique_path.cpp
   branches/release/libs/filesystem/v3/src/utf8_codecvt_facet.cpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/src/utf8_codecvt_facet.cpp
   branches/release/libs/filesystem/v3/src/windows_file_codecvt.cpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/src/windows_file_codecvt.cpp
   branches/release/libs/filesystem/v3/src/windows_file_codecvt.hpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/src/windows_file_codecvt.hpp
   branches/release/libs/filesystem/v3/test/
      - copied from r63676, /trunk/libs/filesystem/v3/test/
   branches/release/libs/filesystem/v3/test/Jamfile.v2
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/test/Jamfile.v2
   branches/release/libs/filesystem/v3/test/convenience_test.cpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/test/convenience_test.cpp
   branches/release/libs/filesystem/v3/test/deprecated_test.cpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/test/deprecated_test.cpp
   branches/release/libs/filesystem/v3/test/design_use_cases.cpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/test/design_use_cases.cpp
   branches/release/libs/filesystem/v3/test/equivalent.cpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/test/equivalent.cpp
   branches/release/libs/filesystem/v3/test/fstream_test.cpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/test/fstream_test.cpp
   branches/release/libs/filesystem/v3/test/large_file_support_test.cpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/test/large_file_support_test.cpp
   branches/release/libs/filesystem/v3/test/msvc/
      - copied from r63676, /trunk/libs/filesystem/v3/test/msvc/
   branches/release/libs/filesystem/v3/test/msvc/common.vsprops
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/test/msvc/common.vsprops
   branches/release/libs/filesystem/v3/test/msvc/convenience_test/
      - copied from r63676, /trunk/libs/filesystem/v3/test/msvc/convenience_test/
   branches/release/libs/filesystem/v3/test/msvc/convenience_test/convenience_test.vcproj
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/test/msvc/convenience_test/convenience_test.vcproj
   branches/release/libs/filesystem/v3/test/msvc/deprecated_test/
      - copied from r63676, /trunk/libs/filesystem/v3/test/msvc/deprecated_test/
   branches/release/libs/filesystem/v3/test/msvc/deprecated_test/deprecated_test.vcproj
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/test/msvc/deprecated_test/deprecated_test.vcproj
   branches/release/libs/filesystem/v3/test/msvc/error_demo/
      - copied from r63676, /trunk/libs/filesystem/v3/test/msvc/error_demo/
   branches/release/libs/filesystem/v3/test/msvc/error_demo/error_demo.vcproj
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/test/msvc/error_demo/error_demo.vcproj
   branches/release/libs/filesystem/v3/test/msvc/filesystem-v3.sln
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/test/msvc/filesystem-v3.sln
   branches/release/libs/filesystem/v3/test/msvc/filesystem_dll/
      - copied from r63676, /trunk/libs/filesystem/v3/test/msvc/filesystem_dll/
   branches/release/libs/filesystem/v3/test/msvc/filesystem_dll/filesystem_dll.vcproj
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/test/msvc/filesystem_dll/filesystem_dll.vcproj
   branches/release/libs/filesystem/v3/test/msvc/fstream_test/
      - copied from r63676, /trunk/libs/filesystem/v3/test/msvc/fstream_test/
   branches/release/libs/filesystem/v3/test/msvc/fstream_test/fstream_test.vcproj
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/test/msvc/fstream_test/fstream_test.vcproj
   branches/release/libs/filesystem/v3/test/msvc/operations_test/
      - copied from r63676, /trunk/libs/filesystem/v3/test/msvc/operations_test/
   branches/release/libs/filesystem/v3/test/msvc/operations_test/operations_test.vcproj
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/test/msvc/operations_test/operations_test.vcproj
   branches/release/libs/filesystem/v3/test/msvc/operations_unit_test/
      - copied from r63676, /trunk/libs/filesystem/v3/test/msvc/operations_unit_test/
   branches/release/libs/filesystem/v3/test/msvc/operations_unit_test/operations_unit_test.vcproj
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/test/msvc/operations_unit_test/operations_unit_test.vcproj
   branches/release/libs/filesystem/v3/test/msvc/path_test/
      - copied from r63676, /trunk/libs/filesystem/v3/test/msvc/path_test/
   branches/release/libs/filesystem/v3/test/msvc/path_test/path_test.vcproj
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/test/msvc/path_test/path_test.vcproj
   branches/release/libs/filesystem/v3/test/msvc/path_test_dynamic_link/
      - copied from r63676, /trunk/libs/filesystem/v3/test/msvc/path_test_dynamic_link/
   branches/release/libs/filesystem/v3/test/msvc/path_test_dynamic_link/path_test_dynamic_linkl.vcproj
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/test/msvc/path_test_dynamic_link/path_test_dynamic_linkl.vcproj
   branches/release/libs/filesystem/v3/test/msvc/path_unit_test/
      - copied from r63676, /trunk/libs/filesystem/v3/test/msvc/path_unit_test/
   branches/release/libs/filesystem/v3/test/msvc/path_unit_test/path_unit_test.vcproj
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/test/msvc/path_unit_test/path_unit_test.vcproj
   branches/release/libs/filesystem/v3/test/msvc/simple_ls/
      - copied from r63676, /trunk/libs/filesystem/v3/test/msvc/simple_ls/
   branches/release/libs/filesystem/v3/test/msvc/simple_ls/simple_ls.vcproj
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/test/msvc/simple_ls/simple_ls.vcproj
   branches/release/libs/filesystem/v3/test/msvc/system_dll/
      - copied from r63676, /trunk/libs/filesystem/v3/test/msvc/system_dll/
   branches/release/libs/filesystem/v3/test/msvc/system_dll/system_dll.vcproj
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/test/msvc/system_dll/system_dll.vcproj
   branches/release/libs/filesystem/v3/test/msvc/tchar_example/
      - copied from r63676, /trunk/libs/filesystem/v3/test/msvc/tchar_example/
   branches/release/libs/filesystem/v3/test/msvc/tchar_example/tchar_example.vcproj
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/test/msvc/tchar_example/tchar_example.vcproj
   branches/release/libs/filesystem/v3/test/msvc/tut0/
      - copied from r63676, /trunk/libs/filesystem/v3/test/msvc/tut0/
   branches/release/libs/filesystem/v3/test/msvc/tut0/tut0.vcproj
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/test/msvc/tut0/tut0.vcproj
   branches/release/libs/filesystem/v3/test/msvc/tut1/
      - copied from r63676, /trunk/libs/filesystem/v3/test/msvc/tut1/
   branches/release/libs/filesystem/v3/test/msvc/tut1/tut1.vcproj
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/test/msvc/tut1/tut1.vcproj
   branches/release/libs/filesystem/v3/test/msvc/tut2/
      - copied from r63676, /trunk/libs/filesystem/v3/test/msvc/tut2/
   branches/release/libs/filesystem/v3/test/msvc/tut2/tut2.vcproj
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/test/msvc/tut2/tut2.vcproj
   branches/release/libs/filesystem/v3/test/msvc/tut3/
      - copied from r63676, /trunk/libs/filesystem/v3/test/msvc/tut3/
   branches/release/libs/filesystem/v3/test/msvc/tut3/tut3.vcproj
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/test/msvc/tut3/tut3.vcproj
   branches/release/libs/filesystem/v3/test/msvc/tut4/
      - copied from r63676, /trunk/libs/filesystem/v3/test/msvc/tut4/
   branches/release/libs/filesystem/v3/test/msvc/tut4/tut4.vcproj
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/test/msvc/tut4/tut4.vcproj
   branches/release/libs/filesystem/v3/test/msvc/wide_test/
      - copied from r63676, /trunk/libs/filesystem/v3/test/msvc/wide_test/
   branches/release/libs/filesystem/v3/test/msvc/wide_test/wide_test.vcproj
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/test/msvc/wide_test/wide_test.vcproj
   branches/release/libs/filesystem/v3/test/msvc10/
      - copied from r63676, /trunk/libs/filesystem/v3/test/msvc10/
   branches/release/libs/filesystem/v3/test/msvc10/common.props
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/test/msvc10/common.props
   branches/release/libs/filesystem/v3/test/msvc10/convenience_test/
      - copied from r63676, /trunk/libs/filesystem/v3/test/msvc10/convenience_test/
   branches/release/libs/filesystem/v3/test/msvc10/convenience_test/convenience_test.vcxproj
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/test/msvc10/convenience_test/convenience_test.vcxproj
   branches/release/libs/filesystem/v3/test/msvc10/deprecated_test/
      - copied from r63676, /trunk/libs/filesystem/v3/test/msvc10/deprecated_test/
   branches/release/libs/filesystem/v3/test/msvc10/deprecated_test/deprecated_test.vcxproj
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/test/msvc10/deprecated_test/deprecated_test.vcxproj
   branches/release/libs/filesystem/v3/test/msvc10/filesystem-v3.sln
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/test/msvc10/filesystem-v3.sln
   branches/release/libs/filesystem/v3/test/msvc10/filesystem_dll/
      - copied from r63676, /trunk/libs/filesystem/v3/test/msvc10/filesystem_dll/
   branches/release/libs/filesystem/v3/test/msvc10/filesystem_dll/filesystem_dll.vcxproj
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/test/msvc10/filesystem_dll/filesystem_dll.vcxproj
   branches/release/libs/filesystem/v3/test/msvc10/fstream_test/
      - copied from r63676, /trunk/libs/filesystem/v3/test/msvc10/fstream_test/
   branches/release/libs/filesystem/v3/test/msvc10/fstream_test/fstream_test.vcxproj
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/test/msvc10/fstream_test/fstream_test.vcxproj
   branches/release/libs/filesystem/v3/test/msvc10/operations_test/
      - copied from r63676, /trunk/libs/filesystem/v3/test/msvc10/operations_test/
   branches/release/libs/filesystem/v3/test/msvc10/operations_test/operations_test.vcxproj
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/test/msvc10/operations_test/operations_test.vcxproj
   branches/release/libs/filesystem/v3/test/msvc10/operations_unit_test/
      - copied from r63676, /trunk/libs/filesystem/v3/test/msvc10/operations_unit_test/
   branches/release/libs/filesystem/v3/test/msvc10/operations_unit_test/operations_unit_test.vcxproj
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/test/msvc10/operations_unit_test/operations_unit_test.vcxproj
   branches/release/libs/filesystem/v3/test/msvc10/path_test/
      - copied from r63676, /trunk/libs/filesystem/v3/test/msvc10/path_test/
   branches/release/libs/filesystem/v3/test/msvc10/path_test/path_test.vcxproj
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/test/msvc10/path_test/path_test.vcxproj
   branches/release/libs/filesystem/v3/test/msvc10/path_unit_test/
      - copied from r63676, /trunk/libs/filesystem/v3/test/msvc10/path_unit_test/
   branches/release/libs/filesystem/v3/test/msvc10/path_unit_test/path_unit_test.vcxproj
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/test/msvc10/path_unit_test/path_unit_test.vcxproj
   branches/release/libs/filesystem/v3/test/msvc10/system_dll/
      - copied from r63676, /trunk/libs/filesystem/v3/test/msvc10/system_dll/
   branches/release/libs/filesystem/v3/test/msvc10/system_dll/system_dll.vcxproj
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/test/msvc10/system_dll/system_dll.vcxproj
   branches/release/libs/filesystem/v3/test/msvc10/tut1/
      - copied from r63676, /trunk/libs/filesystem/v3/test/msvc10/tut1/
   branches/release/libs/filesystem/v3/test/msvc10/tut1/tut1.vcxproj
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/test/msvc10/tut1/tut1.vcxproj
   branches/release/libs/filesystem/v3/test/msvc10/tut2/
      - copied from r63676, /trunk/libs/filesystem/v3/test/msvc10/tut2/
   branches/release/libs/filesystem/v3/test/msvc10/tut2/tut2.vcxproj
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/test/msvc10/tut2/tut2.vcxproj
   branches/release/libs/filesystem/v3/test/msvc10/tut3/
      - copied from r63676, /trunk/libs/filesystem/v3/test/msvc10/tut3/
   branches/release/libs/filesystem/v3/test/msvc10/tut3/tut3.vcxproj
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/test/msvc10/tut3/tut3.vcxproj
   branches/release/libs/filesystem/v3/test/msvc10/tut4/
      - copied from r63676, /trunk/libs/filesystem/v3/test/msvc10/tut4/
   branches/release/libs/filesystem/v3/test/msvc10/tut4/tut4.vcxproj
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/test/msvc10/tut4/tut4.vcxproj
   branches/release/libs/filesystem/v3/test/operations_test.cpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/test/operations_test.cpp
   branches/release/libs/filesystem/v3/test/operations_unit_test.cpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/test/operations_unit_test.cpp
   branches/release/libs/filesystem/v3/test/path_test.cpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/test/path_test.cpp
   branches/release/libs/filesystem/v3/test/path_unit_test.cpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/test/path_unit_test.cpp
   branches/release/libs/filesystem/v3/test/test_codecvt.hpp
      - copied unchanged from r63676, /trunk/libs/filesystem/v3/test/test_codecvt.hpp
Removed:
   branches/release/libs/filesystem/doc/
   branches/release/libs/filesystem/example/
   branches/release/libs/filesystem/src/
   branches/release/libs/filesystem/test/convenience_test.cpp
   branches/release/libs/filesystem/test/deprecated_test.cpp
   branches/release/libs/filesystem/test/equivalent.cpp
   branches/release/libs/filesystem/test/fstream_test.cpp
   branches/release/libs/filesystem/test/large_file_support_test.cpp
   branches/release/libs/filesystem/test/lpath.hpp
   branches/release/libs/filesystem/test/msvc/
   branches/release/libs/filesystem/test/operations_test.cpp
   branches/release/libs/filesystem/test/path_test.cpp
   branches/release/libs/filesystem/test/wide_test.cpp
Properties modified:
   branches/release/boost/filesystem/ (props changed)
   branches/release/boost/filesystem.hpp (contents, props changed)
   branches/release/libs/filesystem/ (props changed)
Text files modified:
   branches/release/boost/filesystem.hpp | 38 +++++++++++++++++++++++--------
   branches/release/libs/filesystem/test/Jamfile.v2 | 48 +++++++++++++++-------------------------
   2 files changed, 46 insertions(+), 40 deletions(-)

Modified: branches/release/boost/filesystem.hpp
==============================================================================
--- branches/release/boost/filesystem.hpp (original)
+++ branches/release/boost/filesystem.hpp 2010-07-06 07:17:54 EDT (Tue, 06 Jul 2010)
@@ -1,20 +1,38 @@
-// boost/filesystem/filesystem.hpp -----------------------------------------//
+// boost/filesystem.hpp --------------------------------------------------------------//
 
-// Copyright Beman Dawes 2005
+// Copyright Beman Dawes 2010
 
-// 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)
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
 
-// See library home page at http://www.boost.org/libs/filesystem
+// Library home page: http://www.boost.org/libs/filesystem
 
-//----------------------------------------------------------------------------//
+//--------------------------------------------------------------------------------------//
 
 #ifndef BOOST_FILESYSTEM_FILESYSTEM_HPP
 #define BOOST_FILESYSTEM_FILESYSTEM_HPP
 
-#include <boost/filesystem/operations.hpp> // includes path.hpp
-#include <boost/filesystem/convenience.hpp>
+# if defined(BOOST_FILESYSTEM_VERSION) \
+ && BOOST_FILESYSTEM_VERSION != 2 && BOOST_FILESYSTEM_VERSION != 3
+# error BOOST_FILESYSTEM_VERSION defined, but not as 2 or 3
+# endif
+
+# if !defined(BOOST_FILESYSTEM_VERSION)
+# define BOOST_FILESYSTEM_VERSION 2
+# endif
+
+#if BOOST_FILESYSTEM_VERSION == 2
+# include <boost/filesystem/v2/config.hpp>
+# include <boost/filesystem/v2/path.hpp>
+# include <boost/filesystem/v2/operations.hpp>
+# include <boost/filesystem/v2/convenience.hpp>
+
+# else
+# include <boost/filesystem/v3/config.hpp>
+# include <boost/filesystem/v3/path.hpp>
+# include <boost/filesystem/v3/operations.hpp>
+# include <boost/filesystem/v3/convenience.hpp>
 
-#endif
+# endif
 
+#endif // BOOST_FILESYSTEM_FILESYSTEM_HPP

Modified: branches/release/libs/filesystem/test/Jamfile.v2
==============================================================================
--- branches/release/libs/filesystem/test/Jamfile.v2 (original)
+++ branches/release/libs/filesystem/test/Jamfile.v2 2010-07-06 07:17:54 EDT (Tue, 06 Jul 2010)
@@ -7,37 +7,25 @@
 project
     : requirements
       <library>/boost/filesystem//boost_filesystem
+ <library>/boost/system//boost_system
       <toolset>msvc:<asynch-exceptions>on
     ;
-
+
    test-suite "filesystem" :
- [ run path_test.cpp
- : : : <link>static
- ]
- [ run path_test.cpp ../../system/build
- : : : : path_test_dll
- ]
- [ run operations_test.cpp
- : : : <link>static
- ]
- [ run operations_test.cpp ../../system/build
- : : : : operations_test_dll
- ]
- [ run fstream_test.cpp
- : : : <link>static
- ]
- [ run convenience_test.cpp
- : : : <link>static
- ]
- [ run large_file_support_test.cpp
- : : : <link>static
- ]
- [ run wide_test.cpp
- : : : <link>static
- ]
-
- [ compile deprecated_test.cpp ]
- [ compile ../example/mbcopy.cpp ]
- [ compile ../example/mbpath.cpp ]
- [ compile ../example/simple_ls.cpp ]
+ [ run ../v2/test/path_test.cpp : : : : v2_path_test ]
+ [ run ../v2/test/operations_test.cpp : : : : v2_operations_test ]
+ [ run ../v2/test/fstream_test.cpp : : : : v2_fstream_test ]
+ [ run ../v2/test/convenience_test.cpp : : : : v2_convenience_test ]
+ [ run ../v2/test/large_file_support_test.cpp : : : : v2_large_file_support_test ]
+
+ [ run ../v3/test/path_unit_test.cpp : : : : v3_path_unit_test ]
+ [ run ../v3/test/path_test.cpp : : : : v3_path_test ]
+ [ run ../v3/test/operations_unit_test.cpp : : : : v3_operations_unit_test ]
+ [ run ../v3/test/operations_test.cpp : : : : v3_operations_test ]
+ [ run ../v3/test/fstream_test.cpp : : : : v3_fstream_test ]
+ [ run ../v3/test/convenience_test.cpp : : : : v3_convenience_test ]
+ [ run ../v3/test/large_file_support_test.cpp : : : : v3_large_file_support_test ]
+ [ run ../v3/test/deprecated_test.cpp : : : : v3_deprecated_test ]
+ [ run ../v3/example/simple_ls.cpp : : : : v3_simple_ls ]
+
        ;

Deleted: branches/release/libs/filesystem/test/convenience_test.cpp
==============================================================================
--- branches/release/libs/filesystem/test/convenience_test.cpp 2010-07-06 07:17:54 EDT (Tue, 06 Jul 2010)
+++ (empty file)
@@ -1,167 +0,0 @@
-// libs/filesystem/test/convenience_test.cpp -------------------------------//
-
-// Copyright Beman Dawes, 2002
-// Copyright Vladimir Prus, 2002
-// 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 library home page at http://www.boost.org/libs/filesystem
-
-#include <boost/config/warning_disable.hpp>
-
-// See deprecated_test for tests of deprecated features
-#define BOOST_FILESYSTEM_NO_DEPRECATED
-
-#include <boost/filesystem/convenience.hpp>
-namespace fs = boost::filesystem;
-using fs::path;
-namespace sys = boost::system;
-
-#include <boost/detail/lightweight_test.hpp>
-#include <boost/bind.hpp>
-#include <fstream>
-#include <iostream>
-
-#ifndef BOOST_FILESYSTEM_NARROW_ONLY
-# define BOOST_FS_IS_EMPTY fs::is_empty
-# define BOOST_BND(BOOST_FUNC_TO_DO) BOOST_FUNC_TO_DO<fs::path>
-#else
-# define BOOST_FS_IS_EMPTY fs::_is_empty
-# define BOOST_BND(BOOST_FUNC_TO_DO) BOOST_FUNC_TO_DO
-#endif
-
-namespace
-{
- template< typename F >
- bool throws_fs_error( F func )
- {
- try { func(); }
-
- catch ( const fs::filesystem_error & )
- {
- return true;
- }
- return false;
- }
-
- void create_recursive_iterator( const fs::path & ph )
- {
- fs::recursive_directory_iterator it( ph );
- }
-}
-
-// --------------------------------------------------------------------------//
-
-int main( int, char*[] )
-{
-
-// create_directories() tests ----------------------------------------------//
-
- BOOST_TEST( !fs::create_directories( "" ) ); // should be harmless
- BOOST_TEST( !fs::create_directories( "/" ) ); // ditto
-
- fs::remove_all( "xx" ); // make sure slate is blank
- BOOST_TEST( !fs::exists( "xx" ) ); // reality check
-
- BOOST_TEST( fs::create_directories( "xx" ) );
- BOOST_TEST( fs::exists( "xx" ) );
- BOOST_TEST( fs::is_directory( "xx" ) );
-
- BOOST_TEST( fs::create_directories( "xx/yy/zz" ) );
- BOOST_TEST( fs::exists( "xx" ) );
- BOOST_TEST( fs::exists( "xx/yy" ) );
- BOOST_TEST( fs::exists( "xx/yy/zz" ) );
- BOOST_TEST( fs::is_directory( "xx" ) );
- BOOST_TEST( fs::is_directory( "xx/yy" ) );
- BOOST_TEST( fs::is_directory( "xx/yy/zz" ) );
-
- path is_a_file( "xx/uu" );
- {
- std::ofstream f( is_a_file.external_file_string().c_str() );
- BOOST_TEST( !!f );
- }
- BOOST_TEST( throws_fs_error(
- boost::bind( BOOST_BND(fs::create_directories), is_a_file ) ) );
- BOOST_TEST( throws_fs_error(
- boost::bind( BOOST_BND(fs::create_directories), is_a_file / "aa" ) ) );
-
-// recursive_directory_iterator tests ----------------------------------------//
-
- sys::error_code ec;
- fs::recursive_directory_iterator it( "/no-such-path", ec );
- BOOST_TEST( ec );
- BOOST_TEST( throws_fs_error(
- boost::bind( create_recursive_iterator, "/no-such-path" ) ) );
-
- fs::remove( "xx/uu" );
-
-#ifdef BOOST_WINDOWS_API
- // These tests depends on ordering of directory entries, and that's guaranteed
- // on Windows but not necessarily on other operating systems
- {
- std::ofstream f( "xx/yya" );
- BOOST_TEST( !!f );
- }
-
- for ( it = fs::recursive_directory_iterator( "xx" );
- it != fs::recursive_directory_iterator(); ++it )
- { std::cout << it->path() << '\n'; }
-
- it = fs::recursive_directory_iterator( "xx" );
- BOOST_TEST( it->path() == "xx/yy" );
- BOOST_TEST( it.level() == 0 );
- ++it;
- BOOST_TEST( it->path() == "xx/yy/zz" );
- BOOST_TEST( it.level() == 1 );
- it.pop();
- BOOST_TEST( it->path() == "xx/yya" );
- BOOST_TEST( it.level() == 0 );
- it++;
- BOOST_TEST( it == fs::recursive_directory_iterator() );
-
- it = fs::recursive_directory_iterator( "xx" );
- BOOST_TEST( it->path() == "xx/yy" );
- it.no_push();
- ++it;
- BOOST_TEST( it->path() == "xx/yya" );
- ++it;
- BOOST_TEST( it == fs::recursive_directory_iterator() );
-
- fs::remove( "xx/yya" );
-#endif
-
- it = fs::recursive_directory_iterator( "xx/yy/zz" );
- BOOST_TEST( it == fs::recursive_directory_iterator() );
-
- it = fs::recursive_directory_iterator( "xx" );
- BOOST_TEST( it->path() == "xx/yy" );
- BOOST_TEST( it.level() == 0 );
- ++it;
- BOOST_TEST( it->path() == "xx/yy/zz" );
- BOOST_TEST( it.level() == 1 );
- it++;
- BOOST_TEST( it == fs::recursive_directory_iterator() );
-
- it = fs::recursive_directory_iterator( "xx" );
- BOOST_TEST( it->path() == "xx/yy" );
- it.no_push();
- ++it;
- BOOST_TEST( it == fs::recursive_directory_iterator() );
-
- it = fs::recursive_directory_iterator( "xx" );
- BOOST_TEST( it->path() == "xx/yy" );
- ++it;
- it.pop();
- BOOST_TEST( it == fs::recursive_directory_iterator() );
-
-
-
- // nothrow wrong. see imp. Make sure failed basic_directory_iterator
- // ctor creates the end iterator.
-
-
-
-
- return ::boost::report_errors();
-}

Deleted: branches/release/libs/filesystem/test/deprecated_test.cpp
==============================================================================
--- branches/release/libs/filesystem/test/deprecated_test.cpp 2010-07-06 07:17:54 EDT (Tue, 06 Jul 2010)
+++ (empty file)
@@ -1,202 +0,0 @@
-// deprecated_test program --------------------------------------------------//
-
-// Copyright Beman Dawes 2002
-// Copyright Vladimir Prus 2002
-
-// 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 library home page at http://www.boost.org/libs/filesystem
-
-// This test verifies that various deprecated names still compile. This is
-// important to preserve existing code that uses the old names.
-
-#include <boost/filesystem.hpp>
-#include <boost/detail/lightweight_test.hpp>
-
-namespace fs = boost::filesystem;
-using boost::filesystem::path;
-
-#define PATH_CHECK( a, b ) check( a, b, __LINE__ )
-
-namespace
-{
- std::string platform( BOOST_PLATFORM );
-
- void check( const fs::path & source,
- const std::string & expected, int line )
- {
- if ( source.string()== expected ) return;
-
- ++::boost::detail::test_errors();
-
- std::cout << '(' << line << ") source.string(): \"" << source.string()
- << "\" != expected: \"" << expected
- << "\"" << std::endl;
- }
-
- void check_normalize()
- {
- PATH_CHECK( path("").normalize(), "" );
- PATH_CHECK( path("/").normalize(), "/" );
- PATH_CHECK( path("//").normalize(), "//" );
- PATH_CHECK( path("///").normalize(), "/" );
- PATH_CHECK( path("f").normalize(), "f" );
- PATH_CHECK( path("foo").normalize(), "foo" );
- PATH_CHECK( path("foo/").normalize(), "foo/." );
- PATH_CHECK( path("f/").normalize(), "f/." );
- PATH_CHECK( path( "/foo" ).normalize(), "/foo" );
- PATH_CHECK( path( "foo/bar" ).normalize(), "foo/bar" );
- PATH_CHECK( path("..").normalize(), ".." );
- PATH_CHECK( path("../..").normalize(), "../.." );
- PATH_CHECK( path("/..").normalize(), "/.." );
- PATH_CHECK( path("/../..").normalize(), "/../.." );
- PATH_CHECK( path("../foo").normalize(), "../foo" );
- PATH_CHECK( path("foo/..").normalize(), "." );
- PATH_CHECK( path("foo/../").normalize(), "./." );
- PATH_CHECK( (path("foo") / "..").normalize() , "." );
- PATH_CHECK( path("foo/...").normalize(), "foo/..." );
- PATH_CHECK( path("foo/.../").normalize(), "foo/.../." );
- PATH_CHECK( path("foo/..bar").normalize(), "foo/..bar" );
- PATH_CHECK( path("../f").normalize(), "../f" );
- PATH_CHECK( path("/../f").normalize(), "/../f" );
- PATH_CHECK( path("f/..").normalize(), "." );
- PATH_CHECK( (path("f") / "..").normalize() , "." );
- PATH_CHECK( path("foo/../..").normalize(), ".." );
- PATH_CHECK( path("foo/../../").normalize(), "../." );
- PATH_CHECK( path("foo/../../..").normalize(), "../.." );
- PATH_CHECK( path("foo/../../../").normalize(), "../../." );
- PATH_CHECK( path("foo/../bar").normalize(), "bar" );
- PATH_CHECK( path("foo/../bar/").normalize(), "bar/." );
- PATH_CHECK( path("foo/bar/..").normalize(), "foo" );
- PATH_CHECK( path("foo/bar/../").normalize(), "foo/." );
- PATH_CHECK( path("foo/bar/../..").normalize(), "." );
- PATH_CHECK( path("foo/bar/../../").normalize(), "./." );
- PATH_CHECK( path("foo/bar/../blah").normalize(), "foo/blah" );
- PATH_CHECK( path("f/../b").normalize(), "b" );
- PATH_CHECK( path("f/b/..").normalize(), "f" );
- PATH_CHECK( path("f/b/../").normalize(), "f/." );
- PATH_CHECK( path("f/b/../a").normalize(), "f/a" );
- PATH_CHECK( path("foo/bar/blah/../..").normalize(), "foo" );
- PATH_CHECK( path("foo/bar/blah/../../bletch").normalize(), "foo/bletch" );
- PATH_CHECK( path( "//net" ).normalize(), "//net" );
- PATH_CHECK( path( "//net/" ).normalize(), "//net/" );
- PATH_CHECK( path( "//..net" ).normalize(), "//..net" );
- PATH_CHECK( path( "//net/.." ).normalize(), "//net/.." );
- PATH_CHECK( path( "//net/foo" ).normalize(), "//net/foo" );
- PATH_CHECK( path( "//net/foo/" ).normalize(), "//net/foo/." );
- PATH_CHECK( path( "//net/foo/.." ).normalize(), "//net/" );
- PATH_CHECK( path( "//net/foo/../" ).normalize(), "//net/." );
-
- PATH_CHECK( path( "/net/foo/bar" ).normalize(), "/net/foo/bar" );
- PATH_CHECK( path( "/net/foo/bar/" ).normalize(), "/net/foo/bar/." );
- PATH_CHECK( path( "/net/foo/.." ).normalize(), "/net" );
- PATH_CHECK( path( "/net/foo/../" ).normalize(), "/net/." );
-
- PATH_CHECK( path( "//net//foo//bar" ).normalize(), "//net/foo/bar" );
- PATH_CHECK( path( "//net//foo//bar//" ).normalize(), "//net/foo/bar/." );
- PATH_CHECK( path( "//net//foo//.." ).normalize(), "//net/" );
- PATH_CHECK( path( "//net//foo//..//" ).normalize(), "//net/." );
-
- PATH_CHECK( path( "///net///foo///bar" ).normalize(), "/net/foo/bar" );
- PATH_CHECK( path( "///net///foo///bar///" ).normalize(), "/net/foo/bar/." );
- PATH_CHECK( path( "///net///foo///.." ).normalize(), "/net" );
- PATH_CHECK( path( "///net///foo///..///" ).normalize(), "/net/." );
-
- if ( platform == "Windows" )
- {
- PATH_CHECK( path( "c:.." ).normalize(), "c:.." );
- PATH_CHECK( path( "c:foo/.." ).normalize(), "c:" );
-
- PATH_CHECK( path( "c:foo/../" ).normalize(), "c:." );
-
- PATH_CHECK( path( "c:/foo/.." ).normalize(), "c:/" );
- PATH_CHECK( path( "c:/foo/../" ).normalize(), "c:/." );
- PATH_CHECK( path( "c:/.." ).normalize(), "c:/.." );
- PATH_CHECK( path( "c:/../" ).normalize(), "c:/../." );
- PATH_CHECK( path( "c:/../.." ).normalize(), "c:/../.." );
- PATH_CHECK( path( "c:/../../" ).normalize(), "c:/../../." );
- PATH_CHECK( path( "c:/../foo" ).normalize(), "c:/../foo" );
- PATH_CHECK( path( "c:/../foo/" ).normalize(), "c:/../foo/." );
- PATH_CHECK( path( "c:/../../foo" ).normalize(), "c:/../../foo" );
- PATH_CHECK( path( "c:/../../foo/" ).normalize(), "c:/../../foo/." );
- PATH_CHECK( path( "c:/..foo" ).normalize(), "c:/..foo" );
- }
- else // POSIX
- {
- PATH_CHECK( path( "c:.." ).normalize(), "c:.." );
- PATH_CHECK( path( "c:foo/.." ).normalize(), "." );
- PATH_CHECK( path( "c:foo/../" ).normalize(), "./." );
- PATH_CHECK( path( "c:/foo/.." ).normalize(), "c:" );
- PATH_CHECK( path( "c:/foo/../" ).normalize(), "c:/." );
- PATH_CHECK( path( "c:/.." ).normalize(), "." );
- PATH_CHECK( path( "c:/../" ).normalize(), "./." );
- PATH_CHECK( path( "c:/../.." ).normalize(), ".." );
- PATH_CHECK( path( "c:/../../" ).normalize(), "../." );
- PATH_CHECK( path( "c:/../foo" ).normalize(), "foo" );
- PATH_CHECK( path( "c:/../foo/" ).normalize(), "foo/." );
- PATH_CHECK( path( "c:/../../foo" ).normalize(), "../foo" );
- PATH_CHECK( path( "c:/../../foo/" ).normalize(), "../foo/." );
- PATH_CHECK( path( "c:/..foo" ).normalize(), "c:/..foo" );
- }
- }
-} // unnamed namespace
-
-//----------------------------------------------------------------------------//
-
-int main( int /*argc*/, char * /*argv*/[] )
-{
- // The choice of platform is make at runtime rather than compile-time
- // so that compile errors for all platforms will be detected even though
- // only the current platform is runtime tested.
- platform = ( platform == "Win32" || platform == "Win64" || platform == "Cygwin" )
- ? "Windows"
- : "POSIX";
- std::cout << "Platform is " << platform << '\n';
-
- path::default_name_check( fs::no_check );
-
- fs::directory_entry de( "foo/bar" );
-
- de.replace_leaf( "", fs::file_status(), fs::file_status() );
-
- de.leaf();
- de.string();
-
- fs::path ng( " no-way, Jose" );
- BOOST_TEST( !fs::is_regular( ng ) ); // verify deprecated name still works
- BOOST_TEST( !fs::symbolic_link_exists( "nosuchfileordirectory" ) );
-
- check_normalize();
-
-// extension() tests ---------------------------------------------------------//
-
- BOOST_TEST( fs::extension("a/b") == "" );
- BOOST_TEST( fs::extension("a/b.txt") == ".txt" );
- BOOST_TEST( fs::extension("a/b.") == "." );
- BOOST_TEST( fs::extension("a.b.c") == ".c" );
- BOOST_TEST( fs::extension("a.b.c.") == "." );
- BOOST_TEST( fs::extension("") == "" );
- BOOST_TEST( fs::extension("a/") == "." );
-
-// basename() tests ----------------------------------------------------------//
-
- BOOST_TEST( fs::basename("b") == "b" );
- BOOST_TEST( fs::basename("a/b.txt") == "b" );
- BOOST_TEST( fs::basename("a/b.") == "b" );
- BOOST_TEST( fs::basename("a.b.c") == "a.b" );
- BOOST_TEST( fs::basename("a.b.c.") == "a.b.c" );
- BOOST_TEST( fs::basename("") == "" );
-
-// change_extension tests ---------------------------------------------------//
-
- BOOST_TEST( fs::change_extension("a.txt", ".tex").string() == "a.tex" );
- BOOST_TEST( fs::change_extension("a.", ".tex").string() == "a.tex" );
- BOOST_TEST( fs::change_extension("a", ".txt").string() == "a.txt" );
- BOOST_TEST( fs::change_extension("a.b.txt", ".tex").string() == "a.b.tex" );
- // see the rationale in html docs for explanation why this works
- BOOST_TEST( fs::change_extension("", ".png").string() == ".png" );
-
- return ::boost::report_errors();
-}

Deleted: branches/release/libs/filesystem/test/equivalent.cpp
==============================================================================
--- branches/release/libs/filesystem/test/equivalent.cpp 2010-07-06 07:17:54 EDT (Tue, 06 Jul 2010)
+++ (empty file)
@@ -1,39 +0,0 @@
-// equivalent program -------------------------------------------------------//
-
-// Copyright (c) 2004 Beman Dawes
-
-// 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 library home page at http://www.boost.org/libs/filesystem
-
-//----------------------------------------------------------------------------//
-
-#include <boost/filesystem/operations.hpp>
-#include <iostream>
-#include <exception>
-
-int main( int argc, char * argv[] )
-{
- boost::filesystem::path::default_name_check( boost::filesystem::native );
- if ( argc != 3 )
- {
- std::cout << "Usage: equivalent path1 path2\n";
- return 2;
- }
-
- bool eq;
- try
- {
- eq = boost::filesystem::equivalent( argv[1], argv[2] );
- }
- catch ( const std::exception & ex )
- {
- std::cout << ex.what() << "\n";
- return 3;
- }
-
- std::cout << (eq ? "Paths are equivalent\n" : "Paths are not equivalent\n");
- return !eq;
-}

Deleted: branches/release/libs/filesystem/test/fstream_test.cpp
==============================================================================
--- branches/release/libs/filesystem/test/fstream_test.cpp 2010-07-06 07:17:54 EDT (Tue, 06 Jul 2010)
+++ (empty file)
@@ -1,180 +0,0 @@
-// fstream_test.cpp --------------------------------------------------------//
-
-// Copyright Beman Dawes 2002.
-// 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 library home page at http://www.boost.org/libs/filesystem
-
-#include <boost/config/warning_disable.hpp>
-
-// See deprecated_test for tests of deprecated features
-#define BOOST_FILESYSTEM_NO_DEPRECATED
-
-#include <boost/filesystem/fstream.hpp>
-#include <boost/filesystem/operations.hpp>
-#include <string>
-#include <iostream>
-#include <cstdio> // for std::remove
-
-#include "../src/utf8_codecvt_facet.hpp"
-
-#ifndef BOOST_FILESYSTEM_NARROW_ONLY
-# include "lpath.hpp"
-#endif
-
-namespace fs = boost::filesystem;
-
-#include <boost/config.hpp>
-#ifdef BOOST_NO_STDC_NAMESPACE
- namespace std { using ::remove; }
-#endif
-
-#include <boost/detail/lightweight_test.hpp>
-
-namespace
-{
- bool cleanup = true;
-
- template< class Path >
- void test( const Path & p )
- {
-# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle open
- {
- std::cout << " in test 1\n";
- fs::filebuf fb;
- fb.open( p, std::ios_base::in );
- BOOST_TEST( fb.is_open() == fs::exists( p ) );
- }
- {
- std::cout << " in test 2\n";
- fs::filebuf fb1;
- fb1.open( p, std::ios_base::out );
- BOOST_TEST( fb1.is_open() );
- }
- {
- std::cout << " in test 3\n";
- fs::filebuf fb2;
- fb2.open( p, std::ios_base::in );
- BOOST_TEST( fb2.is_open() );
- }
-# else
- std::cout << "<note>\n";
- std::cout <<
- "VC++6.0 does not support boost::filesystem open()\n";
-# endif
- {
- std::cout << " in test 4\n";
- fs::ifstream tfs( p );
- BOOST_TEST( tfs.is_open() );
- }
- {
- std::cout << " in test 4.1\n";
- fs::ifstream tfs( p / p.filename() ); // should fail
- BOOST_TEST( !tfs.is_open() );
- }
- {
- std::cout << " in test 5\n";
- fs::ifstream tfs( p, std::ios_base::in );
- BOOST_TEST( tfs.is_open() );
- }
-# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle open
- {
- std::cout << " in test 6\n";
- fs::ifstream tfs;
- tfs.open( p );
- BOOST_TEST( tfs.is_open() );
- }
- {
- std::cout << " in test 7\n";
- fs::ifstream tfs;
- tfs.open( p, std::ios_base::in );
- BOOST_TEST( tfs.is_open() );
- }
-# endif
- {
- std::cout << " in test 8\n";
- fs::ofstream tfs( p );
- BOOST_TEST( tfs.is_open() );
- }
- {
- std::cout << " in test 9\n";
- fs::ofstream tfs( p, std::ios_base::out );
- BOOST_TEST( tfs.is_open() );
- }
-# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle open
- {
- std::cout << " in test 10\n";
- fs::ofstream tfs;
- tfs.open( p );
- BOOST_TEST( tfs.is_open() );
- }
- {
- std::cout << " in test 11\n";
- fs::ofstream tfs;
- tfs.open( p, std::ios_base::out );
- BOOST_TEST( tfs.is_open() );
- }
-# endif
- {
- std::cout << " in test 12\n";
- fs::fstream tfs( p );
- BOOST_TEST( tfs.is_open() );
- }
- {
- std::cout << " in test 13\n";
- fs::fstream tfs( p, std::ios_base::in|std::ios_base::out );
- BOOST_TEST( tfs.is_open() );
- }
-# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle open
- {
- std::cout << " in test 14\n";
- fs::fstream tfs;
- tfs.open( p );
- BOOST_TEST( tfs.is_open() );
- }
- {
- std::cout << " in test 15\n";
- fs::fstream tfs;
- tfs.open( p, std::ios_base::in|std::ios_base::out );
- BOOST_TEST( tfs.is_open() );
- }
-# endif
-
- if ( cleanup ) fs::remove( p );
-
- } // test
-} // unnamed namespace
-
-int main( int argc, char*[] )
-{
- if ( argc > 1 ) cleanup = false;
-
- // test fs::path
- std::cout << "path tests:\n";
- test( fs::path( "fstream_test_foo" ) );
-
-#ifndef BOOST_FILESYSTEM_NARROW_ONLY
-
- // 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 );
- fs::wpath_traits::imbue( loc );
-
- // test fs::wpath
- // x2780 is circled 1 against white background == e2 9e 80 in UTF-8
- // x2781 is circled 2 against white background == e2 9e 81 in UTF-8
- std::cout << "\nwpath tests:\n";
- test( fs::wpath( L"fstream_test_\x2780" ) );
-
- // test user supplied basic_path
- const long lname[] = { 'f', 's', 'r', 'e', 'a', 'm', '_', 't', 'e', 's',
- 't', '_', 'l', 'p', 'a', 't', 'h', 0 };
- std::cout << "\nlpath tests:\n";
- test( user::lpath( lname ) );
-
-#endif
-
- return ::boost::report_errors();
-}

Deleted: branches/release/libs/filesystem/test/large_file_support_test.cpp
==============================================================================
--- branches/release/libs/filesystem/test/large_file_support_test.cpp 2010-07-06 07:17:54 EDT (Tue, 06 Jul 2010)
+++ (empty file)
@@ -1,36 +0,0 @@
-// Boost large_file_support_test.cpp ---------------------------------------//
-
-// Copyright Beman Dawes 2004.
-// 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 library home page at http://www.boost.org/libs/filesystem
-
-
-// See deprecated_test for tests of deprecated features
-#define BOOST_FILESYSTEM_NO_DEPRECATED
-
-#include <boost/filesystem/operations.hpp>
-namespace fs = boost::filesystem;
-
-#include <iostream>
-
-int main()
-{
- if ( fs::detail::possible_large_file_size_support() )
- {
- std::cout << "It appears that file sizes greater that 2 gigabytes are possible\n"
- "for this configuration on this platform since the operating system\n"
- "does use a large enough integer type to report large file sizes.\n\n"
- "Whether or not such support is actually present depends on the OS\n";
- return 0;
- }
- std::cout << "The operating system is using an integer type to report file sizes\n"
- "that can not represent file sizes greater that 2 gigabytes (31-bits).\n"
- "Thus the Filesystem Library will not correctly deal with such large\n"
- "files. If you think that this operatiing system should be able to\n"
- "support large files, please report the problem to the Boost developers\n"
- "mailing list.\n";
- return 1;
-}

Deleted: branches/release/libs/filesystem/test/lpath.hpp
==============================================================================
--- branches/release/libs/filesystem/test/lpath.hpp 2010-07-06 07:17:54 EDT (Tue, 06 Jul 2010)
+++ (empty file)
@@ -1,101 +0,0 @@
-// Boost lpath.hpp ---------------------------------------------------------//
-
-// Copyright Beman Dawes 2005
-
-// 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 library home page at http://www.boost.org/libs/filesystem
-
-#include <boost/filesystem/path.hpp>
-#include <cwchar> // for std::mbstate_t
-#include <string>
-#include <ios> // for std::streamoff
-
-namespace std
-{
- // Note well: this specialization is meant only to support wide_test.cpp.
- // It is not fully functional, fully correct, or efficient.
- template<> struct char_traits<long>
- {
- typedef long char_type;
- typedef long int_type;
- typedef streamoff off_type;
- typedef streampos pos_type;
- typedef mbstate_t state_type;
- static void assign(char_type& c1, const char_type& c2){c1=c2;}
- static bool eq(const char_type& c1, const char_type& c2){return c1==c2;}
- static bool lt(const char_type& c1, const char_type& c2){return c1<c2;}
- static int compare(const char_type* s1, const char_type* s2, size_t n)
- {
- const char_type* e = s1 + n;
- for ( ;s1 != e && *s1 == *s2; ++s1, ++s2 ) {}
- return s1 == e ? 0 : (*s1<*s2 ? -1 : 1);
- }
- 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*/)
- { return 0; }
-
- // copy semantics will do for wide_test
- static char_type* move(char_type* s1, const char_type* s2, size_t n)
- { char_type* b=s1; for(const char_type* e=s1+n;s1!=e;++s1,++s2) *s1=*s2; return b; }
-
- static char_type* copy(char_type* s1, const char_type* s2, size_t n)
- { char_type* b=s1; for(const char_type* e=s1+n;s1!=e;++s1,++s2) *s1=*s2; return b; }
-
- static char_type* assign(char_type* s, size_t n, char_type a)
- { char_type* b=s; for(char_type* e=s+n;s!=e;++s) *s=a; return b; }
-
- static int_type not_eof(const int_type& c);
- static char_type to_char_type(const int_type& c);
- static int_type to_int_type(const char_type& c);
- static bool eq_int_type(const int_type& c1, const int_type& c2);
- static int_type eof();
- };
-}
-
-namespace user
-{
- typedef std::basic_string<long> lstring;
- struct lpath_traits;
- typedef boost::filesystem::basic_path<lstring, lpath_traits> lpath;
-
- struct lpath_traits
- {
- typedef lstring internal_string_type;
- typedef std::string external_string_type;
-
- static external_string_type to_external( const lpath &,
- const internal_string_type & src )
- {
- external_string_type tmp;
- for ( internal_string_type::const_iterator it( src.begin() );
- it != src.end(); ++it )
- {
- tmp += static_cast<external_string_type::value_type>(*it);
- }
- return tmp;
- }
-
- static internal_string_type to_internal( const external_string_type & src )
- {
- internal_string_type tmp;
- for ( external_string_type::const_iterator it( src.begin() );
- it != src.end(); ++it ) tmp += *it;
- return tmp;
- }
- };
-
-} // namespace user
-
-namespace boost
-{
- namespace filesystem
- {
- template<> struct is_basic_path<user::lpath>
- { static const bool value = true; };
- }
-}

Deleted: branches/release/libs/filesystem/test/operations_test.cpp
==============================================================================
--- branches/release/libs/filesystem/test/operations_test.cpp 2010-07-06 07:17:54 EDT (Tue, 06 Jul 2010)
+++ (empty file)
@@ -1,947 +0,0 @@
-// Boost operations_test.cpp -----------------------------------------------//
-
-// Copyright Beman Dawes 2002.
-
-// Distributed under 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 library home page at http://www.boost.org/libs/filesystem
-
-#include <boost/config/warning_disable.hpp>
-
-// See deprecated_test for tests of deprecated features
-#define BOOST_FILESYSTEM_NO_DEPRECATED
-
-#include <boost/filesystem/operations.hpp>
-#include <boost/filesystem/convenience.hpp>
-#include <boost/cerrno.hpp>
-namespace fs = boost::filesystem;
-
-#include <boost/config.hpp>
-#include <boost/detail/lightweight_test.hpp>
-
-using boost::system::error_code;
-using boost::system::system_category;
-using boost::system::system_error;
-
-#include <fstream>
-#include <iostream>
-#include <string>
-#include <cstring> // for strncmp, etc.
-#include <ctime>
-#include <cstdlib> // for system()
-
-#ifndef BOOST_FILESYSTEM_NARROW_ONLY
-# define BOOST_BND(BOOST_FUNC_TO_DO) BOOST_FUNC_TO_DO<fs::path>
-#else
-# define BOOST_BND(BOOST_FUNC_TO_DO) BOOST_FUNC_TO_DO
-#endif
-
-// VC++ 7.0 and earlier has a serious namespace bug that causes a clash
-// between boost::filesystem::is_empty and the unrelated type trait
-// boost::is_empty.
-#if !defined( BOOST_MSVC ) || BOOST_MSVC > 1300
-# define BOOST_FS_IS_EMPTY fs::is_empty
-#else
-# define BOOST_FS_IS_EMPTY fs::_is_empty
-#endif
-
-# ifdef BOOST_NO_STDC_NAMESPACE
- namespace std { using ::asctime; using ::gmtime; using ::localtime;
- using ::difftime; using ::time; using ::tm; using ::mktime; using ::system; }
-# endif
-
-#ifdef BOOST_WINDOWS_API
-# include <windows.h>
-#endif
-
-#define CHECK_EXCEPTION(Functor,Expect) throws_fs_error(Functor,Expect,__LINE__)
-
-namespace
-{
- typedef int errno_t;
- std::string platform( BOOST_PLATFORM );
- bool report_throws;
- fs::directory_iterator end_itr;
-
- unsigned short language_id; // 0 except for Windows
-
- const char * temp_dir_name = "temp_fs_test_dir";
-
- void create_file( const fs::path & ph, const std::string & contents )
- {
- std::ofstream f( ph.file_string().c_str() );
- if ( !f )
- throw fs::filesystem_error( "operations_test create_file",
- ph, error_code(errno, system_category) );
- if ( !contents.empty() ) f << contents;
- }
-
- void verify_file( const fs::path & ph, const std::string & expected )
- {
- std::ifstream f( ph.file_string().c_str() );
- if ( !f )
- throw fs::filesystem_error( "operations_test verify_file",
- ph, error_code(errno, system_category) );
- std::string contents;
- f >> contents;
- if ( contents != expected )
- throw fs::filesystem_error( "operations_test verify_file contents \""
- + contents + "\" != \"" + expected + "\"", ph, error_code() );
- }
-
- template< typename F >
- bool throws_fs_error( F func, errno_t en, int line )
- {
- try { func(); }
-
- catch ( const fs::filesystem_error & ex )
- {
- if ( report_throws )
- {
- // use the what() convenience function to display exceptions
- std::cout << "\n" << ex.what() << "\n";
- }
- if ( en == 0
- || en == ex.code().default_error_condition().value() ) return true;
- std::cout
- << "\nWarning: line " << line
- << " exception reports default_error_condition().value() " << ex.code().default_error_condition().value()
- << ", should be " << en
- << "\n value() is " << ex.code().value()
- << std::endl;
- return true;
- }
- return false;
- }
-
- // compile-only two argument "do-the-right-thing" tests
- // verifies that all overload combinations compile without error
- void do_not_call()
- {
- fs::path p;
- std::string s;
- const char * a = 0;
- fs::copy_file( p, p );
- fs::copy_file( s, p );
- fs::copy_file( a, p );
- fs::copy_file( p, s );
- fs::copy_file( p, a );
- fs::copy_file( s, s );
- fs::copy_file( a, s );
- fs::copy_file( s, a );
- fs::copy_file( a, a );
- }
-
- void exception_tests()
- {
- bool exception_thrown;
- exception_thrown = false;
- try
- {
- fs::create_directory( "no-such-dir/foo/bar" );
- }
- catch ( std::runtime_error x )
- {
- exception_thrown = true;
- if ( report_throws ) std::cout << x.what() << std::endl;
- if ( platform == "Windows" && language_id == 0x0409 ) // English (United States)
- // the stdcxx standard library apparently appends additional info
- // to what(), so check only the initial portion:
- BOOST_TEST( std::strncmp( x.what(),
- "boost::filesystem::create_directory",
- sizeof("boost::filesystem::create_directory")-1 ) == 0 );
- }
- BOOST_TEST( exception_thrown );
-
- exception_thrown = false;
- try
- {
- fs::create_directory( "no-such-dir/foo/bar" );
- }
- catch ( system_error x )
- {
- exception_thrown = true;
- if ( report_throws ) std::cout << x.what() << std::endl;
- if ( platform == "Windows" && language_id == 0x0409 ) // English (United States)
- BOOST_TEST( std::strcmp( x.what(),
- "boost::filesystem::create_directory: The system cannot find the path specified" ) == 0 );
- }
- BOOST_TEST( exception_thrown );
-
- exception_thrown = false;
- try
- {
- fs::create_directory( "no-such-dir/foo/bar" );
- }
- catch ( fs::filesystem_error x )
- {
- exception_thrown = true;
- if ( report_throws ) std::cout << x.what() << std::endl;
- if ( platform == "Windows" && language_id == 0x0409 ) // English (United States)
- {
- bool ok ( std::strcmp( x.what(),
- "boost::filesystem::create_directory: The system cannot find the path specified: \"no-such-dir\\foo\\bar\"" ) == 0 );
- BOOST_TEST( ok );
- if ( !ok )
- {
- std::cout << "what returns \"" << x.what() << "\"" << std::endl;
- }
- }
- }
- BOOST_TEST( exception_thrown );
-
- exception_thrown = false;
- try
- {
- fs::create_directory( "no-such-dir/foo/bar" );
- }
- catch ( const fs::filesystem_error & x )
- {
- exception_thrown = true;
- if ( report_throws ) std::cout << x.what() << std::endl;
- if ( platform == "Windows" && language_id == 0x0409 ) // English (United States)
- {
- bool ok ( std::strcmp( x.what(),
- "boost::filesystem::create_directory: The system cannot find the path specified: \"no-such-dir\\foo\\bar\"" ) == 0 );
- BOOST_TEST( ok );
- if ( !ok )
- {
- std::cout << "what returns \"" << x.what() << "\"" << std::endl;
- }
- }
- }
- BOOST_TEST( exception_thrown );
- }
-
- void bad_file_size()
- {
- fs::file_size( " No way, Jose" );
- }
-
- void bad_directory_size()
- {
- fs::file_size( fs::current_path<fs::path>() );
- }
-
- fs::path bad_create_directory_path;
- void bad_create_directory()
- {
- fs::create_directory( bad_create_directory_path );
- }
-
- void bad_equivalent()
- {
- fs::equivalent( "no-such-path", "another-not-present-path" );
- }
-
- fs::path bad_remove_dir;
- void bad_remove()
- {
- fs::remove( bad_remove_dir );
- }
-
- class renamer
- {
- public:
- renamer( const fs::path & p1, const fs::path & p2 )
- : from(p1), to(p2) {}
- void operator()()
- {
- fs::rename( from, to );
- }
- private:
- fs::path from;
- fs::path to;
- };
-
-} // unnamed namespace
-
-// main ------------------------------------------------------------------------------//
-
-int main( int argc, char * argv[] )
-{
- if ( argc > 1 && *argv[1]=='-' && *(argv[1]+1)=='t' ) report_throws = true;
-
- // The choice of platform is make at runtime rather than compile-time
- // so that compile errors for all platforms will be detected even though
- // only the current platform is runtime tested.
-# if defined( BOOST_POSIX_API )
- platform = "POSIX";
-# elif defined( BOOST_WINDOWS_API )
- platform = "Windows";
-# if !defined(__MINGW32__) && !defined(__CYGWIN__)
- language_id = ::GetUserDefaultUILanguage();
-# else
- language_id = 0x0409; // Assume US English
-# endif
-# else
- platform = ( platform == "Win32" || platform == "Win64" || platform == "Cygwin" )
- ? "Windows"
- : "POSIX";
-# endif
- std::cout << "API is " << platform << std::endl;
-
- exception_tests();
-
- std::cout << "\ninitial_path<path>().string() is\n \""
- << fs::initial_path<fs::path>().string()
- << "\"\n";
- std::cout << "\ninitial_path<fs::path>().file_string() is\n \""
- << fs::initial_path<fs::path>().file_string()
- << "\"\n\n";
- BOOST_TEST( fs::initial_path<fs::path>().is_complete() );
- BOOST_TEST( fs::current_path<fs::path>().is_complete() );
- BOOST_TEST( fs::initial_path<fs::path>().string()
- == fs::current_path<fs::path>().string() );
-
- BOOST_TEST( fs::complete( "" ).empty() );
- BOOST_TEST( fs::complete( "/" ).string() == fs::initial_path<fs::path>().root_path().string() );
- BOOST_TEST( fs::complete( "foo" ).string() == fs::initial_path<fs::path>().string()+"/foo" );
- BOOST_TEST( fs::complete( "/foo" ).string() == fs::initial_path<fs::path>().root_path().string()+"foo" );
- BOOST_TEST( fs::complete( "foo", fs::path( "//net/bar" ) ).string()
- == "//net/bar/foo" );
-
- // predicate and status tests
- BOOST_TEST( fs::exists( "/" ) );
- fs::path ng( " no-way, Jose" );
- BOOST_TEST( !fs::exists( ng ) );
- BOOST_TEST( !fs::is_directory( ng ) );
- BOOST_TEST( !fs::is_regular_file( ng ) );
- BOOST_TEST( !fs::is_symlink( ng ) );
- fs::file_status stat( fs::status( ng ) );
- BOOST_TEST( fs::status_known( stat ) );
- BOOST_TEST( !fs::exists( stat ) );
- BOOST_TEST( !fs::is_directory( stat ) );
- BOOST_TEST( !fs::is_regular_file( stat ) );
- BOOST_TEST( !fs::is_other( stat ) );
- BOOST_TEST( !fs::is_symlink( stat ) );
- stat = fs::status( "" );
- BOOST_TEST( fs::status_known( stat ) );
- BOOST_TEST( !fs::exists( stat ) );
- BOOST_TEST( !fs::is_directory( stat ) );
- BOOST_TEST( !fs::is_regular_file( stat ) );
- BOOST_TEST( !fs::is_other( stat ) );
- BOOST_TEST( !fs::is_symlink( stat ) );
-
- fs::path dir( fs::initial_path<fs::path>() / temp_dir_name );
-
- if ( fs::exists( dir ) )
- fs::remove_all( dir ); // remove residue from prior failed tests
- BOOST_TEST( !fs::exists( dir ) );
-
- // create a directory, then check it for consistency
- // take extra care to report problems, since if this fails
- // many subsequent tests will fail
- try
- {
- fs::create_directory( dir );
- }
-
- catch ( const fs::filesystem_error & x )
- {
- std::cout << x.what() << "\n\n"
- "***** Creating directory " << dir.string() << " failed. *****\n"
- "***** This is a serious error that will prevent further tests *****\n"
- "***** from returning useful results. Further testing is aborted. *****\n\n";
- return 1;
- }
-
- catch ( ... )
- {
- std::cout << "\n\n"
- "***** Creating directory " << dir.string() << " failed. *****\n"
- "***** This is a serious error that will prevent further tests *****\n"
- "***** from returning useful results. Further testing is aborted. *****\n\n";
- return 1;
- }
-
- BOOST_TEST( fs::exists( dir ) );
- BOOST_TEST( BOOST_FS_IS_EMPTY( dir ) );
- BOOST_TEST( fs::is_directory( dir ) );
- BOOST_TEST( !fs::is_regular_file( dir ) );
- BOOST_TEST( !fs::is_other( dir ) );
- BOOST_TEST( !fs::is_symlink( dir ) );
- stat = fs::status( dir );
- BOOST_TEST( fs::exists( stat ) );
- BOOST_TEST( fs::is_directory( stat ) );
- BOOST_TEST( !fs::is_regular_file( stat ) );
- BOOST_TEST( !fs::is_other( stat ) );
- BOOST_TEST( !fs::is_symlink( stat ) );
-
- // Windows only tests
- if ( platform == "Windows" )
- {
- BOOST_TEST( !fs::exists( fs::path( "//share-not" ) ) );
- BOOST_TEST( !fs::exists( fs::path( "//share-not/" ) ) );
- BOOST_TEST( !fs::exists( fs::path( "//share-not/foo" ) ) );
- BOOST_TEST( !fs::exists( "tools/jam/src/:sys:stat.h" ) ); // !exists() if ERROR_INVALID_NAME
- BOOST_TEST( !fs::exists( ":sys:stat.h" ) ); // !exists() if ERROR_INVALID_PARAMETER
- BOOST_TEST( !fs::exists( "1:/" ) );
- BOOST_TEST( dir.string().size() > 1
- && dir.string()[1] == ':' ); // verify path includes drive
-
- BOOST_TEST( fs::system_complete( "" ).empty() );
- BOOST_TEST( fs::system_complete( "/" ).string()
- == fs::initial_path<fs::path>().root_path().string() );
- BOOST_TEST( fs::system_complete( "foo" ).string()
- == fs::initial_path<fs::path>().string()+"/foo" );
- BOOST_TEST( fs::system_complete( "/foo" ).string()
- == fs::initial_path<fs::path>().root_path().string()+"foo" );
- BOOST_TEST( fs::complete( fs::path( "c:/" ) ).string()
- == "c:/" );
- BOOST_TEST( fs::complete( fs::path( "c:/foo" ) ).string()
- == "c:/foo" );
-
- BOOST_TEST( fs::system_complete( fs::path( fs::initial_path<fs::path>().root_name() ) ).string() == fs::initial_path<fs::path>().string() );
- BOOST_TEST( fs::system_complete( fs::path( fs::initial_path<fs::path>().root_name()
- + "foo" ) ).string() == fs::initial_path<fs::path>().string()+"/foo" );
- BOOST_TEST( fs::system_complete( fs::path( "c:/" ) ).string()
- == "c:/" );
- BOOST_TEST( fs::system_complete( fs::path( "c:/foo" ) ).string()
- == "c:/foo" );
- BOOST_TEST( fs::system_complete( fs::path( "//share" ) ).string()
- == "//share" );
- } // Windows
-
- else if ( platform == "POSIX" )
- {
- BOOST_TEST( fs::system_complete( "" ).empty() );
- BOOST_TEST( fs::initial_path<fs::path>().root_path().string() == "/" );
- BOOST_TEST( fs::system_complete( "/" ).string() == "/" );
- BOOST_TEST( fs::system_complete( "foo" ).string()
- == fs::initial_path<fs::path>().string()+"/foo" );
- BOOST_TEST( fs::system_complete( "/foo" ).string()
- == fs::initial_path<fs::path>().root_path().string()+"foo" );
- } // POSIX
-
- // the bound functions should throw, so CHECK_EXCEPTION() should return true
- BOOST_TEST( CHECK_EXCEPTION( bad_file_size, ENOENT ) );
-
- // test path::exception members
- try { fs::file_size( ng ); } // will throw
-
- catch ( const fs::filesystem_error & ex )
- {
- BOOST_TEST( ex.path1().string() == " no-way, Jose" );
- }
- // several functions give unreasonable results if uintmax_t isn't 64-bits
- std::cout << "sizeof(boost::uintmax_t) = " << sizeof(boost::uintmax_t) << '\n';
- BOOST_TEST( sizeof( boost::uintmax_t ) >= 8 );
-
- // set the current directory, then check it for consistency
- fs::path original_dir = fs::current_path<fs::path>();
- BOOST_TEST( dir != original_dir );
- fs::current_path( dir );
- BOOST_TEST( fs::current_path<fs::path>() == dir );
- BOOST_TEST( fs::current_path<fs::path>() != original_dir );
- fs::current_path( original_dir );
- BOOST_TEST( fs::current_path<fs::path>() == original_dir );
- BOOST_TEST( fs::current_path<fs::path>() != dir );
- // make sure the overloads work
- fs::current_path( dir.string().c_str() );
- BOOST_TEST( fs::current_path<fs::path>() == dir );
- BOOST_TEST( fs::current_path<fs::path>() != original_dir );
- fs::current_path( original_dir.string() );
- BOOST_TEST( fs::current_path<fs::path>() == original_dir );
- BOOST_TEST( fs::current_path<fs::path>() != dir );
-
- // make some reasonable assuptions for testing purposes
- fs::space_info spi( fs::space( dir ) );
- BOOST_TEST( spi.capacity > 1000000 );
- BOOST_TEST( spi.free > 1000 );
- BOOST_TEST( spi.capacity > spi.free );
- BOOST_TEST( spi.free >= spi.available );
-
- // it is convenient to display space, but older VC++ versions choke
-# if !defined(BOOST_MSVC) || _MSC_VER >= 1300 // 1300 == VC++ 7.0
- std::cout << " capacity = " << spi.capacity << '\n';
- std::cout << " free = " << spi.free << '\n';
- std::cout << "available = " << spi.available << '\n';
-# endif
-
- if ( platform == "Windows" )
- BOOST_TEST( CHECK_EXCEPTION( bad_directory_size, ENOENT ) );
- else
- BOOST_TEST( CHECK_EXCEPTION( bad_directory_size, 0 ) );
- BOOST_TEST( !fs::create_directory( dir ) );
-
- BOOST_TEST( !fs::is_symlink( dir ) );
- BOOST_TEST( !fs::is_symlink( "nosuchfileordirectory" ) );
-
- fs::path d1( dir / "d1" );
- BOOST_TEST( fs::create_directory( d1 ) );
- BOOST_TEST( fs::exists( d1 ) );
- BOOST_TEST( fs::is_directory( d1 ) );
- BOOST_TEST( BOOST_FS_IS_EMPTY( d1 ) );
-
-// boost::function_requires< boost::InputIteratorConcept< fs::directory_iterator > >();
-
- bool dir_itr_exception(false);
- try { fs::directory_iterator it( "" ); }
- catch ( const fs::filesystem_error & ) { dir_itr_exception = true; }
- BOOST_TEST( dir_itr_exception );
-
- dir_itr_exception = false;
- try { fs::directory_iterator it( "nosuchdirectory" ); }
- catch ( const fs::filesystem_error & ) { dir_itr_exception = true; }
- BOOST_TEST( dir_itr_exception );
-
- dir_itr_exception = false;
- try
- {
- error_code ec;
- fs::directory_iterator it( "nosuchdirectory", ec );
- BOOST_TEST( ec );
- BOOST_TEST( ec == fs::detail::not_found_error() );
- }
- catch ( const fs::filesystem_error & ) { dir_itr_exception = true; }
- BOOST_TEST( !dir_itr_exception );
-
- {
- // probe query function overloads
- fs::directory_iterator dir_itr( dir );
- BOOST_TEST( fs::is_directory( *dir_itr ) );
- BOOST_TEST( fs::is_directory( dir_itr->status() ) );
- BOOST_TEST( fs::is_directory( fs::symlink_status(*dir_itr) ) );
- BOOST_TEST( fs::is_directory( dir_itr->symlink_status() ) );
- BOOST_TEST( dir_itr->path().filename() == "d1" );
- }
-
- // create a second directory named d2
- fs::path d2( dir / "d2" );
- fs::create_directory(d2 );
- BOOST_TEST( fs::exists( d2 ) );
- BOOST_TEST( fs::is_directory( d2 ) );
-
- // test the basic operation of directory_iterators, and test that
- // stepping one iterator doesn't affect a different iterator.
- {
- fs::directory_iterator dir_itr( dir );
- BOOST_TEST( fs::exists(dir_itr->status()) );
- BOOST_TEST( fs::is_directory(dir_itr->status()) );
- BOOST_TEST( !fs::is_regular_file(dir_itr->status()) );
- BOOST_TEST( !fs::is_other(dir_itr->status()) );
- BOOST_TEST( !fs::is_symlink(dir_itr->status()) );
-
- fs::directory_iterator dir_itr2( dir );
- BOOST_TEST( dir_itr->path().filename() == "d1"
- || dir_itr->path().filename() == "d2" );
- BOOST_TEST( dir_itr2->path().filename() == "d1" || dir_itr2->path().filename() == "d2" );
- if ( dir_itr->path().filename() == "d1" )
- {
- BOOST_TEST( (++dir_itr)->path().filename() == "d2" );
- BOOST_TEST( dir_itr2->path().filename() == "d1" );
- BOOST_TEST( (++dir_itr2)->path().filename() == "d2" );
- }
- else
- {
- BOOST_TEST( dir_itr->path().filename() == "d2" );
- BOOST_TEST( (++dir_itr)->path().filename() == "d1" );
- BOOST_TEST( (dir_itr2)->path().filename() == "d2" );
- BOOST_TEST( (++dir_itr2)->path().filename() == "d1" );
- }
- BOOST_TEST( ++dir_itr == fs::directory_iterator() );
- BOOST_TEST( dir_itr2 != fs::directory_iterator() );
- BOOST_TEST( ++dir_itr2 == fs::directory_iterator() );
- }
-
- { // *i++ must work to meet the standard's InputIterator requirements
- fs::directory_iterator dir_itr( dir );
- BOOST_TEST( dir_itr->path().filename() == "d1"
- || dir_itr->path().filename() == "d2" );
- if ( dir_itr->path().filename() == "d1" )
- {
- BOOST_TEST( (*dir_itr++).path().filename() == "d1" );
- BOOST_TEST( dir_itr->path().filename() == "d2" );
- }
- else
- {
- // Check C++98 input iterator requirements
- BOOST_TEST( (*dir_itr++).path().filename() == "d2" );
- // input iterator requirements in the current WP would require this check:
- // BOOST_TEST( implicit_cast<std::string const&>(*dir_itr++).filename() == "d1" );
-
- BOOST_TEST( dir_itr->path().filename() == "d1" );
- }
-
- // test case reported in comment to SourceForge bug tracker [937606]
- fs::directory_iterator it( dir );
- const fs::path p1 = *it++;
- BOOST_TEST( it != fs::directory_iterator() );
- const fs::path p2 = *it++;
- BOOST_TEST( p1 != p2 );
- BOOST_TEST( it == fs::directory_iterator() );
- }
-
- // Windows has a tricky special case when just the root-name is given,
- // causing the rest of the path to default to the current directory.
- // Reported as S/F bug [ 1259176 ]
- if ( platform == "Windows" )
- {
- fs::path root_name_path( fs::current_path<fs::path>().root_name() );
- fs::directory_iterator it( root_name_path );
- BOOST_TEST( it != fs::directory_iterator() );
- BOOST_TEST( fs::exists( *it ) );
- BOOST_TEST( it->path().parent_path() == root_name_path );
- bool found(false);
- do
- {
- if ( it->path().filename() == temp_dir_name ) found = true;
- } while ( ++it != fs::directory_iterator() );
- BOOST_TEST( found );
- }
-
- // create an empty file named "f0"
- fs::path file_ph( dir / "f0");
- create_file( file_ph, "" );
- BOOST_TEST( fs::exists( file_ph ) );
- BOOST_TEST( !fs::is_directory( file_ph ) );
- BOOST_TEST( fs::is_regular_file( file_ph ) );
- BOOST_TEST( BOOST_FS_IS_EMPTY( file_ph ) );
- BOOST_TEST( fs::file_size( file_ph ) == 0 );
- bad_create_directory_path = file_ph;
- BOOST_TEST( CHECK_EXCEPTION( bad_create_directory, EEXIST ) );
- stat = fs::status( file_ph );
- BOOST_TEST( fs::status_known( stat ) );
- BOOST_TEST( fs::exists( stat ) );
- BOOST_TEST( !fs::is_directory( stat ) );
- BOOST_TEST( fs::is_regular_file( stat ) );
- BOOST_TEST( !fs::is_other( stat ) );
- BOOST_TEST( !fs::is_symlink( stat ) );
-
- // create a file named "f1"
- file_ph = dir / "f1";
- create_file( file_ph, "foobar1" );
-
- BOOST_TEST( fs::exists( file_ph ) );
- BOOST_TEST( !fs::is_directory( file_ph ) );
- BOOST_TEST( fs::is_regular_file( file_ph ) );
- BOOST_TEST( fs::file_size( file_ph ) == 7 );
- verify_file( file_ph, "foobar1" );
-
- // equivalence tests
- BOOST_TEST( CHECK_EXCEPTION( bad_equivalent, ENOENT ) );
- BOOST_TEST( fs::equivalent( file_ph, dir / "f1" ) );
- BOOST_TEST( fs::equivalent( dir, d1 / ".." ) );
- BOOST_TEST( !fs::equivalent( file_ph, dir ) );
- BOOST_TEST( !fs::equivalent( dir, file_ph ) );
- BOOST_TEST( !fs::equivalent( d1, d2 ) );
- BOOST_TEST( !fs::equivalent( dir, ng ) );
- BOOST_TEST( !fs::equivalent( ng, dir ) );
- BOOST_TEST( !fs::equivalent( file_ph, ng ) );
- BOOST_TEST( !fs::equivalent( ng, file_ph ) );
-
- // hard link tests
- fs::path from_ph( dir / "f3" );
- BOOST_TEST( !fs::exists( from_ph ) );
- BOOST_TEST( fs::exists( file_ph ) );
- bool create_hard_link_ok(true);
- try { fs::create_hard_link( file_ph, from_ph ); }
- catch ( const fs::filesystem_error & ex )
- {
- create_hard_link_ok = false;
- std::cout
- << "create_hard_link() attempt failed\n"
- << "filesystem_error.what() reports: " << ex.what() << '\n'
- << "create_hard_link() may not be supported on this file system\n";
- }
-
- if ( create_hard_link_ok )
- {
- std::cout << "create_hard_link(\"" << file_ph << "\", \""
- << from_ph << "\") succeeded\n";
- BOOST_TEST( fs::exists( from_ph ) );
- BOOST_TEST( fs::exists( file_ph ) );
- BOOST_TEST( fs::equivalent( from_ph, file_ph ) );
- }
-
- error_code ec;
- BOOST_TEST( fs::create_hard_link( fs::path("doesnotexist"),
- fs::path("shouldnotwork"), ec ) );
- BOOST_TEST( ec );
-
- // symbolic link tests
- from_ph = dir / "f4";
- BOOST_TEST( !fs::exists( from_ph ) );
- BOOST_TEST( fs::exists( file_ph ) );
- bool create_symlink_ok(true);
- try { fs::create_symlink( file_ph, from_ph ); }
- catch ( const fs::filesystem_error & ex )
- {
- create_symlink_ok = false;
- std::cout
- << "create_symlink() attempt failed\n"
- << "filesystem_error.what() reports: " << ex.what() << '\n'
- << "create_symlink() may not be supported on this file system\n";
- }
-
- if ( create_symlink_ok )
- {
- std::cout << "create_symlink() succeeded\n";
- BOOST_TEST( fs::exists( from_ph ) );
- BOOST_TEST( fs::is_symlink( from_ph ) );
- BOOST_TEST( fs::exists( file_ph ) );
- BOOST_TEST( fs::equivalent( from_ph, file_ph ) );
- stat = fs::symlink_status( from_ph );
- BOOST_TEST( fs::exists( stat ) );
- BOOST_TEST( !fs::is_directory( stat ) );
- BOOST_TEST( !fs::is_regular_file( stat ) );
- BOOST_TEST( !fs::is_other( stat ) );
- BOOST_TEST( fs::is_symlink( stat ) );
- }
-
- ec = error_code();
- BOOST_TEST( fs::create_symlink( "doesnotexist", "", ec ) );
- BOOST_TEST( ec );
-
- // there was an inital bug in directory_iterator that caused premature
- // close of an OS handle. This block will detect regression.
- {
- fs::directory_iterator di;
- { di = fs::directory_iterator( dir ); }
- BOOST_TEST( ++di != fs::directory_iterator() );
- }
-
- // copy_file() tests
- std::cout << "begin copy_file test..." << std::endl;
- fs::copy_file( file_ph, d1 / "f2" );
- std::cout << "copying complete" << std::endl;
- BOOST_TEST( fs::exists( file_ph ) );
- BOOST_TEST( fs::exists( d1 / "f2" ) );
- BOOST_TEST( !fs::is_directory( d1 / "f2" ) );
- verify_file( d1 / "f2", "foobar1" );
-
- bool copy_ex_ok = false;
- try { fs::copy_file( file_ph, d1 / "f2" ); }
- catch ( const fs::filesystem_error & ) { copy_ex_ok = true; }
- BOOST_TEST( copy_ex_ok );
-
- copy_ex_ok = false;
- try { fs::copy_file( file_ph, d1 / "f2", fs::copy_option::fail_if_exists ); }
- catch ( const fs::filesystem_error & ) { copy_ex_ok = true; }
- BOOST_TEST( copy_ex_ok );
-
- copy_ex_ok = true;
- try { fs::copy_file( file_ph, d1 / "f2", fs::copy_option::overwrite_if_exists ); }
- catch ( const fs::filesystem_error & ) { copy_ex_ok = false; }
- BOOST_TEST( copy_ex_ok );
-
- std::cout << "copy_file test complete" << std::endl;
-
- // rename() test case numbers refer to operations.htm#rename table
-
- // [case 1] make sure can't rename() a non-existent file
- BOOST_TEST( !fs::exists( d1 / "f99" ) );
- BOOST_TEST( !fs::exists( d1 / "f98" ) );
- renamer n1a( d1 / "f99", d1 / "f98" );
- BOOST_TEST( CHECK_EXCEPTION( n1a, ENOENT ) );
- renamer n1b( fs::path(""), d1 / "f98" );
- BOOST_TEST( CHECK_EXCEPTION( n1b, ENOENT ) );
-
- // [case 2] rename() target.empty()
- renamer n2( file_ph, "" );
- BOOST_TEST( CHECK_EXCEPTION( n2, ENOENT ) );
-
- // [case 3] make sure can't rename() to an existent file or directory
- BOOST_TEST( fs::exists( dir / "f1" ) );
- BOOST_TEST( fs::exists( d1 / "f2" ) );
- renamer n3a( dir / "f1", d1 / "f2" );
- BOOST_TEST( CHECK_EXCEPTION( n3a, EEXIST ) );
- // several POSIX implementations (cygwin, openBSD) report ENOENT instead of EEXIST,
- // so we don't verify error type on the above test.
- renamer n3b( dir, d1 );
- BOOST_TEST( CHECK_EXCEPTION( n3b, 0 ) );
-
- // [case 4A] can't rename() file to a nonexistent parent directory
- BOOST_TEST( !fs::is_directory( dir / "f1" ) );
- BOOST_TEST( !fs::exists( dir / "d3/f3" ) );
- renamer n4a( dir / "f1", dir / "d3/f3" );
- BOOST_TEST( CHECK_EXCEPTION( n4a, ENOENT ) );
-
- // [case 4B] rename() file in same directory
- BOOST_TEST( fs::exists( d1 / "f2" ) );
- BOOST_TEST( !fs::exists( d1 / "f50" ) );
- fs::rename( d1 / "f2", d1 / "f50" );
- BOOST_TEST( !fs::exists( d1 / "f2" ) );
- BOOST_TEST( fs::exists( d1 / "f50" ) );
- fs::rename( d1 / "f50", d1 / "f2" );
- BOOST_TEST( fs::exists( d1 / "f2" ) );
- BOOST_TEST( !fs::exists( d1 / "f50" ) );
-
- // [case 4C] rename() file d1/f2 to d2/f3
- fs::rename( d1 / "f2", d2 / "f3" );
- BOOST_TEST( !fs::exists( d1 / "f2" ) );
- BOOST_TEST( !fs::exists( d2 / "f2" ) );
- BOOST_TEST( fs::exists( d2 / "f3" ) );
- BOOST_TEST( !fs::is_directory( d2 / "f3" ) );
- verify_file( d2 / "f3", "foobar1" );
- fs::rename( d2 / "f3", d1 / "f2" );
- BOOST_TEST( fs::exists( d1 / "f2" ) );
-
- // [case 5A] rename() directory to nonexistent parent directory
- BOOST_TEST( fs::exists( d1 ) );
- BOOST_TEST( !fs::exists( dir / "d3/d5" ) );
- BOOST_TEST( !fs::exists( dir / "d3" ) );
- renamer n5a( d1, dir / "d3/d5" );
- BOOST_TEST( CHECK_EXCEPTION( n5a, ENOENT ) );
-
- // [case 5B] rename() on directory
- fs::path d3( dir / "d3" );
- BOOST_TEST( fs::exists( d1 ) );
- BOOST_TEST( fs::exists( d1 / "f2" ) );
- BOOST_TEST( !fs::exists( d3 ) );
- fs::rename( d1, d3 );
- BOOST_TEST( !fs::exists( d1 ) );
- BOOST_TEST( fs::exists( d3 ) );
- BOOST_TEST( fs::is_directory( d3 ) );
- BOOST_TEST( !fs::exists( d1 / "f2" ) );
- BOOST_TEST( fs::exists( d3 / "f2" ) );
- fs::rename( d3, d1 );
- BOOST_TEST( fs::exists( d1 ) );
- BOOST_TEST( fs::exists( d1 / "f2" ) );
- BOOST_TEST( !fs::exists( d3 ) );
-
- // [case 5C] rename() rename and move d1 to d2 / "d20"
- BOOST_TEST( fs::exists( d1 ) );
- BOOST_TEST( !fs::exists( d2 / "d20" ) );
- BOOST_TEST( fs::exists( d1 / "f2" ) );
- fs::rename( d1, d2 / "d20" );
- BOOST_TEST( !fs::exists( d1 ) );
- BOOST_TEST( fs::exists( d2 / "d20" ) );
- BOOST_TEST( fs::exists( d2 / "d20" / "f2" ) );
- fs::rename( d2 / "d20", d1 );
- BOOST_TEST( fs::exists( d1 ) );
- BOOST_TEST( !fs::exists( d2 / "d20" ) );
- BOOST_TEST( fs::exists( d1 / "f2" ) );
-
- // remove() file
- file_ph = dir / "shortlife";
- BOOST_TEST( !fs::exists( file_ph ) );
- create_file( file_ph, "" );
- BOOST_TEST( fs::exists( file_ph ) );
- BOOST_TEST( !fs::is_directory( file_ph ) );
- BOOST_TEST( fs::remove( file_ph ) );
- BOOST_TEST( !fs::exists( file_ph ) );
- BOOST_TEST( !fs::remove( "no-such-file" ) );
- BOOST_TEST( !fs::remove( "no-such-directory/no-such-file" ) );
-
- // remove() directory
- d1 = dir / "shortlife_dir";
- BOOST_TEST( !fs::exists( d1 ) );
- fs::create_directory( d1 );
- BOOST_TEST( fs::exists( d1 ) );
- BOOST_TEST( fs::is_directory( d1 ) );
- BOOST_TEST( BOOST_FS_IS_EMPTY( d1 ) );
- bad_remove_dir = dir;
- BOOST_TEST( CHECK_EXCEPTION( bad_remove, ENOTEMPTY ) );
- BOOST_TEST( fs::remove( d1 ) );
- BOOST_TEST( !fs::exists( d1 ) );
-
- if ( create_symlink_ok ) // only if symlinks supported
- {
- // remove() dangling symbolic link
- fs::path link( "dangling_link" );
- fs::remove( link ); // remove any residue from past tests
- BOOST_TEST( !fs::is_symlink( link ) );
- BOOST_TEST( !fs::exists( link ) );
- fs::create_symlink( "nowhere", link );
- BOOST_TEST( !fs::exists( link ) );
- BOOST_TEST( fs::is_symlink( link ) );
- BOOST_TEST( fs::remove( link ) );
- BOOST_TEST( !fs::is_symlink( link ) );
-
- // remove() self-refering symbolic link
- link = "link_to_self";
- fs::remove( link ); // remove any residue from past tests
- BOOST_TEST( !fs::is_symlink( link ) );
- BOOST_TEST( !fs::exists( link ) );
- fs::create_symlink( link, link );
- BOOST_TEST( fs::remove( link ) );
- BOOST_TEST( !fs::exists( link ) );
- BOOST_TEST( !fs::is_symlink( link ) );
-
- // remove() cyclic symbolic link
- link = "link_to_a";
- fs::path link2( "link_to_b" );
- fs::remove( link ); // remove any residue from past tests
- fs::remove( link2 ); // remove any residue from past tests
- BOOST_TEST( !fs::is_symlink( link ) );
- BOOST_TEST( !fs::exists( link ) );
- fs::create_symlink( link, link2 );
- fs::create_symlink( link2, link );
- BOOST_TEST( fs::remove( link ) );
- BOOST_TEST( fs::remove( link2 ) );
- BOOST_TEST( !fs::exists( link ) );
- BOOST_TEST( !fs::exists( link2 ) );
- BOOST_TEST( !fs::is_symlink( link ) );
-
- // remove() symbolic link to file
- file_ph = "link_target";
- fs::remove( file_ph ); // remove any residue from past tests
- BOOST_TEST( !fs::exists( file_ph ) );
- create_file( file_ph, "" );
- BOOST_TEST( fs::exists( file_ph ) );
- BOOST_TEST( !fs::is_directory( file_ph ) );
- BOOST_TEST( fs::is_regular_file( file_ph ) );
- link = "non_dangling_link";
- fs::create_symlink( file_ph, link );
- BOOST_TEST( fs::exists( link ) );
- BOOST_TEST( !fs::is_directory( link ) );
- BOOST_TEST( fs::is_regular_file( link ) );
- BOOST_TEST( fs::is_symlink( link ) );
- BOOST_TEST( fs::remove( link ) );
- BOOST_TEST( fs::exists( file_ph ) );
- BOOST_TEST( !fs::exists( link ) );
- BOOST_TEST( !fs::is_symlink( link ) );
- BOOST_TEST( fs::remove( file_ph ) );
- BOOST_TEST( !fs::exists( file_ph ) );
- }
-
- // write time tests
-
- file_ph = dir / "foobar2";
- create_file( file_ph, "foobar2" );
- BOOST_TEST( fs::exists( file_ph ) );
- BOOST_TEST( !fs::is_directory( file_ph ) );
- BOOST_TEST( fs::is_regular_file( file_ph ) );
- BOOST_TEST( fs::file_size( file_ph ) == 7 );
- verify_file( file_ph, "foobar2" );
-
- // Some file system report last write time as local (FAT), while
- // others (NTFS) report it as UTC. The C standard does not specify
- // if time_t is local or UTC.
-
- std::time_t ft = fs::last_write_time( file_ph );
- std::cout << "\nUTC last_write_time() for a file just created is "
- << std::asctime(std::gmtime(&ft)) << std::endl;
-
- std::tm * tmp = std::localtime( &ft );
- std::cout << "\nYear is " << tmp->tm_year << std::endl;
- --tmp->tm_year;
- std::cout << "Change year to " << tmp->tm_year << std::endl;
- fs::last_write_time( file_ph, std::mktime( tmp ) );
- std::time_t ft2 = fs::last_write_time( file_ph );
- std::cout << "last_write_time() for the file is now "
- << std::asctime(std::gmtime(&ft2)) << std::endl;
- BOOST_TEST( ft != fs::last_write_time( file_ph ) );
-
-
- std::cout << "\nReset to current time" << std::endl;
- fs::last_write_time( file_ph, ft );
- double time_diff = std::difftime( ft, fs::last_write_time( file_ph ) );
- std::cout
- << "original last_write_time() - current last_write_time() is "
- << time_diff << " seconds" << std::endl;
- BOOST_TEST( time_diff >= -60.0 && time_diff <= 60.0 );
-
- // post-test cleanup
- BOOST_TEST( fs::remove_all( dir ) != 0 );
- // above was added just to simplify testing, but it ended up detecting
- // a bug (failure to close an internal search handle).
- BOOST_TEST( !fs::exists( dir ) );
- BOOST_TEST( fs::remove_all( dir ) == 0 );
-
- return ::boost::report_errors();
-} // main
-

Deleted: branches/release/libs/filesystem/test/path_test.cpp
==============================================================================
--- branches/release/libs/filesystem/test/path_test.cpp 2010-07-06 07:17:54 EDT (Tue, 06 Jul 2010)
+++ (empty file)
@@ -1,1370 +0,0 @@
-// path_test program -------------------------------------------------------//
-
-// Copyright Beman Dawes 2002
-// Copyright Vladimir Prus 2002
-
-// 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 library home page at http://www.boost.org/libs/filesystem
-
-// basic_path's stem(), extension(), and replace_extension() tests are based
-// on basename(), extension(), and change_extension() tests from the original
-// convenience_test.cpp by Vladimir Prus.
-
-// See deprecated_test for tests of deprecated features
-#define BOOST_FILESYSTEM_NO_DEPRECATED
-
-#include <boost/filesystem/operations.hpp>
-#include <boost/utility.hpp>
-#include <iostream>
-#include <sstream>
-#include <string>
-#include <vector>
-#include <cstring>
-#include <cassert>
-
-namespace fs = boost::filesystem;
-using boost::filesystem::path;
-
-
-#include <boost/detail/lightweight_test.hpp>
-
-#define PATH_CHECK( a, b ) check( a, b, __LINE__ )
-#define DIR_CHECK( a, b ) check_dir( a, b, __LINE__ )
-#define CHECK_EQUAL( a,b ) check_equal( a, b, __LINE__ )
-
-
-namespace
-{
- std::string platform( BOOST_PLATFORM );
-
- void check( const fs::path & source,
- const std::string & expected, int line )
- {
- if ( source.string()== expected ) return;
-
- ++::boost::detail::test_errors();
-
- std::cout << '(' << line << ") source.string(): \"" << source.string()
- << "\" != expected: \"" << expected
- << "\"" << std::endl;
- }
-
- void check_dir( const fs::path & source,
- const std::string & expected, int line )
- {
- if ( source.directory_string()== expected ) return;
-
- ++::boost::detail::test_errors();
-
- std::cout << '(' << line << ") source.directory_string(): \""
- << source.directory_string()
- << "\" != expected: \"" << expected
- << "\"" << std::endl;
- }
-
- void check_equal( const std::string & value,
- const std::string & expected, int line )
- {
- if ( value == expected ) return;
-
- ++::boost::detail::test_errors();
-
- std::cout << '(' << line << ") value: \"" << value
- << "\" != expected: \"" << expected
- << "\"" << std::endl;
- }
-
-
- void exception_tests()
- {
- const std::string str_1("string-1");
- boost::system::error_code ec( 12345, boost::system::system_category);
- try { throw fs::filesystem_error( str_1, ec ); }
- catch ( const fs::filesystem_error & ex )
- {
- //std::cout << ex.what() << "*" << std::endl;
- //BOOST_TEST( std::strcmp( ex.what(),
- // "string-1: Unknown error" ) == 0 );
- BOOST_TEST( ex.code() == ec );
- }
-
- try { throw fs::filesystem_error( str_1, "p1", "p2", ec ); }
- catch ( const fs::filesystem_error & ex )
- {
- //std::cout << ex.what() << "*" << std::endl;
- //BOOST_TEST( std::strcmp( ex.what(),
- // "string-1: Unknown error: \"p1\", \"p2\"" ) == 0 );
- BOOST_TEST( ex.code() == ec );
- BOOST_TEST( ex.path1().string() == "p1" );
- BOOST_TEST( ex.path2().string() == "p2" );
- }
- }
-
-
- // name_function_tests ---------------------------------------------------//
-
- void name_function_tests()
- {
- std::cout << "name_function_tests..." << std::endl;
-
- BOOST_TEST( fs::portable_posix_name( std::string( "x" ) ) );
- BOOST_TEST( fs::windows_name( std::string( "x" ) ) );
- BOOST_TEST( fs::portable_name( std::string( "x" ) ) );
- BOOST_TEST( fs::portable_directory_name( std::string( "x" ) ) );
- BOOST_TEST( fs::portable_file_name( std::string( "x" ) ) );
-
- BOOST_TEST( fs::portable_posix_name( std::string( "." ) ) );
- BOOST_TEST( fs::windows_name( std::string( "." ) ) );
- BOOST_TEST( fs::portable_name( std::string( "." ) ) );
- BOOST_TEST( fs::portable_directory_name( std::string( "." ) ) );
- BOOST_TEST( !fs::portable_file_name( std::string( "." ) ) );
-
- BOOST_TEST( fs::portable_posix_name( std::string( ".." ) ) );
- BOOST_TEST( fs::windows_name( std::string( ".." ) ) );
- BOOST_TEST( fs::portable_name( std::string( ".." ) ) );
- BOOST_TEST( fs::portable_directory_name( std::string( ".." ) ) );
- BOOST_TEST( !fs::portable_file_name( std::string( ".." ) ) );
-
- BOOST_TEST( !fs::native( std::string( "" ) ) );
- BOOST_TEST( !fs::portable_posix_name( std::string( "" ) ) );
- BOOST_TEST( !fs::windows_name( std::string( "" ) ) );
- BOOST_TEST( !fs::portable_name( std::string( "" ) ) );
- BOOST_TEST( !fs::portable_directory_name( std::string( "" ) ) );
- BOOST_TEST( !fs::portable_file_name( std::string( "" ) ) );
-
- BOOST_TEST( !fs::native( std::string( " " ) ) );
- BOOST_TEST( !fs::portable_posix_name( std::string( " " ) ) );
- BOOST_TEST( !fs::windows_name( std::string( " " ) ) );
- BOOST_TEST( !fs::portable_name( std::string( " " ) ) );
- BOOST_TEST( !fs::portable_directory_name( std::string( " " ) ) );
- BOOST_TEST( !fs::portable_file_name( std::string( " " ) ) );
-
- BOOST_TEST( !fs::portable_posix_name( std::string( ":" ) ) );
- BOOST_TEST( !fs::windows_name( std::string( ":" ) ) );
- BOOST_TEST( !fs::portable_name( std::string( ":" ) ) );
- BOOST_TEST( !fs::portable_directory_name( std::string( ":" ) ) );
- BOOST_TEST( !fs::portable_file_name( std::string( ":" ) ) );
-
- BOOST_TEST( fs::portable_posix_name( std::string( "-" ) ) );
- BOOST_TEST( fs::windows_name( std::string( "-" ) ) );
- BOOST_TEST( !fs::portable_name( std::string( "-" ) ) );
- BOOST_TEST( !fs::portable_directory_name( std::string( "-" ) ) );
- BOOST_TEST( !fs::portable_file_name( std::string( "-" ) ) );
-
- BOOST_TEST( !fs::portable_posix_name( std::string( "foo bar" ) ) );
- BOOST_TEST( fs::windows_name( std::string( "foo bar" ) ) );
- BOOST_TEST( !fs::windows_name( std::string( " bar" ) ) );
- BOOST_TEST( !fs::windows_name( std::string( "foo " ) ) );
- BOOST_TEST( !fs::portable_name( std::string( "foo bar" ) ) );
- BOOST_TEST( !fs::portable_directory_name( std::string( "foo bar" ) ) );
- BOOST_TEST( !fs::portable_file_name( std::string( "foo bar" ) ) );
-
- BOOST_TEST( fs::portable_posix_name( std::string( "foo.bar" ) ) );
- BOOST_TEST( fs::windows_name( std::string( "foo.bar" ) ) );
- BOOST_TEST( fs::portable_name( std::string( "foo.bar" ) ) );
- BOOST_TEST( !fs::portable_directory_name( std::string( "foo.bar" ) ) );
- BOOST_TEST( fs::portable_file_name( std::string( "foo.bar" ) ) );
-
- BOOST_TEST( fs::portable_posix_name( std::string( "foo.barf" ) ) );
- BOOST_TEST( fs::windows_name( std::string( "foo.barf" ) ) );
- BOOST_TEST( fs::portable_name( std::string( "foo.barf" ) ) );
- BOOST_TEST( !fs::portable_directory_name( std::string( "foo.barf" ) ) );
- BOOST_TEST( !fs::portable_file_name( std::string( "foo.barf" ) ) );
-
- BOOST_TEST( fs::portable_posix_name( std::string( ".foo" ) ) );
- BOOST_TEST( fs::windows_name( std::string( ".foo" ) ) );
- BOOST_TEST( !fs::portable_name( std::string( ".foo" ) ) );
- BOOST_TEST( !fs::portable_directory_name( std::string( ".foo" ) ) );
- BOOST_TEST( !fs::portable_file_name( std::string( ".foo" ) ) );
-
- BOOST_TEST( fs::portable_posix_name( std::string( "foo." ) ) );
- BOOST_TEST( !fs::windows_name( std::string( "foo." ) ) );
- BOOST_TEST( !fs::portable_name( std::string( "foo." ) ) );
- BOOST_TEST( !fs::portable_directory_name( std::string( "foo." ) ) );
- BOOST_TEST( !fs::portable_file_name( std::string( "foo." ) ) );
- }
-
-} // unnamed namespace
-
-int main( int, char*[] )
-{
- // The choice of platform is make at runtime rather than compile-time
- // so that compile errors for all platforms will be detected even though
- // only the current platform is runtime tested.
- platform = ( platform == "Win32" || platform == "Win64" || platform == "Cygwin" )
- ? "Windows"
- : "POSIX";
- std::cout << "Platform is " << platform << '\n';
-
- path p1( "fe/fi/fo/fum" );
- path p2( p1 );
- path p3;
- BOOST_TEST( p1.string() != p3.string() );
-
- // check each overload
- BOOST_TEST( p1 != p3 );
- BOOST_TEST( p1 != p3.string() );
- BOOST_TEST( p1 != p3.string().c_str() );
- BOOST_TEST( p1.string() != p3 );
- BOOST_TEST( p1.string().c_str() != p3 );
-
- p3 = p2;
- BOOST_TEST( p1.string() == p3.string() );
-
- // check each overload
- BOOST_TEST( p1 == p3 );
- BOOST_TEST( p1 == p3.string() );
- BOOST_TEST( p1 == p3.string().c_str() );
- BOOST_TEST( p1.string() == p3 );
- BOOST_TEST( p1.string().c_str() == p3 );
-
- path p4( "foobar" );
- BOOST_TEST( p4.string() == "foobar" );
- p4 = p4; // self-assignment
- BOOST_TEST( p4.string() == "foobar" );
-
- if ( platform == "Windows" )
- {
- path p10 ("c:\\file");
- path p11 ("c:/file");
- // check each overload
- BOOST_TEST( p10.string() == p11.string() );
- BOOST_TEST( p10 == p11 );
- BOOST_TEST( p10 == p11.string() );
- BOOST_TEST( p10 == p11.string().c_str() );
- BOOST_TEST( p10.string() == p11 );
- BOOST_TEST( p10.string().c_str() == p11 );
- BOOST_TEST( p10 == "c:\\file" );
- BOOST_TEST( p10 == "c:/file" );
- BOOST_TEST( p11 == "c:\\file" );
- BOOST_TEST( p11 == "c:/file" );
- BOOST_TEST( "c:\\file" == p10 );
- BOOST_TEST( "c:/file" == p10 );
- BOOST_TEST( "c:\\file" == p11 );
- BOOST_TEST( "c:/file" == p11 );
- }
-
- exception_tests();
- name_function_tests();
-
- // These verify various overloads don't cause compiler errors
-
- fs::exists( p1 );
- fs::exists( "foo" );
- fs::exists( std::string( "foo" ) );
-
- fs::exists( p1 / path( "foo" ) );
- fs::exists( p1 / "foo" );
- fs::exists( p1 / std::string( "foo" ) );
-
- fs::exists( "foo" / p1 );
- fs::exists( std::string( "foo" ) / p1 );
-
- p4 /= path( "foo" );
- p4 /= "foo";
- p4 /= std::string( "foo" );
-
- path p5;
- std::string s1( "//:somestring" );
-
- // verify deprecated names still available
-
-# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
-
- p1.branch_path();
- p1.leaf();
- path p_remove_leaf;
- p_remove_leaf.remove_leaf();
-
-# endif
-
-
-# ifndef BOOST_NO_MEMBER_TEMPLATES
-
- // check the path member templates
- p5.assign( s1.begin(), s1.end() );
-
- PATH_CHECK( p5, "somestring" );
- p5 = s1;
- PATH_CHECK( p5, "somestring" );
-
- BOOST_TEST( p4.string() == path( p4.string().begin(), p4.string().end() ).string() );
-
- char c0 = 'a';
- p5.assign( &c0, &c0 );
- PATH_CHECK( p5, "" );
- p5 /= "";
- PATH_CHECK( p5, "" );
- p5 /= "foo/bar";
- PATH_CHECK( p5, "foo/bar" );
- p5.append( &c0, &c0 );
- PATH_CHECK( p5, "foo/bar" );
- p5 /= "";
- PATH_CHECK( p5, "foo/bar" );
- char bf[]= "bar/foo";
- p5.assign( bf, bf + sizeof(bf) );
- PATH_CHECK( p5, bf );
- p5.append( bf, bf + sizeof(bf) );
- PATH_CHECK( p5, "bar/foo/bar/foo" );
-
- // this code, courtesy of David Whetstone, detected a now fixed bug that
- // derefereced the end iterator (assuming debug build with checked itors)
- std::vector<char> v1;
- p5.assign( v1.begin(), v1.end() );
- std::string s2( v1.begin(), v1.end() );
- PATH_CHECK( p5, s2 );
- p5.assign( s1.begin(), s1.begin() + 1 );
- PATH_CHECK( p5, "/" );
-
-# endif
- path clear_path( "foo" );
-
- BOOST_TEST( !clear_path.empty() );
- clear_path.clear();
- BOOST_TEST( clear_path.empty() );
-
- BOOST_TEST( p1 != p4 );
- BOOST_TEST( p1.string() == p2.string() );
- BOOST_TEST( p1.string() == p3.string() );
- BOOST_TEST( path( "foo" ).filename() == "foo" );
- BOOST_TEST( path( "foo" ).parent_path().string() == "" );
- BOOST_TEST( p1.filename() == "fum" );
- BOOST_TEST( p1.parent_path().string() == "fe/fi/fo" );
- BOOST_TEST( path( "" ).empty() == true );
- BOOST_TEST( path( "foo" ).empty() == false );
-
- PATH_CHECK( "", "" );
-
- PATH_CHECK( "foo", "foo" );
- PATH_CHECK( "f", "f" );
-
- PATH_CHECK( "foo/", "foo/" );
- PATH_CHECK( "f/", "f/" );
- PATH_CHECK( "foo/..", "foo/.." );
- PATH_CHECK( "foo/../", "foo/../" );
- PATH_CHECK( "foo/bar/../..", "foo/bar/../.." );
- PATH_CHECK( "foo/bar/../../", "foo/bar/../../" );
- PATH_CHECK( path("") / "foo", "foo" );
- PATH_CHECK( path("") / "foo/", "foo/" );
- PATH_CHECK( path("foo") / "", "foo" );
- PATH_CHECK( path( "/" ), "/" );
- PATH_CHECK( path( "/" ) / "", "/" );
- PATH_CHECK( path( "/f" ), "/f" );
-
- PATH_CHECK( "/foo", "/foo" );
- PATH_CHECK( path("") / "/foo", "/foo" );
- PATH_CHECK( path("/foo") / "", "/foo" );
-
- if ( platform == "Windows" )
- {
- PATH_CHECK( path("c:") / "foo", "c:foo" );
- PATH_CHECK( path("c:") / "/foo", "c:/foo" );
- }
-
- if ( platform == "Windows" )
- {
- PATH_CHECK( path("c:") / "foo", "c:foo" );
- PATH_CHECK( path("c:") / "/foo", "c:/foo" );
- }
-
- PATH_CHECK( "foo/bar", "foo/bar" );
- PATH_CHECK( path("foo") / path("bar"), "foo/bar" ); // path arg
- PATH_CHECK( path("foo") / "bar", "foo/bar" ); // const char * arg
- PATH_CHECK( path("foo") / path("woo/bar").filename(), "foo/bar" ); // const std::string & arg
- PATH_CHECK( "foo" / path("bar"), "foo/bar" );
-
- PATH_CHECK( "a/b", "a/b" ); // probe for length effects
- PATH_CHECK( path("a") / "b", "a/b" );
-
- PATH_CHECK( "..", ".." );
- PATH_CHECK( path("..") / "", ".." );
- PATH_CHECK( path("") / "..", ".." );
-
- PATH_CHECK( "../..", "../.." );
- PATH_CHECK( path("..") / ".." , "../.." );
-
- PATH_CHECK( "/..", "/.." );
- PATH_CHECK( path("/") / ".." , "/.." );
-
- PATH_CHECK( "/../..", "/../.." );
- PATH_CHECK( path("/..") / ".." , "/../.." );
-
- PATH_CHECK( "../foo", "../foo" );
- PATH_CHECK( path("..") / "foo" , "../foo" );
-
- PATH_CHECK( "foo/..", "foo/.." );
- PATH_CHECK( path("foo") / ".." , "foo/.." );
- PATH_CHECK( path( "foo/..bar"), "foo/..bar" );
-
- PATH_CHECK( "../f", "../f" );
- PATH_CHECK( path("..") / "f" , "../f" );
-
- PATH_CHECK( "/../f", "/../f" );
- PATH_CHECK( path("/..") / "f" , "/../f" );
-
- PATH_CHECK( "f/..", "f/.." );
- PATH_CHECK( path("f") / ".." , "f/.." );
-
- PATH_CHECK( "foo/../..", "foo/../.." );
- PATH_CHECK( path("foo") / ".." / ".." , "foo/../.." );
-
- PATH_CHECK( "foo/../../..", "foo/../../.." );
- PATH_CHECK( path("foo") / ".." / ".." / ".." , "foo/../../.." );
-
- PATH_CHECK( "foo/../bar", "foo/../bar" );
- PATH_CHECK( path("foo") / ".." / "bar" , "foo/../bar" );
-
- PATH_CHECK( "foo/bar/..", "foo/bar/.." );
- PATH_CHECK( path("foo") / "bar" / ".." , "foo/bar/.." );
-
- PATH_CHECK( "foo/bar/../..", "foo/bar/../.." );
- PATH_CHECK( path("foo") / "bar" / ".." / "..", "foo/bar/../.." );
-
- PATH_CHECK( "foo/bar/../blah", "foo/bar/../blah" );
- PATH_CHECK( path("foo") / "bar" / ".." / "blah", "foo/bar/../blah" );
-
- PATH_CHECK( "f/../b", "f/../b" );
- PATH_CHECK( path("f") / ".." / "b" , "f/../b" );
-
- PATH_CHECK( "f/b/..", "f/b/.." );
- PATH_CHECK( path("f") / "b" / ".." , "f/b/.." );
-
- PATH_CHECK( "f/b/../a", "f/b/../a" );
- PATH_CHECK( path("f") / "b" / ".." / "a", "f/b/../a" );
-
- PATH_CHECK( "foo/bar/blah/../..", "foo/bar/blah/../.." );
- PATH_CHECK( path("foo") / "bar" / "blah" / ".." / "..", "foo/bar/blah/../.." );
-
- PATH_CHECK( "foo/bar/blah/../../bletch", "foo/bar/blah/../../bletch" );
- PATH_CHECK( path("foo") / "bar" / "blah" / ".." / ".." / "bletch", "foo/bar/blah/../../bletch" );
-
- PATH_CHECK( "...", "..." );
- PATH_CHECK( "....", "...." );
- PATH_CHECK( "foo/...", "foo/..." );
- PATH_CHECK( "abc.", "abc." );
- PATH_CHECK( "abc..", "abc.." );
- PATH_CHECK( "foo/abc.", "foo/abc." );
- PATH_CHECK( "foo/abc..", "foo/abc.." );
-
- PATH_CHECK( path(".abc"), ".abc" );
- PATH_CHECK( "a.c", "a.c" );
- PATH_CHECK( path("..abc"), "..abc" );
- PATH_CHECK( "a..c", "a..c" );
- PATH_CHECK( path("foo/.abc"), "foo/.abc" );
- PATH_CHECK( "foo/a.c", "foo/a.c" );
- PATH_CHECK( path("foo/..abc"), "foo/..abc" );
- PATH_CHECK( "foo/a..c", "foo/a..c" );
-
- PATH_CHECK( ".", "." );
- PATH_CHECK( path("") / ".", "." );
- PATH_CHECK( "./foo", "./foo" );
- PATH_CHECK( path(".") / "foo", "./foo" );
- PATH_CHECK( "./..", "./.." );
- PATH_CHECK( path(".") / "..", "./.." );
- PATH_CHECK( "./../foo", "./../foo" );
- PATH_CHECK( "foo/.", "foo/." );
- PATH_CHECK( path("foo") / ".", "foo/." );
- PATH_CHECK( "../.", "../." );
- PATH_CHECK( path("..") / ".", "../." );
- PATH_CHECK( "./.", "./." );
- PATH_CHECK( path(".") / ".", "./." );
- PATH_CHECK( "././.", "././." );
- PATH_CHECK( path(".") / "." / ".", "././." );
- PATH_CHECK( "./foo/.", "./foo/." );
- PATH_CHECK( path(".") / "foo" / ".", "./foo/." );
- PATH_CHECK( "foo/./bar", "foo/./bar" );
- PATH_CHECK( path("foo") / "." / "bar", "foo/./bar" );
- PATH_CHECK( "foo/./.", "foo/./." );
- PATH_CHECK( path("foo") / "." / ".", "foo/./." );
- PATH_CHECK( "foo/./..", "foo/./.." );
- PATH_CHECK( path("foo") / "." / "..", "foo/./.." );
- PATH_CHECK( "foo/./../bar", "foo/./../bar" );
- PATH_CHECK( "foo/../.", "foo/../." );
- PATH_CHECK( path(".") / "." / "..", "././.." );
- PATH_CHECK( "././..", "././.." );
- PATH_CHECK( path(".") / "." / "..", "././.." );
- PATH_CHECK( "./../.", "./../." );
- PATH_CHECK( path(".") / ".." / ".", "./../." );
- PATH_CHECK( ".././.", ".././." );
- PATH_CHECK( path("..") / "." / ".", ".././." );
-
- // iterator tests
-
- path itr_ck = "";
- path::const_iterator itr = itr_ck.begin();
- BOOST_TEST( itr == itr_ck.end() );
-
- itr_ck = "/";
- itr = itr_ck.begin();
- BOOST_TEST( *itr == std::string( "/" ) );
- BOOST_TEST( ++itr == itr_ck.end() );
- BOOST_TEST( *--itr == std::string( "/" ) );
-
- itr_ck = "foo";
- BOOST_TEST( *itr_ck.begin() == std::string( "foo" ) );
- 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( *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();
- BOOST_TEST( *itr == std::string( "/" ) );
- BOOST_TEST( *++itr == std::string( "foo" ) );
- BOOST_TEST( *++itr == std::string( "bar" ) );
- BOOST_TEST( ++itr == itr_ck.end() );
- CHECK_EQUAL( *--itr, "bar" );
- CHECK_EQUAL( *--itr, "foo" );
- CHECK_EQUAL( *--itr, "/" );
-
- itr_ck = "../f"; // previously failed due to short name bug
- itr = itr_ck.begin();
- CHECK_EQUAL( *itr, ".." );
- CHECK_EQUAL( *++itr, "f" );
- BOOST_TEST( ++itr == itr_ck.end() );
- CHECK_EQUAL( *--itr, "f" );
- CHECK_EQUAL( *--itr, ".." );
-
- // POSIX says treat "/foo/bar/" as "/foo/bar/."
- itr_ck = "/foo/bar/";
- itr = itr_ck.begin();
- CHECK_EQUAL( *itr, "/" );
- CHECK_EQUAL( *++itr, "foo" );
- CHECK_EQUAL( *++itr, "bar" );
- CHECK_EQUAL( *++itr, "." );
- BOOST_TEST( ++itr == itr_ck.end() );
- CHECK_EQUAL( *--itr, "." );
- CHECK_EQUAL( *--itr, "bar" );
- CHECK_EQUAL( *--itr, "foo" );
- CHECK_EQUAL( *--itr, "/" );
-
- // POSIX says treat "/f/b/" as "/f/b/."
- itr_ck = "/f/b/";
- itr = itr_ck.begin();
- CHECK_EQUAL( *itr, "/" );
- CHECK_EQUAL( *++itr, "f" );
- CHECK_EQUAL( *++itr, "b" );
- CHECK_EQUAL( *++itr, "." );
- BOOST_TEST( ++itr == itr_ck.end() );
- CHECK_EQUAL( *--itr, "." );
- CHECK_EQUAL( *--itr, "b" );
- CHECK_EQUAL( *--itr, "f" );
- CHECK_EQUAL( *--itr, "/" );
-
- itr_ck = "//net";
- itr = itr_ck.begin();
- // two leading slashes are permitted by POSIX (as implementation defined),
- // while for Windows it is always well defined (as a network name)
- CHECK_EQUAL( *itr, "//net" );
- BOOST_TEST( ++itr == itr_ck.end() );
- CHECK_EQUAL( *--itr, "//net" );
-
- itr_ck = "//net/";
- itr = itr_ck.begin();
- CHECK_EQUAL( *itr, "//net" );
- CHECK_EQUAL( *++itr, "/" );
- BOOST_TEST( ++itr == itr_ck.end() );
- CHECK_EQUAL( *--itr, "/" );
- CHECK_EQUAL( *--itr, "//net" );
-
- itr_ck = "//foo///bar///";
- itr = itr_ck.begin();
- CHECK_EQUAL( *itr, "//foo" );
- CHECK_EQUAL( *++itr, "/" );
- CHECK_EQUAL( *++itr, "bar" );
- CHECK_EQUAL( *++itr, "." );
- BOOST_TEST( ++itr == itr_ck.end() );
- CHECK_EQUAL( *--itr, "." );
- CHECK_EQUAL( *--itr, "bar" );
- CHECK_EQUAL( *--itr, "/" );
- CHECK_EQUAL( *--itr, "//foo" );
-
- itr_ck = "///foo///bar///";
- itr = itr_ck.begin();
- // three or more leading slashes are to be treated as a single slash
- CHECK_EQUAL( *itr, "/" );
- CHECK_EQUAL( *++itr, "foo" );
- CHECK_EQUAL( *++itr, "bar" );
- CHECK_EQUAL( *++itr, "." );
- BOOST_TEST( ++itr == itr_ck.end() );
- CHECK_EQUAL( *--itr, "." );
- CHECK_EQUAL( *--itr, "bar" );
- CHECK_EQUAL( *--itr, "foo" );
- CHECK_EQUAL( *--itr, "/" );
-
- if ( platform == "Windows" )
- {
- itr_ck = "c:/";
- itr = itr_ck.begin();
- CHECK_EQUAL( *itr, "c:" );
- CHECK_EQUAL( *++itr, "/" );
- BOOST_TEST( ++itr == itr_ck.end() );
- CHECK_EQUAL( *--itr, "/" );
- CHECK_EQUAL( *--itr, "c:" );
-
- itr_ck = "c:/foo";
- itr = itr_ck.begin();
- BOOST_TEST( *itr == std::string( "c:" ) );
- BOOST_TEST( *++itr == std::string( "/" ) );
- BOOST_TEST( *++itr == std::string( "foo" ) );
- BOOST_TEST( ++itr == itr_ck.end() );
- BOOST_TEST( *--itr == std::string( "foo" ) );
- BOOST_TEST( *--itr == std::string( "/" ) );
- BOOST_TEST( *--itr == std::string( "c:" ) );
-
- itr_ck = "c:foo";
- itr = itr_ck.begin();
- BOOST_TEST( *itr == std::string( "c:" ) );
- BOOST_TEST( *++itr == std::string( "foo" ) );
- BOOST_TEST( ++itr == itr_ck.end() );
- BOOST_TEST( *--itr == std::string( "foo" ) );
- BOOST_TEST( *--itr == std::string( "c:" ) );
-
- itr_ck = "c:foo/";
- itr = itr_ck.begin();
- BOOST_TEST( *itr == std::string( "c:" ) );
- BOOST_TEST( *++itr == std::string( "foo" ) );
- BOOST_TEST( *++itr == std::string( "." ) );
- BOOST_TEST( ++itr == itr_ck.end() );
- BOOST_TEST( *--itr == std::string( "." ) );
- BOOST_TEST( *--itr == std::string( "foo" ) );
- BOOST_TEST( *--itr == std::string( "c:" ) );
- }
- else
- {
- itr_ck = "///";
- itr = itr_ck.begin();
- CHECK_EQUAL( *itr, "/" );
- BOOST_TEST( ++itr == itr_ck.end() );
- }
-
- path p;
-
- p = "";
- BOOST_TEST( p.relative_path().string() == "" );
- BOOST_TEST( p.parent_path().string() == "" );
- BOOST_TEST( p.filename() == "" );
- BOOST_TEST( p.root_name() == "" );
- BOOST_TEST( p.root_directory() == "" );
- BOOST_TEST( p.root_path().string() == "" );
- BOOST_TEST( !p.has_root_path() );
- BOOST_TEST( !p.has_root_name() );
- BOOST_TEST( !p.has_root_directory() );
- BOOST_TEST( !p.has_relative_path() );
- BOOST_TEST( !p.has_filename() );
- BOOST_TEST( !p.has_parent_path() );
- BOOST_TEST( !p.is_complete() );
-
- p = "/";
- BOOST_TEST( p.relative_path().string() == "" );
- BOOST_TEST( p.parent_path().string() == "" );
- BOOST_TEST( p.filename() == "/" );
- BOOST_TEST( p.root_name() == "" );
- BOOST_TEST( p.root_directory() == "/" );
- BOOST_TEST( p.root_path().string() == "/" );
- BOOST_TEST( p.has_root_path() );
- BOOST_TEST( !p.has_root_name() );
- BOOST_TEST( p.has_root_directory() );
- BOOST_TEST( !p.has_relative_path() );
- BOOST_TEST( p.has_filename() );
- BOOST_TEST( !p.has_parent_path() );
- if ( platform == "POSIX" )
- BOOST_TEST( p.is_complete() );
- else
- BOOST_TEST( !p.is_complete() );
-
- p = "//";
- CHECK_EQUAL( p.relative_path().string(), "" );
- CHECK_EQUAL( p.parent_path().string(), "" );
- CHECK_EQUAL( p.filename(), "//" );
- CHECK_EQUAL( p.root_name(), "//" );
- CHECK_EQUAL( p.root_directory(), "" );
- CHECK_EQUAL( p.root_path().string(), "//" );
- BOOST_TEST( p.has_root_path() );
- BOOST_TEST( p.has_root_name() );
- BOOST_TEST( !p.has_root_directory() );
- BOOST_TEST( !p.has_relative_path() );
- BOOST_TEST( p.has_filename() );
- BOOST_TEST( !p.has_parent_path() );
- BOOST_TEST( !p.is_complete() );
-
-
- p = "///";
- CHECK_EQUAL( p.relative_path().string(), "" );
- CHECK_EQUAL( p.parent_path().string(), "" );
- CHECK_EQUAL( p.filename(), "/" );
- CHECK_EQUAL( p.root_name(), "" );
- CHECK_EQUAL( p.root_directory(), "/" );
- CHECK_EQUAL( p.root_path().string(), "/" );
- BOOST_TEST( p.has_root_path() );
- BOOST_TEST( !p.has_root_name() );
- BOOST_TEST( p.has_root_directory() );
- BOOST_TEST( !p.has_relative_path() );
- BOOST_TEST( p.has_filename() );
- BOOST_TEST( !p.has_parent_path() );
- if ( platform == "POSIX" )
- BOOST_TEST( p.is_complete() );
- else
- BOOST_TEST( !p.is_complete() );
-
- p = ".";
- BOOST_TEST( p.relative_path().string() == "." );
- BOOST_TEST( p.parent_path().string() == "" );
- BOOST_TEST( p.filename() == "." );
- BOOST_TEST( p.root_name() == "" );
- BOOST_TEST( p.root_directory() == "" );
- BOOST_TEST( p.root_path().string() == "" );
- BOOST_TEST( !p.has_root_path() );
- BOOST_TEST( !p.has_root_name() );
- BOOST_TEST( !p.has_root_directory() );
- BOOST_TEST( p.has_relative_path() );
- BOOST_TEST( p.has_filename() );
- BOOST_TEST( !p.has_parent_path() );
- BOOST_TEST( !p.is_complete() );
-
- p = "..";
- BOOST_TEST( p.relative_path().string() == ".." );
- BOOST_TEST( p.parent_path().string() == "" );
- BOOST_TEST( p.filename() == ".." );
- BOOST_TEST( p.root_name() == "" );
- BOOST_TEST( p.root_directory() == "" );
- BOOST_TEST( p.root_path().string() == "" );
- BOOST_TEST( !p.has_root_path() );
- BOOST_TEST( !p.has_root_name() );
- BOOST_TEST( !p.has_root_directory() );
- BOOST_TEST( p.has_relative_path() );
- BOOST_TEST( p.has_filename() );
- BOOST_TEST( !p.has_parent_path() );
- BOOST_TEST( !p.is_complete() );
-
- p = "foo";
- BOOST_TEST( p.relative_path().string() == "foo" );
- BOOST_TEST( p.parent_path().string() == "" );
- BOOST_TEST( p.filename() == "foo" );
- BOOST_TEST( p.root_name() == "" );
- BOOST_TEST( p.root_directory() == "" );
- BOOST_TEST( p.root_path().string() == "" );
- BOOST_TEST( !p.has_root_path() );
- BOOST_TEST( !p.has_root_name() );
- BOOST_TEST( !p.has_root_directory() );
- BOOST_TEST( p.has_relative_path() );
- BOOST_TEST( p.has_filename() );
- BOOST_TEST( !p.has_parent_path() );
- BOOST_TEST( !p.is_complete() );
-
- p = "/foo";
- CHECK_EQUAL( p.relative_path().string(), "foo" );
- CHECK_EQUAL( p.parent_path().string(), "/" );
- CHECK_EQUAL( p.filename(), "foo" );
- CHECK_EQUAL( p.root_name(), "" );
- CHECK_EQUAL( p.root_directory(), "/" );
- CHECK_EQUAL( p.root_path().string(), "/" );
- BOOST_TEST( p.has_root_path() );
- BOOST_TEST( !p.has_root_name() );
- BOOST_TEST( p.has_root_directory() );
- BOOST_TEST( p.has_relative_path() );
- BOOST_TEST( p.has_filename() );
- BOOST_TEST( p.has_parent_path() );
- if ( platform == "POSIX" )
- BOOST_TEST( p.is_complete() );
- else
- BOOST_TEST( !p.is_complete() );
-
- p = "/foo/";
- CHECK_EQUAL( p.relative_path().string(), "foo/" );
- CHECK_EQUAL( p.parent_path().string(), "/foo" );
- CHECK_EQUAL( p.filename(), "." );
- CHECK_EQUAL( p.root_name(), "" );
- CHECK_EQUAL( p.root_directory(), "/" );
- CHECK_EQUAL( p.root_path().string(), "/" );
- BOOST_TEST( p.has_root_path() );
- BOOST_TEST( !p.has_root_name() );
- BOOST_TEST( p.has_root_directory() );
- BOOST_TEST( p.has_relative_path() );
- BOOST_TEST( p.has_filename() );
- BOOST_TEST( p.has_parent_path() );
- if ( platform == "POSIX" )
- BOOST_TEST( p.is_complete() );
- else
- BOOST_TEST( !p.is_complete() );
-
- p = "///foo";
- CHECK_EQUAL( p.relative_path().string(), "foo" );
- CHECK_EQUAL( p.parent_path().string(), "/" );
- CHECK_EQUAL( p.filename(), "foo" );
- CHECK_EQUAL( p.root_name(), "" );
- CHECK_EQUAL( p.root_directory(), "/" );
- CHECK_EQUAL( p.root_path().string(), "/" );
- BOOST_TEST( p.has_root_path() );
- BOOST_TEST( !p.has_root_name() );
- BOOST_TEST( p.has_root_directory() );
- BOOST_TEST( p.has_relative_path() );
- BOOST_TEST( p.has_filename() );
- BOOST_TEST( p.has_parent_path() );
- if ( platform == "POSIX" )
- BOOST_TEST( p.is_complete() );
- else
- BOOST_TEST( !p.is_complete() );
-
- p = "foo/bar";
- BOOST_TEST( p.relative_path().string() == "foo/bar" );
- BOOST_TEST( p.parent_path().string() == "foo" );
- BOOST_TEST( p.filename() == "bar" );
- BOOST_TEST( p.root_name() == "" );
- BOOST_TEST( p.root_directory() == "" );
- BOOST_TEST( p.root_path().string() == "" );
- BOOST_TEST( !p.has_root_path() );
- BOOST_TEST( !p.has_root_name() );
- BOOST_TEST( !p.has_root_directory() );
- BOOST_TEST( p.has_relative_path() );
- BOOST_TEST( p.has_filename() );
- BOOST_TEST( p.has_parent_path() );
- BOOST_TEST( !p.is_complete() );
-
- p = "../foo";
- BOOST_TEST( p.relative_path().string() == "../foo" );
- BOOST_TEST( p.parent_path().string() == ".." );
- BOOST_TEST( p.filename() == "foo" );
- BOOST_TEST( p.root_name() == "" );
- BOOST_TEST( p.root_directory() == "" );
- BOOST_TEST( p.root_path().string() == "" );
- BOOST_TEST( !p.has_root_path() );
- BOOST_TEST( !p.has_root_name() );
- BOOST_TEST( !p.has_root_directory() );
- BOOST_TEST( p.has_relative_path() );
- BOOST_TEST( p.has_filename() );
- BOOST_TEST( p.has_parent_path() );
- BOOST_TEST( !p.is_complete() );
-
- p = "..///foo";
- CHECK_EQUAL( p.relative_path().string(), "..///foo" );
- CHECK_EQUAL( p.parent_path().string(), ".." );
- CHECK_EQUAL( p.filename(), "foo" );
- CHECK_EQUAL( p.root_name(), "" );
- CHECK_EQUAL( p.root_directory(), "" );
- CHECK_EQUAL( p.root_path().string(), "" );
- BOOST_TEST( !p.has_root_path() );
- BOOST_TEST( !p.has_root_name() );
- BOOST_TEST( !p.has_root_directory() );
- BOOST_TEST( p.has_relative_path() );
- BOOST_TEST( p.has_filename() );
- BOOST_TEST( p.has_parent_path() );
- BOOST_TEST( !p.is_complete() );
-
- p = "/foo/bar";
- BOOST_TEST( p.relative_path().string() == "foo/bar" );
- BOOST_TEST( p.parent_path().string() == "/foo" );
- BOOST_TEST( p.filename() == "bar" );
- BOOST_TEST( p.root_name() == "" );
- BOOST_TEST( p.root_directory() == "/" );
- BOOST_TEST( p.root_path().string() == "/" );
- BOOST_TEST( p.has_root_path() );
- BOOST_TEST( !p.has_root_name() );
- BOOST_TEST( p.has_root_directory() );
- BOOST_TEST( p.has_relative_path() );
- BOOST_TEST( p.has_filename() );
- BOOST_TEST( p.has_parent_path() );
- if ( platform == "POSIX" )
- BOOST_TEST( p.is_complete() );
- else
- BOOST_TEST( !p.is_complete() );
-
- // Both POSIX and Windows allow two leading slashs
- // (POSIX meaning is implementation defined)
- PATH_CHECK( path( "//resource" ), "//resource" );
- PATH_CHECK( path( "//resource/" ), "//resource/" );
- PATH_CHECK( path( "//resource/foo" ), "//resource/foo" );
-
- p = path( "//net" );
- CHECK_EQUAL( p.string(), "//net" );
- CHECK_EQUAL( p.relative_path().string(), "" );
- CHECK_EQUAL( p.parent_path().string(), "" );
- CHECK_EQUAL( p.filename(), "//net" );
- CHECK_EQUAL( p.root_name(), "//net" );
- CHECK_EQUAL( p.root_directory(), "" );
- CHECK_EQUAL( p.root_path().string(), "//net" );
- BOOST_TEST( p.has_root_path() );
- BOOST_TEST( p.has_root_name() );
- BOOST_TEST( !p.has_root_directory() );
- BOOST_TEST( !p.has_relative_path() );
- BOOST_TEST( p.has_filename() );
- BOOST_TEST( !p.has_parent_path() );
- BOOST_TEST( !p.is_complete() );
-
- p = path( "//net/" );
- BOOST_TEST( p.relative_path().string() == "" );
- BOOST_TEST( p.parent_path().string() == "//net" );
- BOOST_TEST( p.filename() == "/" );
- BOOST_TEST( p.root_name() == "//net" );
- BOOST_TEST( p.root_directory() == "/" );
- BOOST_TEST( p.root_path().string() == "//net/" );
- BOOST_TEST( p.has_root_path() );
- BOOST_TEST( p.has_root_name() );
- BOOST_TEST( p.has_root_directory() );
- BOOST_TEST( !p.has_relative_path() );
- BOOST_TEST( p.has_filename() );
- BOOST_TEST( p.has_parent_path() );
- BOOST_TEST( p.is_complete() );
-
- p = path( "//net/foo" );
- BOOST_TEST( p.relative_path().string() == "foo" );
- BOOST_TEST( p.parent_path().string() == "//net/" );
- BOOST_TEST( p.filename() == "foo" );
- BOOST_TEST( p.root_name() == "//net" );
- BOOST_TEST( p.root_directory() == "/" );
- BOOST_TEST( p.root_path().string() == "//net/" );
- BOOST_TEST( p.has_root_path() );
- BOOST_TEST( p.has_root_name() );
- BOOST_TEST( p.has_root_directory() );
- BOOST_TEST( p.has_relative_path() );
- BOOST_TEST( p.has_filename() );
- BOOST_TEST( p.has_parent_path() );
- BOOST_TEST( p.is_complete() );
-
- p = path( "//net///foo" );
- CHECK_EQUAL( p.relative_path().string(), "foo" );
- CHECK_EQUAL( p.parent_path().string(), "//net/" );
- CHECK_EQUAL( p.filename(), "foo" );
- CHECK_EQUAL( p.root_name(), "//net" );
- CHECK_EQUAL( p.root_directory(), "/" );
- CHECK_EQUAL( p.root_path().string(), "//net/" );
- BOOST_TEST( p.has_root_path() );
- BOOST_TEST( p.has_root_name() );
- BOOST_TEST( p.has_root_directory() );
- BOOST_TEST( p.has_relative_path() );
- BOOST_TEST( p.has_filename() );
- BOOST_TEST( p.has_parent_path() );
- BOOST_TEST( p.is_complete() );
-
- if ( platform == "Windows" )
- {
- DIR_CHECK( path( "/foo/bar/" ), "\\foo\\bar\\" );
- DIR_CHECK( path( "//foo//bar//" ), "\\\\foo\\bar\\\\" );
- DIR_CHECK( path( "///foo///bar///" ), "\\foo\\\\\\bar\\\\\\" );
-
- DIR_CHECK( path( "\\/foo\\/bar\\/" ), "\\\\foo\\bar\\\\" );
- DIR_CHECK( path( "\\//foo\\//bar\\//" ), "\\foo\\\\\\bar\\\\\\" );
-
-
- DIR_CHECK( path( "\\foo\\bar\\" ), "\\foo\\bar\\" );
- DIR_CHECK( path( "\\\\foo\\\\bar\\\\" ), "\\\\foo\\bar\\\\" );
- DIR_CHECK( path( "\\\\\\foo\\\\\\bar\\\\\\" ), "\\foo\\\\\\bar\\\\\\" );
-
- PATH_CHECK( path( "\\" ), "/" );
- PATH_CHECK( path( "\\f" ), "/f" );
- PATH_CHECK( path( "\\foo" ), "/foo" );
- PATH_CHECK( path( "foo\\bar" ), "foo/bar" );
- PATH_CHECK( path( "foo bar" ), "foo bar" );
- PATH_CHECK( path( "c:" ), "c:" );
- PATH_CHECK( path( "c:/" ), "c:/" );
- PATH_CHECK( path( "c:." ), "c:." );
- PATH_CHECK( path( "c:./foo" ), "c:./foo" );
- PATH_CHECK( path( "c:.\\foo" ), "c:./foo" );
- PATH_CHECK( path( "c:.." ), "c:.." );
- PATH_CHECK( path( "c:/." ), "c:/." );
- PATH_CHECK( path( "c:/.." ), "c:/.." );
- PATH_CHECK( path( "c:/../" ), "c:/../" );
- PATH_CHECK( path( "c:\\..\\" ), "c:/../" );
- PATH_CHECK( path( "c:/../.." ), "c:/../.." );
- PATH_CHECK( path( "c:/../foo" ), "c:/../foo" );
- PATH_CHECK( path( "c:\\..\\foo" ), "c:/../foo" );
- PATH_CHECK( path( "c:../foo" ), "c:../foo" );
- PATH_CHECK( path( "c:..\\foo" ), "c:../foo" );
- PATH_CHECK( path( "c:/../../foo" ), "c:/../../foo" );
- PATH_CHECK( path( "c:\\..\\..\\foo" ), "c:/../../foo" );
- PATH_CHECK( path( "c:foo/.." ), "c:foo/.." );
- PATH_CHECK( path( "c:/foo/.." ), "c:/foo/.." );
- PATH_CHECK( path( "c:/..foo" ), "c:/..foo" );
- PATH_CHECK( path( "c:foo" ), "c:foo" );
- PATH_CHECK( path( "c:/foo" ), "c:/foo" );
- PATH_CHECK( path( "\\\\netname" ), "//netname" );
- PATH_CHECK( path( "\\\\netname\\" ), "//netname/" );
- PATH_CHECK( path( "\\\\netname\\foo" ), "//netname/foo" );
- PATH_CHECK( path( "c:/foo" ), "c:/foo" );
- PATH_CHECK( path( "prn:" ), "prn:" );
-
- p = path( "c:" );
- BOOST_TEST( p.relative_path().string() == "" );
- BOOST_TEST( p.parent_path().string() == "" );
- BOOST_TEST( p.filename() == "c:" );
- BOOST_TEST( p.root_name() == "c:" );
- BOOST_TEST( p.root_directory() == "" );
- BOOST_TEST( p.root_path().string() == "c:" );
- BOOST_TEST( p.has_root_path() );
- BOOST_TEST( p.has_root_name() );
- BOOST_TEST( !p.has_root_directory() );
- BOOST_TEST( !p.has_relative_path() );
- BOOST_TEST( p.has_filename() );
- BOOST_TEST( !p.has_parent_path() );
- BOOST_TEST( !p.is_complete() );
-
- p = path( "c:foo" );
- BOOST_TEST( p.relative_path().string() == "foo" );
- BOOST_TEST( p.parent_path().string() == "c:" );
- BOOST_TEST( p.filename() == "foo" );
- BOOST_TEST( p.root_name() == "c:" );
- BOOST_TEST( p.root_directory() == "" );
- BOOST_TEST( p.root_path().string() == "c:" );
- BOOST_TEST( p.has_root_path() );
- BOOST_TEST( p.has_root_name() );
- BOOST_TEST( !p.has_root_directory() );
- BOOST_TEST( p.has_relative_path() );
- BOOST_TEST( p.has_filename() );
- BOOST_TEST( p.has_parent_path() );
- BOOST_TEST( !p.is_complete() );
-
- p = path( "c:/" );
- BOOST_TEST( p.relative_path().string() == "" );
- BOOST_TEST( p.parent_path().string() == "c:" );
- BOOST_TEST( p.filename() == "/" );
- BOOST_TEST( p.root_name() == "c:" );
- BOOST_TEST( p.root_directory() == "/" );
- BOOST_TEST( p.root_path().string() == "c:/" );
- BOOST_TEST( p.has_root_path() );
- BOOST_TEST( p.has_root_name() );
- BOOST_TEST( p.has_root_directory() );
- BOOST_TEST( !p.has_relative_path() );
- BOOST_TEST( p.has_filename() );
- BOOST_TEST( p.has_parent_path() );
- BOOST_TEST( p.is_complete() );
-
- p = path( "c:.." );
- BOOST_TEST( p.relative_path().string() == ".." );
- BOOST_TEST( p.parent_path().string() == "c:" );
- BOOST_TEST( p.filename() == ".." );
- BOOST_TEST( p.root_name() == "c:" );
- BOOST_TEST( p.root_directory() == "" );
- BOOST_TEST( p.root_path().string() == "c:" );
- BOOST_TEST( p.has_root_path() );
- BOOST_TEST( p.has_root_name() );
- BOOST_TEST( !p.has_root_directory() );
- BOOST_TEST( p.has_relative_path() );
- BOOST_TEST( p.has_filename() );
- BOOST_TEST( p.has_parent_path() );
- BOOST_TEST( !p.is_complete() );
-
- p = path( "c:/foo" );
- CHECK_EQUAL( p.relative_path().string(), "foo" );
- CHECK_EQUAL( p.parent_path().string(), "c:/" );
- CHECK_EQUAL( p.filename(), "foo" );
- CHECK_EQUAL( p.root_name(), "c:" );
- CHECK_EQUAL( p.root_directory(), "/" );
- CHECK_EQUAL( p.root_path().string(), "c:/" );
- BOOST_TEST( p.has_root_path() );
- BOOST_TEST( p.has_root_name() );
- BOOST_TEST( p.has_root_directory() );
- BOOST_TEST( p.has_relative_path() );
- BOOST_TEST( p.has_filename() );
- BOOST_TEST( p.has_parent_path() );
- BOOST_TEST( p.is_complete() );
-
- p = path( "c://foo" );
- CHECK_EQUAL( p.relative_path().string(), "foo" );
- CHECK_EQUAL( p.parent_path().string(), "c:/" );
- CHECK_EQUAL( p.filename(), "foo" );
- CHECK_EQUAL( p.root_name(), "c:" );
- CHECK_EQUAL( p.root_directory(), "/" );
- CHECK_EQUAL( p.root_path().string(), "c:/" );
- BOOST_TEST( p.has_root_path() );
- BOOST_TEST( p.has_root_name() );
- BOOST_TEST( p.has_root_directory() );
- BOOST_TEST( p.has_relative_path() );
- BOOST_TEST( p.has_filename() );
- BOOST_TEST( p.has_parent_path() );
- BOOST_TEST( p.is_complete() );
-
- p = path( "c:\\foo\\bar" );
- CHECK_EQUAL( p.relative_path().string(), "foo/bar" );
- CHECK_EQUAL( p.parent_path().string(), "c:/foo" );
- CHECK_EQUAL( p.filename(), "bar" );
- CHECK_EQUAL( p.root_name(), "c:" );
- CHECK_EQUAL( p.root_directory(), "/" );
- CHECK_EQUAL( p.root_path().string(), "c:/" );
- BOOST_TEST( p.has_root_path() );
- BOOST_TEST( p.has_root_name() );
- BOOST_TEST( p.has_root_directory() );
- BOOST_TEST( p.has_relative_path() );
- BOOST_TEST( p.has_filename() );
- BOOST_TEST( p.has_parent_path() );
- BOOST_TEST( p.is_complete() );
-
- p = path( "prn:" );
- BOOST_TEST( p.relative_path().string() == "" );
- BOOST_TEST( p.parent_path().string() == "" );
- BOOST_TEST( p.filename() == "prn:" );
- BOOST_TEST( p.root_name() == "prn:" );
- BOOST_TEST( p.root_directory() == "" );
- BOOST_TEST( p.root_path().string() == "prn:" );
- BOOST_TEST( p.has_root_path() );
- BOOST_TEST( p.has_root_name() );
- BOOST_TEST( !p.has_root_directory() );
- BOOST_TEST( !p.has_relative_path() );
- BOOST_TEST( p.has_filename() );
- BOOST_TEST( !p.has_parent_path() );
- BOOST_TEST( !p.is_complete() );
-
- p = path( "\\\\net\\\\\\foo" );
- CHECK_EQUAL( p.relative_path().string(), "foo" );
- CHECK_EQUAL( p.parent_path().string(), "//net/" );
- CHECK_EQUAL( p.filename(), "foo" );
- CHECK_EQUAL( p.root_name(), "//net" );
- CHECK_EQUAL( p.root_directory(), "/" );
- CHECK_EQUAL( p.root_path().string(), "//net/" );
- BOOST_TEST( p.has_root_path() );
- BOOST_TEST( p.has_root_name() );
- BOOST_TEST( p.has_root_directory() );
- BOOST_TEST( p.has_relative_path() );
- BOOST_TEST( p.has_filename() );
- BOOST_TEST( p.has_parent_path() );
- BOOST_TEST( p.is_complete() );
-
- itr_ck = path( "c:" );
- BOOST_TEST( *itr_ck.begin() == 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( *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( *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( *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( 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( *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( *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( 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
- { // POSIX
- DIR_CHECK( path( "/foo/bar/" ), "/foo/bar/" );
- DIR_CHECK( path( "//foo//bar//" ), "//foo//bar//" );
- DIR_CHECK( path( "///foo///bar///" ), "///foo///bar///" );
-
- p = path( "/usr/local/bin:/usr/bin:/bin" );
- BOOST_TEST( p.file_string() == "/usr/local/bin:/usr/bin:/bin" );
- } // POSIX
-
- // test non-member functions, particularly operator overloads
-
- path e, e2;
- std::string es, es2;
- char ecs[] = "";
- char ecs2[] = "";
-
- char acs[] = "a";
- std::string as(acs);
- path a( as );
-
- char acs2[] = "a";
- std::string as2(acs2);
- path a2( as2 );
-
- char bcs[] = "b";
- std::string bs(bcs);
- path b( bs );
-
- // swap
- a.swap( b );
- BOOST_TEST( a.string() == "b" );
- BOOST_TEST( b.string() == "a" );
- fs::swap( a, b );
- BOOST_TEST( a.string() == "a" );
- BOOST_TEST( b.string() == "b" );
-
- // probe operator /
- BOOST_TEST( (b / a).string() == "b/a" );
- BOOST_TEST( (bs / a).string() == "b/a" );
- BOOST_TEST( (bcs / a).string() == "b/a" );
- BOOST_TEST( (b / as).string() == "b/a" );
- BOOST_TEST( (b / acs).string() == "b/a" );
-
- // probe operator <
- BOOST_TEST( !(e < e2) );
- BOOST_TEST( !(es < e2) );
- BOOST_TEST( !(ecs < e2) );
- BOOST_TEST( !(e < es2) );
- BOOST_TEST( !(e < ecs2) );
-
- BOOST_TEST( e < a );
- BOOST_TEST( es < a );
- BOOST_TEST( ecs < a );
- BOOST_TEST( e < as );
- BOOST_TEST( e < acs );
-
- BOOST_TEST( a < b );
- BOOST_TEST( as < b );
- BOOST_TEST( acs < b );
- BOOST_TEST( a < bs );
- BOOST_TEST( a < bcs );
-
- BOOST_TEST( !(a < a2) );
- BOOST_TEST( !(as < a2) );
- BOOST_TEST( !(acs < a2) );
- BOOST_TEST( !(a < as2) );
- BOOST_TEST( !(a < acs2) );
-
- // make sure basic_path overloads don't conflict with std::string overloads
-
- BOOST_TEST( !(as < as) );
- BOOST_TEST( !(as < acs) );
- BOOST_TEST( !(acs < as) );
-
- // reality check character set is as expected
- BOOST_TEST( std::string("a.b") < std::string("a/b") );
- // verify compare is actually lexicographical
- BOOST_TEST( path("a/b") < path("a.b") );
-
- // make sure the derivative operators also work
- BOOST_TEST( a == a2 );
- BOOST_TEST( as == a2 );
- BOOST_TEST( acs == a2 );
- BOOST_TEST( a == as2 );
- BOOST_TEST( a == acs2 );
-
- BOOST_TEST( a != b );
- BOOST_TEST( as != b );
- BOOST_TEST( acs != b );
- BOOST_TEST( a != bs );
- BOOST_TEST( a != bcs );
-
- BOOST_TEST( b > a );
- BOOST_TEST( b > as );
- BOOST_TEST( b > acs );
- BOOST_TEST( bs > a);
- BOOST_TEST( bcs > a);
-
- BOOST_TEST( !(a2 > a) );
- BOOST_TEST( !(a2 > as) );
- BOOST_TEST( !(a2 > acs) );
- BOOST_TEST( !(as2 > a) );
- BOOST_TEST( !(acs2 > a) );
-
- BOOST_TEST( a <= b );
- BOOST_TEST( as <= b );
- BOOST_TEST( acs <= b );
- BOOST_TEST( a <= bs );
- BOOST_TEST( a <= bcs );
-
- BOOST_TEST( a <= a2 );
- BOOST_TEST( as <= a2 );
- BOOST_TEST( acs <= a2 );
- BOOST_TEST( a <= as2 );
- BOOST_TEST( a <= acs2 );
-
- BOOST_TEST( b >= a );
- BOOST_TEST( bs >= a );
- BOOST_TEST( bcs >= a );
- BOOST_TEST( b >= as );
- BOOST_TEST( b >= acs );
-
- BOOST_TEST( a2 >= a );
- BOOST_TEST( as2 >= a );
- BOOST_TEST( acs2 >= a );
- BOOST_TEST( a2 >= as );
- BOOST_TEST( a2 >= acs );
-
-// extension() tests
-
- BOOST_TEST( path("a/b").extension() == "" );
- BOOST_TEST( path("a/b.txt").extension() == ".txt" );
- BOOST_TEST( path("a/b.").extension() == "." );
- BOOST_TEST( path("a.b.c").extension() == ".c" );
- BOOST_TEST( path("a.b.c.").extension() == "." );
- BOOST_TEST( path("").extension() == "" );
- BOOST_TEST( path("a/").extension() == "." );
-
-// stem() tests
-
- BOOST_TEST( path("b").stem() == "b" );
- BOOST_TEST( path("a/b.txt").stem() == "b" );
- BOOST_TEST( path("a/b.").stem() == "b" );
- BOOST_TEST( path("a.b.c").stem() == "a.b" );
- BOOST_TEST( path("a.b.c.").stem() == "a.b.c" );
- BOOST_TEST( path("").stem() == "" );
-
-// replace_extension() tests
-
- BOOST_TEST( path("a.txt").replace_extension("").string() == "a" );
- BOOST_TEST( path("a.txt").replace_extension(".").string() == "a." );
- BOOST_TEST( path("a.txt").replace_extension(".tex").string() == "a.tex" );
- BOOST_TEST( path("a.txt").replace_extension("tex").string() == "a.tex" );
- BOOST_TEST( path("a.").replace_extension(".tex").string() == "a.tex" );
- BOOST_TEST( path("a.").replace_extension("tex").string() == "a.tex" );
- BOOST_TEST( path("a").replace_extension(".txt").string() == "a.txt" );
- BOOST_TEST( path("a").replace_extension("txt").string() == "a.txt" );
- BOOST_TEST( path("a.b.txt" ).replace_extension(".tex").string() == "a.b.tex" );
- BOOST_TEST( path("a.b.txt" ).replace_extension("tex").string() == "a.b.tex" );
- // see the rationale in html docs for explanation why this works
- BOOST_TEST( path("").replace_extension(".png").string() == ".png" );
-
- // inserter and extractor tests
-# if !defined( BOOST_MSVC ) || BOOST_MSVC > 1300 // bypass VC++ 7.0 and earlier
- std::cout << "\nInserter and extractor test...";
- std::stringstream ss;
- ss << fs::path( "foo/bar" ) << std::endl;
- fs::path round_trip;
- ss >> round_trip;
- BOOST_TEST( round_trip.string() == "foo/bar" );
- std::cout << round_trip.string() << "..." << round_trip << " complete\n";
-# endif
-
- return ::boost::report_errors();
-}

Deleted: branches/release/libs/filesystem/test/wide_test.cpp
==============================================================================
--- branches/release/libs/filesystem/test/wide_test.cpp 2010-07-06 07:17:54 EDT (Tue, 06 Jul 2010)
+++ (empty file)
@@ -1,161 +0,0 @@
-// Boost wide_test.cpp -----------------------------------------------------//
-
-// Copyright Beman Dawes 2005
-
-// 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 library home page at http://www.boost.org/libs/filesystem
-
-#include <boost/config/warning_disable.hpp>
-
-// See deprecated_test for tests of deprecated features
-#define BOOST_FILESYSTEM_NO_DEPRECATED
-
-#include <boost/filesystem/config.hpp>
-# ifdef BOOST_FILESYSTEM_NARROW_ONLY
-# error This compiler or standard library does not support wide-character strings or paths
-# endif
-
-#include <boost/filesystem/operations.hpp>
-#include <boost/filesystem/fstream.hpp>
-#include <boost/scoped_array.hpp>
-#include <boost/detail/lightweight_test.hpp>
-
-#include "../src/utf8_codecvt_facet.hpp"
-
-namespace fs = boost::filesystem;
-
-#include <iostream>
-#include <iomanip>
-#include <ios>
-#include <string>
-#include <cerrno>
-
-#include "lpath.hpp"
-
-namespace
-{
- bool cleanup = true;
-
- template< class Path >
- void create_file( const Path & ph, const std::string & contents )
- {
- // TODO: why missing symbol error on Darwin
-# ifndef __APPLE__
- fs::ofstream f( ph );
-# else
- std::ofstream f( ph.external_file_string().c_str() );
-# endif
- if ( !f )
- throw fs::basic_filesystem_error<Path>( "wide_test create_file",
- ph,
- boost::system::error_code( errno, boost::system::errno_ecat ) );
- if ( !contents.empty() ) f << contents;
- }
-
- template< class Path >
- void test( const Path & dir, const Path & file, const Path & dot )
- {
- Path tmp;
- tmp = file;
- BOOST_TEST( tmp == file );
- tmp = file.string();
- BOOST_TEST( tmp == file );
- tmp = file.string().c_str();
- BOOST_TEST( tmp == file );
- fs::initial_path<Path>();
- fs::current_path<Path>();
- fs::remove( dir / file );
- fs::remove( dir );
- BOOST_TEST( !fs::exists( dir / file ) );
- BOOST_TEST( !fs::exists( dir ) );
- BOOST_TEST( fs::create_directory( dir ) );
- BOOST_TEST( fs::exists( dir ) );
- BOOST_TEST( fs::is_directory( dir ) );
- BOOST_TEST( fs::is_empty( dir ) );
- create_file( dir / file, "wide_test file contents" );
- BOOST_TEST( fs::exists( dir / file ) );
- BOOST_TEST( !fs::is_directory( dir / file ) );
- BOOST_TEST( !fs::is_empty( dir / file ) );
- BOOST_TEST( fs::file_size( dir / file ) == 23 || fs::file_size( dir / file ) == 24 );
- BOOST_TEST( fs::equivalent( dir / file, dot / dir / file ) );
- BOOST_TEST( fs::last_write_time( dir / file ) );
- typedef fs::basic_directory_iterator<Path> it_t;
- int count(0);
- for ( it_t it( dir ); it != it_t(); ++it )
- {
- BOOST_TEST( it->path() == dir / file );
- BOOST_TEST( !fs::is_empty( it->path() ) );
- ++count;
- }
- BOOST_TEST( count == 1 );
- if ( cleanup )
- {
- fs::remove( dir / file );
- fs::remove( dir );
- }
- }
-
- // test boost::detail::utf8_codecvt_facet - even though it is not used by
- // Boost.Filesystem on Windows, early detection of problems is worthwhile.
- std::string to_external( const std::wstring & src )
- {
- fs::detail::utf8_codecvt_facet convertor;
- std::size_t work_size( convertor.max_length() * (src.size()+1) );
- boost::scoped_array<char> work( new char[ work_size ] );
- std::mbstate_t state;
- const wchar_t * from_next;
- char * to_next;
- if ( convertor.out(
- state, src.c_str(), src.c_str()+src.size(), from_next, work.get(),
- work.get()+work_size, to_next ) != std::codecvt_base::ok )
- boost::throw_exception( std::runtime_error("to_external conversion error") );
- *to_next = '\0';
- return std::string( work.get() );
- }
-
-} // unnamed namespace
-
-// main ------------------------------------------------------------------------------//
-
-int 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 );
- fs::wpath_traits::imbue( loc );
-
- std::string s( to_external( L"\x2780" ) );
- for (std::size_t i = 0; i < s.size(); ++i )
- std::cout << std::hex << int( static_cast<unsigned char>(s[i]) ) << " ";
- std::cout << std::dec << std::endl;
- BOOST_TEST( to_external( L"\x2780" ).size() == 3 );
- BOOST_TEST( to_external( L"\x2780" ) == "\xE2\x9E\x80" );
-
- // test fs::path
- std::cout << "begin path test..." << std::endl;
- test( fs::path( "foo" ), fs::path( "bar" ), fs::path( "." ) );
- std::cout << "complete\n\n";
-
- // test fs::wpath
- // x2780 is circled 1 against white background == e2 9e 80 in UTF-8
- // x2781 is circled 2 against white background == e2 9e 81 in UTF-8
- std::cout << "begin wpath test..." << std::endl;
- test( fs::wpath( L"\x2780" ), fs::wpath( L"\x2781" ), fs::wpath( L"." ) );
- std::cout << "complete\n\n";
-
- // test user supplied basic_path
- const long dir[] = { 'b', 'o', 'o', 0 };
- const long file[] = { 'f', 'a', 'r', 0 };
- const long dot[] = { '.', 0 };
- std::cout << "begin lpath test..." << std::endl;
- test( ::user::lpath( dir ), ::user::lpath( file ), ::user::lpath( dot ) );
- std::cout << "complete\n\n";
-
- return ::boost::report_errors();
-}


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