|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r51966 - in trunk: boost/detail libs/filesystem/test libs/filesystem/test/msvc libs/filesystem/test/msvc/filesystem_dll libs/filesystem/test/msvc/wide_test libs/system/test
From: bdawes_at_[hidden]
Date: 2009-03-25 08:11:49
Author: bemandawes
Date: 2009-03-25 08:11:47 EDT (Wed, 25 Mar 2009)
New Revision: 51966
URL: http://svn.boost.org/trac/boost/changeset/51966
Log:
System, Filesystem: remove boost/detail/test_framework.hpp; use boost/detail/lightweight_test.hpp instead (Thanks to Peter Dimov for pointing this out)
Removed:
trunk/boost/detail/test_framework.hpp
Text files modified:
trunk/libs/filesystem/test/convenience_test.cpp | 84 +-
trunk/libs/filesystem/test/deprecated_test.cpp | 46
trunk/libs/filesystem/test/fstream_test.cpp | 36
trunk/libs/filesystem/test/msvc/boost_filesystem.sln | 10
trunk/libs/filesystem/test/msvc/filesystem_dll/filesystem_dll.vcproj | 1
trunk/libs/filesystem/test/msvc/wide_test/wide_test.vcproj | 1
trunk/libs/filesystem/test/operations_test.cpp | 580 +++++++++---------
trunk/libs/filesystem/test/path_test.cpp | 1188 ++++++++++++++++++++--------------------
trunk/libs/filesystem/test/wide_test.cpp | 44
trunk/libs/system/test/error_code_test.cpp | 212 +++---
10 files changed, 1107 insertions(+), 1095 deletions(-)
Deleted: trunk/boost/detail/test_framework.hpp
==============================================================================
--- trunk/boost/detail/test_framework.hpp 2009-03-25 08:11:47 EDT (Wed, 25 Mar 2009)
+++ (empty file)
@@ -1,37 +0,0 @@
-// test_framework.hpp ----------------------------------------------------------------//
-
-// Copyright Beman Dawes 2009
-
-// Distributed under the Boost Software License, Version 1.0.
-// See http://www.boost.org/LICENSE_1_0.txt
-
-// A very simple test framework that avoids dependencies on Boost.Test
-
-#include <iostream>
-
-namespace boost
-{
- namespace test_framework
- {
- int error_count = 0;
-
- void check( const char * predicate, const char * file, int line )
- {
- ++error_count;
-
- // format chosen to parse with VC++ IDE output
- std::cout << file << "(" << line << ") : error: "
- << predicate << " is false\n" << std::endl;
- }
-
- int errors()
- {
- std::cout << " ***** " << error_count << " error(s) detected *****\n";
- return error_count;
- }
- } // namespace test_framework
-} // namespace boost
-
-#define BOOST_CHECK(predicate) \
- (predicate) ? static_cast<void>(0) : \
- boost::test_framework::check( #predicate, __FILE__, __LINE__ )
Modified: trunk/libs/filesystem/test/convenience_test.cpp
==============================================================================
--- trunk/libs/filesystem/test/convenience_test.cpp (original)
+++ trunk/libs/filesystem/test/convenience_test.cpp 2009-03-25 08:11:47 EDT (Wed, 25 Mar 2009)
@@ -18,7 +18,7 @@
using fs::path;
namespace sys = boost::system;
-#include <boost/detail/test_framework.hpp>
+#include <boost/detail/lightweight_test.hpp>
#include <boost/bind.hpp>
#include <fstream>
#include <iostream>
@@ -58,40 +58,40 @@
// create_directories() tests ----------------------------------------------//
- BOOST_CHECK( !fs::create_directories( "" ) ); // should be harmless
- BOOST_CHECK( !fs::create_directories( "/" ) ); // ditto
+ BOOST_TEST( !fs::create_directories( "" ) ); // should be harmless
+ BOOST_TEST( !fs::create_directories( "/" ) ); // ditto
fs::remove_all( "xx" ); // make sure slate is blank
- BOOST_CHECK( !fs::exists( "xx" ) ); // reality check
+ BOOST_TEST( !fs::exists( "xx" ) ); // reality check
- BOOST_CHECK( fs::create_directories( "xx" ) );
- BOOST_CHECK( fs::exists( "xx" ) );
- BOOST_CHECK( fs::is_directory( "xx" ) );
-
- BOOST_CHECK( fs::create_directories( "xx/yy/zz" ) );
- BOOST_CHECK( fs::exists( "xx" ) );
- BOOST_CHECK( fs::exists( "xx/yy" ) );
- BOOST_CHECK( fs::exists( "xx/yy/zz" ) );
- BOOST_CHECK( fs::is_directory( "xx" ) );
- BOOST_CHECK( fs::is_directory( "xx/yy" ) );
- BOOST_CHECK( fs::is_directory( "xx/yy/zz" ) );
+ 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_CHECK( !!f );
+ BOOST_TEST( !!f );
}
- BOOST_CHECK( throws_fs_error(
+ BOOST_TEST( throws_fs_error(
boost::bind( BOOST_BND(fs::create_directories), is_a_file ) ) );
- BOOST_CHECK( throws_fs_error(
+ 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_CHECK( ec );
- BOOST_CHECK( throws_fs_error(
+ BOOST_TEST( ec );
+ BOOST_TEST( throws_fs_error(
boost::bind( create_recursive_iterator, "/no-such-path" ) ) );
fs::remove( "xx/uu" );
@@ -101,7 +101,7 @@
// on Windows but not necessarily on other operating systems
{
std::ofstream f( "xx/yya" );
- BOOST_CHECK( !!f );
+ BOOST_TEST( !!f );
}
for ( it = fs::recursive_directory_iterator( "xx" );
@@ -109,51 +109,51 @@
{ std::cout << it->path() << '\n'; }
it = fs::recursive_directory_iterator( "xx" );
- BOOST_CHECK( it->path() == "xx/yy" );
- BOOST_CHECK( it.level() == 0 );
+ BOOST_TEST( it->path() == "xx/yy" );
+ BOOST_TEST( it.level() == 0 );
++it;
- BOOST_CHECK( it->path() == "xx/yy/zz" );
- BOOST_CHECK( it.level() == 1 );
+ BOOST_TEST( it->path() == "xx/yy/zz" );
+ BOOST_TEST( it.level() == 1 );
it.pop();
- BOOST_CHECK( it->path() == "xx/yya" );
- BOOST_CHECK( it.level() == 0 );
+ BOOST_TEST( it->path() == "xx/yya" );
+ BOOST_TEST( it.level() == 0 );
it++;
- BOOST_CHECK( it == fs::recursive_directory_iterator() );
+ BOOST_TEST( it == fs::recursive_directory_iterator() );
it = fs::recursive_directory_iterator( "xx" );
- BOOST_CHECK( it->path() == "xx/yy" );
+ BOOST_TEST( it->path() == "xx/yy" );
it.no_push();
++it;
- BOOST_CHECK( it->path() == "xx/yya" );
+ BOOST_TEST( it->path() == "xx/yya" );
++it;
- BOOST_CHECK( it == fs::recursive_directory_iterator() );
+ BOOST_TEST( it == fs::recursive_directory_iterator() );
fs::remove( "xx/yya" );
#endif
it = fs::recursive_directory_iterator( "xx/yy/zz" );
- BOOST_CHECK( it == fs::recursive_directory_iterator() );
+ BOOST_TEST( it == fs::recursive_directory_iterator() );
it = fs::recursive_directory_iterator( "xx" );
- BOOST_CHECK( it->path() == "xx/yy" );
- BOOST_CHECK( it.level() == 0 );
+ BOOST_TEST( it->path() == "xx/yy" );
+ BOOST_TEST( it.level() == 0 );
++it;
- BOOST_CHECK( it->path() == "xx/yy/zz" );
- BOOST_CHECK( it.level() == 1 );
+ BOOST_TEST( it->path() == "xx/yy/zz" );
+ BOOST_TEST( it.level() == 1 );
it++;
- BOOST_CHECK( it == fs::recursive_directory_iterator() );
+ BOOST_TEST( it == fs::recursive_directory_iterator() );
it = fs::recursive_directory_iterator( "xx" );
- BOOST_CHECK( it->path() == "xx/yy" );
+ BOOST_TEST( it->path() == "xx/yy" );
it.no_push();
++it;
- BOOST_CHECK( it == fs::recursive_directory_iterator() );
+ BOOST_TEST( it == fs::recursive_directory_iterator() );
it = fs::recursive_directory_iterator( "xx" );
- BOOST_CHECK( it->path() == "xx/yy" );
+ BOOST_TEST( it->path() == "xx/yy" );
++it;
it.pop();
- BOOST_CHECK( it == fs::recursive_directory_iterator() );
+ BOOST_TEST( it == fs::recursive_directory_iterator() );
@@ -163,5 +163,5 @@
- return boost::test_framework::errors();
+ return ::boost::report_errors();
}
Modified: trunk/libs/filesystem/test/deprecated_test.cpp
==============================================================================
--- trunk/libs/filesystem/test/deprecated_test.cpp (original)
+++ trunk/libs/filesystem/test/deprecated_test.cpp 2009-03-25 08:11:47 EDT (Wed, 25 Mar 2009)
@@ -13,7 +13,7 @@
// important to preserve existing code that uses the old names.
#include <boost/filesystem.hpp>
-#include <boost/detail/test_framework.hpp>
+#include <boost/detail/lightweight_test.hpp>
namespace fs = boost::filesystem;
using boost::filesystem::path;
@@ -29,7 +29,7 @@
{
if ( source.string()== expected ) return;
- ++boost::test_framework::error_count;
+ ++::boost::detail::test_errors();
std::cout << '(' << line << ") source.string(): \"" << source.string()
<< "\" != expected: \"" << expected
@@ -165,38 +165,38 @@
de.string();
fs::path ng( " no-way, Jose" );
- BOOST_CHECK( !fs::is_regular( ng ) ); // verify deprecated name still works
- BOOST_CHECK( !fs::symbolic_link_exists( "nosuchfileordirectory" ) );
+ BOOST_TEST( !fs::is_regular( ng ) ); // verify deprecated name still works
+ BOOST_TEST( !fs::symbolic_link_exists( "nosuchfileordirectory" ) );
check_normalize();
// extension() tests ---------------------------------------------------------//
- BOOST_CHECK( fs::extension("a/b") == "" );
- BOOST_CHECK( fs::extension("a/b.txt") == ".txt" );
- BOOST_CHECK( fs::extension("a/b.") == "." );
- BOOST_CHECK( fs::extension("a.b.c") == ".c" );
- BOOST_CHECK( fs::extension("a.b.c.") == "." );
- BOOST_CHECK( fs::extension("") == "" );
- BOOST_CHECK( fs::extension("a/") == "." );
+ 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_CHECK( fs::basename("b") == "b" );
- BOOST_CHECK( fs::basename("a/b.txt") == "b" );
- BOOST_CHECK( fs::basename("a/b.") == "b" );
- BOOST_CHECK( fs::basename("a.b.c") == "a.b" );
- BOOST_CHECK( fs::basename("a.b.c.") == "a.b.c" );
- BOOST_CHECK( fs::basename("") == "" );
+ 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_CHECK( fs::change_extension("a.txt", ".tex").string() == "a.tex" );
- BOOST_CHECK( fs::change_extension("a.", ".tex").string() == "a.tex" );
- BOOST_CHECK( fs::change_extension("a", ".txt").string() == "a.txt" );
- BOOST_CHECK( fs::change_extension("a.b.txt", ".tex").string() == "a.b.tex" );
+ 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_CHECK( fs::change_extension("", ".png").string() == ".png" );
+ BOOST_TEST( fs::change_extension("", ".png").string() == ".png" );
- return boost::test_framework::errors();
+ return ::boost::report_errors();
}
Modified: trunk/libs/filesystem/test/fstream_test.cpp
==============================================================================
--- trunk/libs/filesystem/test/fstream_test.cpp (original)
+++ trunk/libs/filesystem/test/fstream_test.cpp 2009-03-25 08:11:47 EDT (Wed, 25 Mar 2009)
@@ -31,7 +31,7 @@
namespace std { using ::remove; }
#endif
-#include <boost/detail/test_framework.hpp>
+#include <boost/detail/lightweight_test.hpp>
namespace
{
@@ -45,19 +45,19 @@
std::cout << " in test 1\n";
fs::filebuf fb;
fb.open( p, std::ios_base::in );
- BOOST_CHECK( fb.is_open() == fs::exists( p ) );
+ 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_CHECK( fb1.is_open() );
+ BOOST_TEST( fb1.is_open() );
}
{
std::cout << " in test 3\n";
fs::filebuf fb2;
fb2.open( p, std::ios_base::in );
- BOOST_CHECK( fb2.is_open() );
+ BOOST_TEST( fb2.is_open() );
}
# else
std::cout << "<note>\n";
@@ -67,78 +67,78 @@
{
std::cout << " in test 4\n";
fs::ifstream tfs( p );
- BOOST_CHECK( tfs.is_open() );
+ BOOST_TEST( tfs.is_open() );
}
{
std::cout << " in test 4.1\n";
fs::ifstream tfs( p / p.filename() ); // should fail
- BOOST_CHECK( !tfs.is_open() );
+ BOOST_TEST( !tfs.is_open() );
}
{
std::cout << " in test 5\n";
fs::ifstream tfs( p, std::ios_base::in );
- BOOST_CHECK( tfs.is_open() );
+ 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_CHECK( tfs.is_open() );
+ BOOST_TEST( tfs.is_open() );
}
{
std::cout << " in test 7\n";
fs::ifstream tfs;
tfs.open( p, std::ios_base::in );
- BOOST_CHECK( tfs.is_open() );
+ BOOST_TEST( tfs.is_open() );
}
# endif
{
std::cout << " in test 8\n";
fs::ofstream tfs( p );
- BOOST_CHECK( tfs.is_open() );
+ BOOST_TEST( tfs.is_open() );
}
{
std::cout << " in test 9\n";
fs::ofstream tfs( p, std::ios_base::out );
- BOOST_CHECK( tfs.is_open() );
+ 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_CHECK( tfs.is_open() );
+ BOOST_TEST( tfs.is_open() );
}
{
std::cout << " in test 11\n";
fs::ofstream tfs;
tfs.open( p, std::ios_base::out );
- BOOST_CHECK( tfs.is_open() );
+ BOOST_TEST( tfs.is_open() );
}
# endif
{
std::cout << " in test 12\n";
fs::fstream tfs( p );
- BOOST_CHECK( tfs.is_open() );
+ BOOST_TEST( tfs.is_open() );
}
{
std::cout << " in test 13\n";
fs::fstream tfs( p, std::ios_base::in|std::ios_base::out );
- BOOST_CHECK( tfs.is_open() );
+ 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_CHECK( tfs.is_open() );
+ 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_CHECK( tfs.is_open() );
+ BOOST_TEST( tfs.is_open() );
}
# endif
@@ -176,5 +176,5 @@
#endif
- return boost::test_framework::errors();
+ return ::boost::report_errors();
}
Modified: trunk/libs/filesystem/test/msvc/boost_filesystem.sln
==============================================================================
--- trunk/libs/filesystem/test/msvc/boost_filesystem.sln (original)
+++ trunk/libs/filesystem/test/msvc/boost_filesystem.sln 2009-03-25 08:11:47 EDT (Wed, 25 Mar 2009)
@@ -62,6 +62,12 @@
{F31C02C7-63A4-489C-A176-695D68E5BCA4} = {F31C02C7-63A4-489C-A176-695D68E5BCA4}
EndProjectSection
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ticket_2260_test", "ticket_2260_test\ticket_2260_test.vcproj", "{55659CA2-BDEC-427D-8325-C8AE1C9AFF86}"
+ ProjectSection(ProjectDependencies) = postProject
+ {15371D22-F930-4286-9126-C3516E78CB09} = {15371D22-F930-4286-9126-C3516E78CB09}
+ {F31C02C7-63A4-489C-A176-695D68E5BCA4} = {F31C02C7-63A4-489C-A176-695D68E5BCA4}
+ EndProjectSection
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@@ -112,6 +118,10 @@
{EA1530CD-7058-4912-8B51-8D55A07F0A1D}.Debug|Win32.Build.0 = Debug|Win32
{EA1530CD-7058-4912-8B51-8D55A07F0A1D}.Release|Win32.ActiveCfg = Release|Win32
{EA1530CD-7058-4912-8B51-8D55A07F0A1D}.Release|Win32.Build.0 = Release|Win32
+ {55659CA2-BDEC-427D-8325-C8AE1C9AFF86}.Debug|Win32.ActiveCfg = Debug|Win32
+ {55659CA2-BDEC-427D-8325-C8AE1C9AFF86}.Debug|Win32.Build.0 = Debug|Win32
+ {55659CA2-BDEC-427D-8325-C8AE1C9AFF86}.Release|Win32.ActiveCfg = Release|Win32
+ {55659CA2-BDEC-427D-8325-C8AE1C9AFF86}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Modified: trunk/libs/filesystem/test/msvc/filesystem_dll/filesystem_dll.vcproj
==============================================================================
--- trunk/libs/filesystem/test/msvc/filesystem_dll/filesystem_dll.vcproj (original)
+++ trunk/libs/filesystem/test/msvc/filesystem_dll/filesystem_dll.vcproj 2009-03-25 08:11:47 EDT (Wed, 25 Mar 2009)
@@ -46,6 +46,7 @@
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
+ DefaultCharIsUnsigned="false"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="4"
Modified: trunk/libs/filesystem/test/msvc/wide_test/wide_test.vcproj
==============================================================================
--- trunk/libs/filesystem/test/msvc/wide_test/wide_test.vcproj (original)
+++ trunk/libs/filesystem/test/msvc/wide_test/wide_test.vcproj 2009-03-25 08:11:47 EDT (Wed, 25 Mar 2009)
@@ -46,6 +46,7 @@
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
+ DefaultCharIsUnsigned="false"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="4"
Modified: trunk/libs/filesystem/test/operations_test.cpp
==============================================================================
--- trunk/libs/filesystem/test/operations_test.cpp (original)
+++ trunk/libs/filesystem/test/operations_test.cpp 2009-03-25 08:11:47 EDT (Wed, 25 Mar 2009)
@@ -18,7 +18,7 @@
namespace fs = boost::filesystem;
#include <boost/config.hpp>
-#include <boost/detail/test_framework.hpp>
+#include <boost/detail/lightweight_test.hpp>
using boost::system::error_code;
using boost::system::system_category;
@@ -148,11 +148,11 @@
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_CHECK( std::strncmp( x.what(),
+ BOOST_TEST( std::strncmp( x.what(),
"boost::filesystem::create_directory",
sizeof("boost::filesystem::create_directory")-1 ) == 0 );
}
- BOOST_CHECK( exception_thrown );
+ BOOST_TEST( exception_thrown );
exception_thrown = false;
try
@@ -164,10 +164,10 @@
exception_thrown = true;
if ( report_throws ) std::cout << x.what() << std::endl;
if ( platform == "Windows" && language_id == 0x0409 ) // English (United States)
- BOOST_CHECK( std::strcmp( x.what(),
+ BOOST_TEST( std::strcmp( x.what(),
"boost::filesystem::create_directory: The system cannot find the path specified" ) == 0 );
}
- BOOST_CHECK( exception_thrown );
+ BOOST_TEST( exception_thrown );
exception_thrown = false;
try
@@ -182,14 +182,14 @@
{
bool ok ( std::strcmp( x.what(),
"boost::filesystem::create_directory: The system cannot find the path specified: \"no-such-dir\\foo\\bar\"" ) == 0 );
- BOOST_CHECK( ok );
+ BOOST_TEST( ok );
if ( !ok )
{
std::cout << "what returns \"" << x.what() << "\"" << std::endl;
}
}
}
- BOOST_CHECK( exception_thrown );
+ BOOST_TEST( exception_thrown );
exception_thrown = false;
try
@@ -204,14 +204,14 @@
{
bool ok ( std::strcmp( x.what(),
"boost::filesystem::create_directory: The system cannot find the path specified: \"no-such-dir\\foo\\bar\"" ) == 0 );
- BOOST_CHECK( ok );
+ BOOST_TEST( ok );
if ( !ok )
{
std::cout << "what returns \"" << x.what() << "\"" << std::endl;
}
}
}
- BOOST_CHECK( exception_thrown );
+ BOOST_TEST( exception_thrown );
}
void bad_file_size()
@@ -290,45 +290,45 @@
std::cout << "\ninitial_path<fs::path>().file_string() is\n \""
<< fs::initial_path<fs::path>().file_string()
<< "\"\n\n";
- BOOST_CHECK( fs::initial_path<fs::path>().is_complete() );
- BOOST_CHECK( fs::current_path<fs::path>().is_complete() );
- BOOST_CHECK( fs::initial_path<fs::path>().string()
+ 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_CHECK( fs::complete( "" ).empty() );
- BOOST_CHECK( fs::complete( "/" ).string() == fs::initial_path<fs::path>().root_path().string() );
- BOOST_CHECK( fs::complete( "foo" ).string() == fs::initial_path<fs::path>().string()+"/foo" );
- BOOST_CHECK( fs::complete( "/foo" ).string() == fs::initial_path<fs::path>().root_path().string()+"foo" );
- BOOST_CHECK( fs::complete( "foo", fs::path( "//net/bar" ) ).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_CHECK( fs::exists( "/" ) );
+ BOOST_TEST( fs::exists( "/" ) );
fs::path ng( " no-way, Jose" );
- BOOST_CHECK( !fs::exists( ng ) );
- BOOST_CHECK( !fs::is_directory( ng ) );
- BOOST_CHECK( !fs::is_regular_file( ng ) );
- BOOST_CHECK( !fs::is_symlink( ng ) );
+ 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_CHECK( fs::status_known( stat ) );
- BOOST_CHECK( !fs::exists( stat ) );
- BOOST_CHECK( !fs::is_directory( stat ) );
- BOOST_CHECK( !fs::is_regular_file( stat ) );
- BOOST_CHECK( !fs::is_other( stat ) );
- BOOST_CHECK( !fs::is_symlink( stat ) );
+ 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_CHECK( fs::status_known( stat ) );
- BOOST_CHECK( !fs::exists( stat ) );
- BOOST_CHECK( !fs::is_directory( stat ) );
- BOOST_CHECK( !fs::is_regular_file( stat ) );
- BOOST_CHECK( !fs::is_other( stat ) );
- BOOST_CHECK( !fs::is_symlink( stat ) );
+ 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_CHECK( !fs::exists( dir ) );
+ BOOST_TEST( !fs::exists( dir ) );
// create a directory, then check it for consistency
// take extra care to report problems, since if this fails
@@ -356,102 +356,102 @@
return 1;
}
- BOOST_CHECK( fs::exists( dir ) );
- BOOST_CHECK( BOOST_FS_IS_EMPTY( dir ) );
- BOOST_CHECK( fs::is_directory( dir ) );
- BOOST_CHECK( !fs::is_regular_file( dir ) );
- BOOST_CHECK( !fs::is_other( dir ) );
- BOOST_CHECK( !fs::is_symlink( dir ) );
+ 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_CHECK( fs::exists( stat ) );
- BOOST_CHECK( fs::is_directory( stat ) );
- BOOST_CHECK( !fs::is_regular_file( stat ) );
- BOOST_CHECK( !fs::is_other( stat ) );
- BOOST_CHECK( !fs::is_symlink( 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 ) );
// Windows only tests
if ( platform == "Windows" )
{
- BOOST_CHECK( !fs::exists( fs::path( "//share-not" ) ) );
- BOOST_CHECK( !fs::exists( fs::path( "//share-not/" ) ) );
- BOOST_CHECK( !fs::exists( fs::path( "//share-not/foo" ) ) );
- BOOST_CHECK( !fs::exists( "tools/jam/src/:sys:stat.h" ) ); // !exists() if ERROR_INVALID_NAME
- BOOST_CHECK( !fs::exists( ":sys:stat.h" ) ); // !exists() if ERROR_INVALID_PARAMETER
- BOOST_CHECK( !fs::exists( "1:/" ) );
- BOOST_CHECK( dir.string().size() > 1
+ 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_CHECK( fs::system_complete( "" ).empty() );
- BOOST_CHECK( fs::system_complete( "/" ).string()
+ BOOST_TEST( fs::system_complete( "" ).empty() );
+ BOOST_TEST( fs::system_complete( "/" ).string()
== fs::initial_path<fs::path>().root_path().string() );
- BOOST_CHECK( fs::system_complete( "foo" ).string()
+ BOOST_TEST( fs::system_complete( "foo" ).string()
== fs::initial_path<fs::path>().string()+"/foo" );
- BOOST_CHECK( fs::system_complete( "/foo" ).string()
+ BOOST_TEST( fs::system_complete( "/foo" ).string()
== fs::initial_path<fs::path>().root_path().string()+"foo" );
- BOOST_CHECK( fs::complete( fs::path( "c:/" ) ).string()
+ BOOST_TEST( fs::complete( fs::path( "c:/" ) ).string()
== "c:/" );
- BOOST_CHECK( fs::complete( fs::path( "c:/foo" ) ).string()
+ BOOST_TEST( fs::complete( fs::path( "c:/foo" ) ).string()
== "c:/foo" );
- BOOST_CHECK( fs::system_complete( fs::path( fs::initial_path<fs::path>().root_name() ) ).string() == fs::initial_path<fs::path>().string() );
- BOOST_CHECK( fs::system_complete( fs::path( fs::initial_path<fs::path>().root_name()
+ 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_CHECK( fs::system_complete( fs::path( "c:/" ) ).string()
+ BOOST_TEST( fs::system_complete( fs::path( "c:/" ) ).string()
== "c:/" );
- BOOST_CHECK( fs::system_complete( fs::path( "c:/foo" ) ).string()
+ BOOST_TEST( fs::system_complete( fs::path( "c:/foo" ) ).string()
== "c:/foo" );
- BOOST_CHECK( fs::system_complete( fs::path( "//share" ) ).string()
+ BOOST_TEST( fs::system_complete( fs::path( "//share" ) ).string()
== "//share" );
} // Windows
else if ( platform == "POSIX" )
{
- BOOST_CHECK( fs::system_complete( "" ).empty() );
- BOOST_CHECK( fs::initial_path<fs::path>().root_path().string() == "/" );
- BOOST_CHECK( fs::system_complete( "/" ).string() == "/" );
- BOOST_CHECK( fs::system_complete( "foo" ).string()
+ 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_CHECK( fs::system_complete( "/foo" ).string()
+ 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_CHECK( CHECK_EXCEPTION( bad_file_size, ENOENT ) );
+ 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_CHECK( ex.path1().string() == " no-way, Jose" );
+ 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_CHECK( sizeof( boost::uintmax_t ) >= 8 );
+ 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_CHECK( dir != original_dir );
+ BOOST_TEST( dir != original_dir );
fs::current_path( dir );
- BOOST_CHECK( fs::current_path<fs::path>() == dir );
- BOOST_CHECK( fs::current_path<fs::path>() != original_dir );
+ BOOST_TEST( fs::current_path<fs::path>() == dir );
+ BOOST_TEST( fs::current_path<fs::path>() != original_dir );
fs::current_path( original_dir );
- BOOST_CHECK( fs::current_path<fs::path>() == original_dir );
- BOOST_CHECK( fs::current_path<fs::path>() != 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_CHECK( fs::current_path<fs::path>() == dir );
- BOOST_CHECK( fs::current_path<fs::path>() != original_dir );
+ BOOST_TEST( fs::current_path<fs::path>() == dir );
+ BOOST_TEST( fs::current_path<fs::path>() != original_dir );
fs::current_path( original_dir.string() );
- BOOST_CHECK( fs::current_path<fs::path>() == original_dir );
- BOOST_CHECK( fs::current_path<fs::path>() != dir );
+ 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_CHECK( spi.capacity > 1000000 );
- BOOST_CHECK( spi.free > 1000 );
- BOOST_CHECK( spi.capacity > spi.free );
- BOOST_CHECK( spi.free >= spi.available );
+ 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
@@ -461,117 +461,117 @@
# endif
if ( platform == "Windows" )
- BOOST_CHECK( CHECK_EXCEPTION( bad_directory_size, ENOENT ) );
+ BOOST_TEST( CHECK_EXCEPTION( bad_directory_size, ENOENT ) );
else
- BOOST_CHECK( CHECK_EXCEPTION( bad_directory_size, 0 ) );
- BOOST_CHECK( !fs::create_directory( dir ) );
+ BOOST_TEST( CHECK_EXCEPTION( bad_directory_size, 0 ) );
+ BOOST_TEST( !fs::create_directory( dir ) );
- BOOST_CHECK( !fs::is_symlink( dir ) );
- BOOST_CHECK( !fs::is_symlink( "nosuchfileordirectory" ) );
+ BOOST_TEST( !fs::is_symlink( dir ) );
+ BOOST_TEST( !fs::is_symlink( "nosuchfileordirectory" ) );
fs::path d1( dir / "d1" );
- BOOST_CHECK( fs::create_directory( d1 ) );
- BOOST_CHECK( fs::exists( d1 ) );
- BOOST_CHECK( fs::is_directory( d1 ) );
- BOOST_CHECK( BOOST_FS_IS_EMPTY( 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_CHECK( dir_itr_exception );
+ 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_CHECK( dir_itr_exception );
+ BOOST_TEST( dir_itr_exception );
dir_itr_exception = false;
try
{
error_code ec;
fs::directory_iterator it( "nosuchdirectory", ec );
- BOOST_CHECK( ec );
- BOOST_CHECK( ec == fs::detail::not_found_error() );
+ BOOST_TEST( ec );
+ BOOST_TEST( ec == fs::detail::not_found_error() );
}
catch ( const fs::filesystem_error & ) { dir_itr_exception = true; }
- BOOST_CHECK( !dir_itr_exception );
+ BOOST_TEST( !dir_itr_exception );
{
// probe query function overloads
fs::directory_iterator dir_itr( dir );
- BOOST_CHECK( fs::is_directory( *dir_itr ) );
- BOOST_CHECK( fs::is_directory( dir_itr->status() ) );
- BOOST_CHECK( fs::is_directory( fs::symlink_status(*dir_itr) ) );
- BOOST_CHECK( fs::is_directory( dir_itr->symlink_status() ) );
- BOOST_CHECK( dir_itr->path().filename() == "d1" );
+ 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_CHECK( fs::exists( d2 ) );
- BOOST_CHECK( fs::is_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_CHECK( fs::exists(dir_itr->status()) );
- BOOST_CHECK( fs::is_directory(dir_itr->status()) );
- BOOST_CHECK( !fs::is_regular_file(dir_itr->status()) );
- BOOST_CHECK( !fs::is_other(dir_itr->status()) );
- BOOST_CHECK( !fs::is_symlink(dir_itr->status()) );
+ 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_CHECK( dir_itr->path().filename() == "d1"
+ BOOST_TEST( dir_itr->path().filename() == "d1"
|| dir_itr->path().filename() == "d2" );
- BOOST_CHECK( dir_itr2->path().filename() == "d1" || dir_itr2->path().filename() == "d2" );
+ BOOST_TEST( dir_itr2->path().filename() == "d1" || dir_itr2->path().filename() == "d2" );
if ( dir_itr->path().filename() == "d1" )
{
- BOOST_CHECK( (++dir_itr)->path().filename() == "d2" );
- BOOST_CHECK( dir_itr2->path().filename() == "d1" );
- BOOST_CHECK( (++dir_itr2)->path().filename() == "d2" );
+ BOOST_TEST( (++dir_itr)->path().filename() == "d2" );
+ BOOST_TEST( dir_itr2->path().filename() == "d1" );
+ BOOST_TEST( (++dir_itr2)->path().filename() == "d2" );
}
else
{
- BOOST_CHECK( dir_itr->path().filename() == "d2" );
- BOOST_CHECK( (++dir_itr)->path().filename() == "d1" );
- BOOST_CHECK( (dir_itr2)->path().filename() == "d2" );
- BOOST_CHECK( (++dir_itr2)->path().filename() == "d1" );
- }
- BOOST_CHECK( ++dir_itr == fs::directory_iterator() );
- BOOST_CHECK( dir_itr2 != fs::directory_iterator() );
- BOOST_CHECK( ++dir_itr2 == fs::directory_iterator() );
+ 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_CHECK( dir_itr->path().filename() == "d1"
+ BOOST_TEST( dir_itr->path().filename() == "d1"
|| dir_itr->path().filename() == "d2" );
if ( dir_itr->path().filename() == "d1" )
{
- BOOST_CHECK( (*dir_itr++).path().filename() == "d1" );
- BOOST_CHECK( dir_itr->path().filename() == "d2" );
+ BOOST_TEST( (*dir_itr++).path().filename() == "d1" );
+ BOOST_TEST( dir_itr->path().filename() == "d2" );
}
else
{
// Check C++98 input iterator requirements
- BOOST_CHECK( (*dir_itr++).path().filename() == "d2" );
+ BOOST_TEST( (*dir_itr++).path().filename() == "d2" );
// input iterator requirements in the current WP would require this check:
- // BOOST_CHECK( implicit_cast<std::string const&>(*dir_itr++).filename() == "d1" );
+ // BOOST_TEST( implicit_cast<std::string const&>(*dir_itr++).filename() == "d1" );
- BOOST_CHECK( dir_itr->path().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_CHECK( it != fs::directory_iterator() );
+ BOOST_TEST( it != fs::directory_iterator() );
const fs::path p2 = *it++;
- BOOST_CHECK( p1 != p2 );
- BOOST_CHECK( it == fs::directory_iterator() );
+ BOOST_TEST( p1 != p2 );
+ BOOST_TEST( it == fs::directory_iterator() );
}
// Windows has a tricky special case when just the root-name is given,
@@ -581,61 +581,61 @@
{
fs::path root_name_path( fs::current_path<fs::path>().root_name() );
fs::directory_iterator it( root_name_path );
- BOOST_CHECK( it != fs::directory_iterator() );
- BOOST_CHECK( fs::exists( *it ) );
- BOOST_CHECK( it->path().parent_path() == 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_CHECK( found );
+ BOOST_TEST( found );
}
// create an empty file named "f0"
fs::path file_ph( dir / "f0");
create_file( file_ph, "" );
- BOOST_CHECK( fs::exists( file_ph ) );
- BOOST_CHECK( !fs::is_directory( file_ph ) );
- BOOST_CHECK( fs::is_regular_file( file_ph ) );
- BOOST_CHECK( BOOST_FS_IS_EMPTY( file_ph ) );
- BOOST_CHECK( fs::file_size( file_ph ) == 0 );
+ 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_CHECK( CHECK_EXCEPTION( bad_create_directory, EEXIST ) );
+ BOOST_TEST( CHECK_EXCEPTION( bad_create_directory, EEXIST ) );
stat = fs::status( file_ph );
- BOOST_CHECK( fs::status_known( stat ) );
- BOOST_CHECK( fs::exists( stat ) );
- BOOST_CHECK( !fs::is_directory( stat ) );
- BOOST_CHECK( fs::is_regular_file( stat ) );
- BOOST_CHECK( !fs::is_other( stat ) );
- BOOST_CHECK( !fs::is_symlink( stat ) );
+ 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_CHECK( fs::exists( file_ph ) );
- BOOST_CHECK( !fs::is_directory( file_ph ) );
- BOOST_CHECK( fs::is_regular_file( file_ph ) );
- BOOST_CHECK( fs::file_size( file_ph ) == 7 );
+ 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_CHECK( CHECK_EXCEPTION( bad_equivalent, ENOENT ) );
- BOOST_CHECK( fs::equivalent( file_ph, dir / "f1" ) );
- BOOST_CHECK( fs::equivalent( dir, d1 / ".." ) );
- BOOST_CHECK( !fs::equivalent( file_ph, dir ) );
- BOOST_CHECK( !fs::equivalent( dir, file_ph ) );
- BOOST_CHECK( !fs::equivalent( d1, d2 ) );
- BOOST_CHECK( !fs::equivalent( dir, ng ) );
- BOOST_CHECK( !fs::equivalent( ng, dir ) );
- BOOST_CHECK( !fs::equivalent( file_ph, ng ) );
- BOOST_CHECK( !fs::equivalent( ng, file_ph ) );
+ 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_CHECK( !fs::exists( from_ph ) );
- BOOST_CHECK( fs::exists( file_ph ) );
+ 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 )
@@ -651,20 +651,20 @@
{
std::cout << "create_hard_link(\"" << file_ph << "\", \""
<< from_ph << "\") succeeded\n";
- BOOST_CHECK( fs::exists( from_ph ) );
- BOOST_CHECK( fs::exists( file_ph ) );
- BOOST_CHECK( fs::equivalent( from_ph, file_ph ) );
+ BOOST_TEST( fs::exists( from_ph ) );
+ BOOST_TEST( fs::exists( file_ph ) );
+ BOOST_TEST( fs::equivalent( from_ph, file_ph ) );
}
error_code ec;
- BOOST_CHECK( fs::create_hard_link( fs::path("doesnotexist"),
+ BOOST_TEST( fs::create_hard_link( fs::path("doesnotexist"),
fs::path("shouldnotwork"), ec ) );
- BOOST_CHECK( ec );
+ BOOST_TEST( ec );
// symbolic link tests
from_ph = dir / "f4";
- BOOST_CHECK( !fs::exists( from_ph ) );
- BOOST_CHECK( fs::exists( file_ph ) );
+ 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 )
@@ -679,217 +679,217 @@
if ( create_symlink_ok )
{
std::cout << "create_symlink() succeeded\n";
- BOOST_CHECK( fs::exists( from_ph ) );
- BOOST_CHECK( fs::is_symlink( from_ph ) );
- BOOST_CHECK( fs::exists( file_ph ) );
- BOOST_CHECK( fs::equivalent( from_ph, file_ph ) );
+ 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_CHECK( fs::exists( stat ) );
- BOOST_CHECK( !fs::is_directory( stat ) );
- BOOST_CHECK( !fs::is_regular_file( stat ) );
- BOOST_CHECK( !fs::is_other( stat ) );
- BOOST_CHECK( fs::is_symlink( 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 ) );
}
ec = error_code();
- BOOST_CHECK( fs::create_symlink( "doesnotexist", "", ec ) );
- BOOST_CHECK( ec );
+ 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_CHECK( ++di != fs::directory_iterator() );
+ 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_CHECK( fs::exists( file_ph ) );
- BOOST_CHECK( fs::exists( d1 / "f2" ) );
- BOOST_CHECK( !fs::is_directory( d1 / "f2" ) );
+ BOOST_TEST( fs::exists( file_ph ) );
+ BOOST_TEST( fs::exists( d1 / "f2" ) );
+ BOOST_TEST( !fs::is_directory( d1 / "f2" ) );
verify_file( d1 / "f2", "foobar1" );
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_CHECK( !fs::exists( d1 / "f99" ) );
- BOOST_CHECK( !fs::exists( d1 / "f98" ) );
+ BOOST_TEST( !fs::exists( d1 / "f99" ) );
+ BOOST_TEST( !fs::exists( d1 / "f98" ) );
renamer n1a( d1 / "f99", d1 / "f98" );
- BOOST_CHECK( CHECK_EXCEPTION( n1a, ENOENT ) );
+ BOOST_TEST( CHECK_EXCEPTION( n1a, ENOENT ) );
renamer n1b( fs::path(""), d1 / "f98" );
- BOOST_CHECK( CHECK_EXCEPTION( n1b, ENOENT ) );
+ BOOST_TEST( CHECK_EXCEPTION( n1b, ENOENT ) );
// [case 2] rename() target.empty()
renamer n2( file_ph, "" );
- BOOST_CHECK( CHECK_EXCEPTION( n2, ENOENT ) );
+ BOOST_TEST( CHECK_EXCEPTION( n2, ENOENT ) );
// [case 3] make sure can't rename() to an existent file or directory
- BOOST_CHECK( fs::exists( dir / "f1" ) );
- BOOST_CHECK( fs::exists( d1 / "f2" ) );
+ BOOST_TEST( fs::exists( dir / "f1" ) );
+ BOOST_TEST( fs::exists( d1 / "f2" ) );
renamer n3a( dir / "f1", d1 / "f2" );
- BOOST_CHECK( CHECK_EXCEPTION( n3a, EEXIST ) );
+ 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_CHECK( CHECK_EXCEPTION( n3b, 0 ) );
+ BOOST_TEST( CHECK_EXCEPTION( n3b, 0 ) );
// [case 4A] can't rename() file to a nonexistent parent directory
- BOOST_CHECK( !fs::is_directory( dir / "f1" ) );
- BOOST_CHECK( !fs::exists( dir / "d3/f3" ) );
+ BOOST_TEST( !fs::is_directory( dir / "f1" ) );
+ BOOST_TEST( !fs::exists( dir / "d3/f3" ) );
renamer n4a( dir / "f1", dir / "d3/f3" );
- BOOST_CHECK( CHECK_EXCEPTION( n4a, ENOENT ) );
+ BOOST_TEST( CHECK_EXCEPTION( n4a, ENOENT ) );
// [case 4B] rename() file in same directory
- BOOST_CHECK( fs::exists( d1 / "f2" ) );
- BOOST_CHECK( !fs::exists( d1 / "f50" ) );
+ BOOST_TEST( fs::exists( d1 / "f2" ) );
+ BOOST_TEST( !fs::exists( d1 / "f50" ) );
fs::rename( d1 / "f2", d1 / "f50" );
- BOOST_CHECK( !fs::exists( d1 / "f2" ) );
- BOOST_CHECK( fs::exists( d1 / "f50" ) );
+ BOOST_TEST( !fs::exists( d1 / "f2" ) );
+ BOOST_TEST( fs::exists( d1 / "f50" ) );
fs::rename( d1 / "f50", d1 / "f2" );
- BOOST_CHECK( fs::exists( d1 / "f2" ) );
- BOOST_CHECK( !fs::exists( d1 / "f50" ) );
+ 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_CHECK( !fs::exists( d1 / "f2" ) );
- BOOST_CHECK( !fs::exists( d2 / "f2" ) );
- BOOST_CHECK( fs::exists( d2 / "f3" ) );
- BOOST_CHECK( !fs::is_directory( 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_CHECK( fs::exists( d1 / "f2" ) );
+ BOOST_TEST( fs::exists( d1 / "f2" ) );
// [case 5A] rename() directory to nonexistent parent directory
- BOOST_CHECK( fs::exists( d1 ) );
- BOOST_CHECK( !fs::exists( dir / "d3/d5" ) );
- BOOST_CHECK( !fs::exists( dir / "d3" ) );
+ 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_CHECK( CHECK_EXCEPTION( n5a, ENOENT ) );
+ BOOST_TEST( CHECK_EXCEPTION( n5a, ENOENT ) );
// [case 5B] rename() on directory
fs::path d3( dir / "d3" );
- BOOST_CHECK( fs::exists( d1 ) );
- BOOST_CHECK( fs::exists( d1 / "f2" ) );
- BOOST_CHECK( !fs::exists( d3 ) );
+ BOOST_TEST( fs::exists( d1 ) );
+ BOOST_TEST( fs::exists( d1 / "f2" ) );
+ BOOST_TEST( !fs::exists( d3 ) );
fs::rename( d1, d3 );
- BOOST_CHECK( !fs::exists( d1 ) );
- BOOST_CHECK( fs::exists( d3 ) );
- BOOST_CHECK( fs::is_directory( d3 ) );
- BOOST_CHECK( !fs::exists( d1 / "f2" ) );
- BOOST_CHECK( fs::exists( d3 / "f2" ) );
+ 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_CHECK( fs::exists( d1 ) );
- BOOST_CHECK( fs::exists( d1 / "f2" ) );
- BOOST_CHECK( !fs::exists( d3 ) );
+ 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_CHECK( fs::exists( d1 ) );
- BOOST_CHECK( !fs::exists( d2 / "d20" ) );
- BOOST_CHECK( fs::exists( d1 / "f2" ) );
+ BOOST_TEST( fs::exists( d1 ) );
+ BOOST_TEST( !fs::exists( d2 / "d20" ) );
+ BOOST_TEST( fs::exists( d1 / "f2" ) );
fs::rename( d1, d2 / "d20" );
- BOOST_CHECK( !fs::exists( d1 ) );
- BOOST_CHECK( fs::exists( d2 / "d20" ) );
- BOOST_CHECK( fs::exists( d2 / "d20" / "f2" ) );
+ BOOST_TEST( !fs::exists( d1 ) );
+ BOOST_TEST( fs::exists( d2 / "d20" ) );
+ BOOST_TEST( fs::exists( d2 / "d20" / "f2" ) );
fs::rename( d2 / "d20", d1 );
- BOOST_CHECK( fs::exists( d1 ) );
- BOOST_CHECK( !fs::exists( d2 / "d20" ) );
- BOOST_CHECK( fs::exists( d1 / "f2" ) );
+ BOOST_TEST( fs::exists( d1 ) );
+ BOOST_TEST( !fs::exists( d2 / "d20" ) );
+ BOOST_TEST( fs::exists( d1 / "f2" ) );
// remove() file
file_ph = dir / "shortlife";
- BOOST_CHECK( !fs::exists( file_ph ) );
+ BOOST_TEST( !fs::exists( file_ph ) );
create_file( file_ph, "" );
- BOOST_CHECK( fs::exists( file_ph ) );
- BOOST_CHECK( !fs::is_directory( file_ph ) );
- BOOST_CHECK( fs::remove( file_ph ) );
- BOOST_CHECK( !fs::exists( file_ph ) );
- BOOST_CHECK( !fs::remove( "no-such-file" ) );
- BOOST_CHECK( !fs::remove( "no-such-directory/no-such-file" ) );
+ 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_CHECK( !fs::exists( d1 ) );
+ BOOST_TEST( !fs::exists( d1 ) );
fs::create_directory( d1 );
- BOOST_CHECK( fs::exists( d1 ) );
- BOOST_CHECK( fs::is_directory( d1 ) );
- BOOST_CHECK( BOOST_FS_IS_EMPTY( d1 ) );
+ BOOST_TEST( fs::exists( d1 ) );
+ BOOST_TEST( fs::is_directory( d1 ) );
+ BOOST_TEST( BOOST_FS_IS_EMPTY( d1 ) );
bad_remove_dir = dir;
- BOOST_CHECK( CHECK_EXCEPTION( bad_remove, ENOTEMPTY ) );
- BOOST_CHECK( fs::remove( d1 ) );
- BOOST_CHECK( !fs::exists( d1 ) );
+ 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_CHECK( !fs::is_symlink( link ) );
- BOOST_CHECK( !fs::exists( link ) );
+ BOOST_TEST( !fs::is_symlink( link ) );
+ BOOST_TEST( !fs::exists( link ) );
fs::create_symlink( "nowhere", link );
- BOOST_CHECK( !fs::exists( link ) );
- BOOST_CHECK( fs::is_symlink( link ) );
- BOOST_CHECK( fs::remove( link ) );
- BOOST_CHECK( !fs::is_symlink( 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_CHECK( !fs::is_symlink( link ) );
- BOOST_CHECK( !fs::exists( link ) );
+ BOOST_TEST( !fs::is_symlink( link ) );
+ BOOST_TEST( !fs::exists( link ) );
fs::create_symlink( link, link );
- BOOST_CHECK( fs::remove( link ) );
- BOOST_CHECK( !fs::exists( link ) );
- BOOST_CHECK( !fs::is_symlink( 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_CHECK( !fs::is_symlink( link ) );
- BOOST_CHECK( !fs::exists( link ) );
+ BOOST_TEST( !fs::is_symlink( link ) );
+ BOOST_TEST( !fs::exists( link ) );
fs::create_symlink( link, link2 );
fs::create_symlink( link2, link );
- BOOST_CHECK( fs::remove( link ) );
- BOOST_CHECK( fs::remove( link2 ) );
- BOOST_CHECK( !fs::exists( link ) );
- BOOST_CHECK( !fs::exists( link2 ) );
- BOOST_CHECK( !fs::is_symlink( 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_CHECK( !fs::exists( file_ph ) );
+ BOOST_TEST( !fs::exists( file_ph ) );
create_file( file_ph, "" );
- BOOST_CHECK( fs::exists( file_ph ) );
- BOOST_CHECK( !fs::is_directory( file_ph ) );
- BOOST_CHECK( fs::is_regular_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_CHECK( fs::exists( link ) );
- BOOST_CHECK( !fs::is_directory( link ) );
- BOOST_CHECK( fs::is_regular_file( link ) );
- BOOST_CHECK( fs::is_symlink( link ) );
- BOOST_CHECK( fs::remove( link ) );
- BOOST_CHECK( fs::exists( file_ph ) );
- BOOST_CHECK( !fs::exists( link ) );
- BOOST_CHECK( !fs::is_symlink( link ) );
- BOOST_CHECK( fs::remove( file_ph ) );
- BOOST_CHECK( !fs::exists( file_ph ) );
+ 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_CHECK( fs::exists( file_ph ) );
- BOOST_CHECK( !fs::is_directory( file_ph ) );
- BOOST_CHECK( fs::is_regular_file( file_ph ) );
- BOOST_CHECK( fs::file_size( file_ph ) == 7 );
+ 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
@@ -908,7 +908,7 @@
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_CHECK( ft != fs::last_write_time( file_ph ) );
+ BOOST_TEST( ft != fs::last_write_time( file_ph ) );
std::cout << "\nReset to current time" << std::endl;
@@ -917,15 +917,15 @@
std::cout
<< "original last_write_time() - current last_write_time() is "
<< time_diff << " seconds" << std::endl;
- BOOST_CHECK( time_diff >= -60.0 && time_diff <= 60.0 );
+ BOOST_TEST( time_diff >= -60.0 && time_diff <= 60.0 );
// post-test cleanup
- BOOST_CHECK( fs::remove_all( dir ) != 0 );
+ 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_CHECK( !fs::exists( dir ) );
- BOOST_CHECK( fs::remove_all( dir ) == 0 );
+ BOOST_TEST( !fs::exists( dir ) );
+ BOOST_TEST( fs::remove_all( dir ) == 0 );
- return boost::test_framework::errors();
+ return ::boost::report_errors();
} // main
Modified: trunk/libs/filesystem/test/path_test.cpp
==============================================================================
--- trunk/libs/filesystem/test/path_test.cpp (original)
+++ trunk/libs/filesystem/test/path_test.cpp 2009-03-25 08:11:47 EDT (Wed, 25 Mar 2009)
@@ -30,7 +30,7 @@
using boost::next;
using boost::prior;
-#include <boost/detail/test_framework.hpp>
+#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__ )
@@ -46,7 +46,7 @@
{
if ( source.string()== expected ) return;
- ++boost::test_framework::error_count;
+ ++::boost::detail::test_errors();
std::cout << '(' << line << ") source.string(): \"" << source.string()
<< "\" != expected: \"" << expected
@@ -58,7 +58,7 @@
{
if ( source.directory_string()== expected ) return;
- ++boost::test_framework::error_count;
+ ++::boost::detail::test_errors();
std::cout << '(' << line << ") source.directory_string(): \""
<< source.directory_string()
@@ -71,7 +71,7 @@
{
if ( value == expected ) return;
- ++boost::test_framework::error_count;
+ ++::boost::detail::test_errors();
std::cout << '(' << line << ") value: \"" << value
<< "\" != expected: \"" << expected
@@ -87,20 +87,20 @@
catch ( const fs::filesystem_error & ex )
{
//std::cout << ex.what() << "*" << std::endl;
- //BOOST_CHECK( std::strcmp( ex.what(),
+ //BOOST_TEST( std::strcmp( ex.what(),
// "string-1: Unknown error" ) == 0 );
- BOOST_CHECK( ex.code() == ec );
+ 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_CHECK( std::strcmp( ex.what(),
+ //BOOST_TEST( std::strcmp( ex.what(),
// "string-1: Unknown error: \"p1\", \"p2\"" ) == 0 );
- BOOST_CHECK( ex.code() == ec );
- BOOST_CHECK( ex.path1().string() == "p1" );
- BOOST_CHECK( ex.path2().string() == "p2" );
+ BOOST_TEST( ex.code() == ec );
+ BOOST_TEST( ex.path1().string() == "p1" );
+ BOOST_TEST( ex.path2().string() == "p2" );
}
}
@@ -111,81 +111,81 @@
{
std::cout << "name_function_tests..." << std::endl;
- BOOST_CHECK( fs::portable_posix_name( std::string( "x" ) ) );
- BOOST_CHECK( fs::windows_name( std::string( "x" ) ) );
- BOOST_CHECK( fs::portable_name( std::string( "x" ) ) );
- BOOST_CHECK( fs::portable_directory_name( std::string( "x" ) ) );
- BOOST_CHECK( fs::portable_file_name( std::string( "x" ) ) );
-
- BOOST_CHECK( fs::portable_posix_name( std::string( "." ) ) );
- BOOST_CHECK( fs::windows_name( std::string( "." ) ) );
- BOOST_CHECK( fs::portable_name( std::string( "." ) ) );
- BOOST_CHECK( fs::portable_directory_name( std::string( "." ) ) );
- BOOST_CHECK( !fs::portable_file_name( std::string( "." ) ) );
-
- BOOST_CHECK( fs::portable_posix_name( std::string( ".." ) ) );
- BOOST_CHECK( fs::windows_name( std::string( ".." ) ) );
- BOOST_CHECK( fs::portable_name( std::string( ".." ) ) );
- BOOST_CHECK( fs::portable_directory_name( std::string( ".." ) ) );
- BOOST_CHECK( !fs::portable_file_name( std::string( ".." ) ) );
-
- BOOST_CHECK( !fs::native( std::string( "" ) ) );
- BOOST_CHECK( !fs::portable_posix_name( std::string( "" ) ) );
- BOOST_CHECK( !fs::windows_name( std::string( "" ) ) );
- BOOST_CHECK( !fs::portable_name( std::string( "" ) ) );
- BOOST_CHECK( !fs::portable_directory_name( std::string( "" ) ) );
- BOOST_CHECK( !fs::portable_file_name( std::string( "" ) ) );
-
- BOOST_CHECK( !fs::native( std::string( " " ) ) );
- BOOST_CHECK( !fs::portable_posix_name( std::string( " " ) ) );
- BOOST_CHECK( !fs::windows_name( std::string( " " ) ) );
- BOOST_CHECK( !fs::portable_name( std::string( " " ) ) );
- BOOST_CHECK( !fs::portable_directory_name( std::string( " " ) ) );
- BOOST_CHECK( !fs::portable_file_name( std::string( " " ) ) );
-
- BOOST_CHECK( !fs::portable_posix_name( std::string( ":" ) ) );
- BOOST_CHECK( !fs::windows_name( std::string( ":" ) ) );
- BOOST_CHECK( !fs::portable_name( std::string( ":" ) ) );
- BOOST_CHECK( !fs::portable_directory_name( std::string( ":" ) ) );
- BOOST_CHECK( !fs::portable_file_name( std::string( ":" ) ) );
-
- BOOST_CHECK( fs::portable_posix_name( std::string( "-" ) ) );
- BOOST_CHECK( fs::windows_name( std::string( "-" ) ) );
- BOOST_CHECK( !fs::portable_name( std::string( "-" ) ) );
- BOOST_CHECK( !fs::portable_directory_name( std::string( "-" ) ) );
- BOOST_CHECK( !fs::portable_file_name( std::string( "-" ) ) );
-
- BOOST_CHECK( !fs::portable_posix_name( std::string( "foo bar" ) ) );
- BOOST_CHECK( fs::windows_name( std::string( "foo bar" ) ) );
- BOOST_CHECK( !fs::windows_name( std::string( " bar" ) ) );
- BOOST_CHECK( !fs::windows_name( std::string( "foo " ) ) );
- BOOST_CHECK( !fs::portable_name( std::string( "foo bar" ) ) );
- BOOST_CHECK( !fs::portable_directory_name( std::string( "foo bar" ) ) );
- BOOST_CHECK( !fs::portable_file_name( std::string( "foo bar" ) ) );
-
- BOOST_CHECK( fs::portable_posix_name( std::string( "foo.bar" ) ) );
- BOOST_CHECK( fs::windows_name( std::string( "foo.bar" ) ) );
- BOOST_CHECK( fs::portable_name( std::string( "foo.bar" ) ) );
- BOOST_CHECK( !fs::portable_directory_name( std::string( "foo.bar" ) ) );
- BOOST_CHECK( fs::portable_file_name( std::string( "foo.bar" ) ) );
-
- BOOST_CHECK( fs::portable_posix_name( std::string( "foo.barf" ) ) );
- BOOST_CHECK( fs::windows_name( std::string( "foo.barf" ) ) );
- BOOST_CHECK( fs::portable_name( std::string( "foo.barf" ) ) );
- BOOST_CHECK( !fs::portable_directory_name( std::string( "foo.barf" ) ) );
- BOOST_CHECK( !fs::portable_file_name( std::string( "foo.barf" ) ) );
-
- BOOST_CHECK( fs::portable_posix_name( std::string( ".foo" ) ) );
- BOOST_CHECK( fs::windows_name( std::string( ".foo" ) ) );
- BOOST_CHECK( !fs::portable_name( std::string( ".foo" ) ) );
- BOOST_CHECK( !fs::portable_directory_name( std::string( ".foo" ) ) );
- BOOST_CHECK( !fs::portable_file_name( std::string( ".foo" ) ) );
-
- BOOST_CHECK( fs::portable_posix_name( std::string( "foo." ) ) );
- BOOST_CHECK( !fs::windows_name( std::string( "foo." ) ) );
- BOOST_CHECK( !fs::portable_name( std::string( "foo." ) ) );
- BOOST_CHECK( !fs::portable_directory_name( std::string( "foo." ) ) );
- BOOST_CHECK( !fs::portable_file_name( std::string( "foo." ) ) );
+ 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
@@ -203,29 +203,29 @@
path p1( "fe/fi/fo/fum" );
path p2( p1 );
path p3;
- BOOST_CHECK( p1.string() != p3.string() );
+ BOOST_TEST( p1.string() != p3.string() );
// check each overload
- BOOST_CHECK( p1 != p3 );
- BOOST_CHECK( p1 != p3.string() );
- BOOST_CHECK( p1 != p3.string().c_str() );
- BOOST_CHECK( p1.string() != p3 );
- BOOST_CHECK( p1.string().c_str() != p3 );
+ 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_CHECK( p1.string() == p3.string() );
+ BOOST_TEST( p1.string() == p3.string() );
// check each overload
- BOOST_CHECK( p1 == p3 );
- BOOST_CHECK( p1 == p3.string() );
- BOOST_CHECK( p1 == p3.string().c_str() );
- BOOST_CHECK( p1.string() == p3 );
- BOOST_CHECK( p1.string().c_str() == p3 );
+ 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_CHECK( p4.string() == "foobar" );
+ BOOST_TEST( p4.string() == "foobar" );
p4 = p4; // self-assignment
- BOOST_CHECK( p4.string() == "foobar" );
+ BOOST_TEST( p4.string() == "foobar" );
exception_tests();
name_function_tests();
@@ -271,7 +271,7 @@
p5 = s1;
PATH_CHECK( p5, "somestring" );
- BOOST_CHECK( p4.string() == path( p4.string().begin(), p4.string().end() ).string() );
+ BOOST_TEST( p4.string() == path( p4.string().begin(), p4.string().end() ).string() );
char c0 = 'a';
p5.assign( &c0, &c0 );
@@ -301,15 +301,15 @@
# endif
- BOOST_CHECK( p1 != p4 );
- BOOST_CHECK( p1.string() == p2.string() );
- BOOST_CHECK( p1.string() == p3.string() );
- BOOST_CHECK( path( "foo" ).filename() == "foo" );
- BOOST_CHECK( path( "foo" ).parent_path().string() == "" );
- BOOST_CHECK( p1.filename() == "fum" );
- BOOST_CHECK( p1.parent_path().string() == "fe/fi/fo" );
- BOOST_CHECK( path( "" ).empty() == true );
- BOOST_CHECK( path( "foo" ).empty() == false );
+ 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( "", "" );
@@ -470,35 +470,35 @@
path itr_ck = "";
path::const_iterator itr = itr_ck.begin();
- BOOST_CHECK( itr == itr_ck.end() );
+ BOOST_TEST( itr == itr_ck.end() );
itr_ck = "/";
itr = itr_ck.begin();
- BOOST_CHECK( *itr == std::string( "/" ) );
- BOOST_CHECK( ++itr == itr_ck.end() );
- BOOST_CHECK( *--itr == std::string( "/" ) );
+ BOOST_TEST( *itr == std::string( "/" ) );
+ BOOST_TEST( ++itr == itr_ck.end() );
+ BOOST_TEST( *--itr == std::string( "/" ) );
itr_ck = "foo";
- BOOST_CHECK( *itr_ck.begin() == std::string( "foo" ) );
- BOOST_CHECK( next( itr_ck.begin() ) == itr_ck.end() );
- BOOST_CHECK( *prior( itr_ck.end() ) == std::string( "foo" ) );
- BOOST_CHECK( prior( itr_ck.end() ) == itr_ck.begin() );
+ BOOST_TEST( *itr_ck.begin() == std::string( "foo" ) );
+ BOOST_TEST( next( itr_ck.begin() ) == itr_ck.end() );
+ BOOST_TEST( *prior( itr_ck.end() ) == std::string( "foo" ) );
+ BOOST_TEST( prior( itr_ck.end() ) == itr_ck.begin() );
itr_ck = path( "/foo" );
- BOOST_CHECK( *itr_ck.begin() == std::string( "/" ) );
- BOOST_CHECK( *next( itr_ck.begin() ) == std::string( "foo" ) );
- BOOST_CHECK( next(next( itr_ck.begin() )) == itr_ck.end() );
- BOOST_CHECK( next( itr_ck.begin() ) == prior( itr_ck.end() ) );
- BOOST_CHECK( *prior( itr_ck.end() ) == std::string( "foo" ) );
- BOOST_CHECK( *prior(prior( itr_ck.end() )) == std::string( "/" ) );
- BOOST_CHECK( prior(prior( itr_ck.end() )) == itr_ck.begin() );
+ BOOST_TEST( *itr_ck.begin() == std::string( "/" ) );
+ BOOST_TEST( *next( itr_ck.begin() ) == std::string( "foo" ) );
+ BOOST_TEST( next(next( itr_ck.begin() )) == itr_ck.end() );
+ BOOST_TEST( next( itr_ck.begin() ) == prior( itr_ck.end() ) );
+ BOOST_TEST( *prior( itr_ck.end() ) == std::string( "foo" ) );
+ BOOST_TEST( *prior(prior( itr_ck.end() )) == std::string( "/" ) );
+ BOOST_TEST( prior(prior( itr_ck.end() )) == itr_ck.begin() );
itr_ck = "/foo/bar";
itr = itr_ck.begin();
- BOOST_CHECK( *itr == std::string( "/" ) );
- BOOST_CHECK( *++itr == std::string( "foo" ) );
- BOOST_CHECK( *++itr == std::string( "bar" ) );
- BOOST_CHECK( ++itr == itr_ck.end() );
+ 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, "/" );
@@ -507,7 +507,7 @@
itr = itr_ck.begin();
CHECK_EQUAL( *itr, ".." );
CHECK_EQUAL( *++itr, "f" );
- BOOST_CHECK( ++itr == itr_ck.end() );
+ BOOST_TEST( ++itr == itr_ck.end() );
CHECK_EQUAL( *--itr, "f" );
CHECK_EQUAL( *--itr, ".." );
@@ -518,7 +518,7 @@
CHECK_EQUAL( *++itr, "foo" );
CHECK_EQUAL( *++itr, "bar" );
CHECK_EQUAL( *++itr, "." );
- BOOST_CHECK( ++itr == itr_ck.end() );
+ BOOST_TEST( ++itr == itr_ck.end() );
CHECK_EQUAL( *--itr, "." );
CHECK_EQUAL( *--itr, "bar" );
CHECK_EQUAL( *--itr, "foo" );
@@ -531,7 +531,7 @@
CHECK_EQUAL( *++itr, "f" );
CHECK_EQUAL( *++itr, "b" );
CHECK_EQUAL( *++itr, "." );
- BOOST_CHECK( ++itr == itr_ck.end() );
+ BOOST_TEST( ++itr == itr_ck.end() );
CHECK_EQUAL( *--itr, "." );
CHECK_EQUAL( *--itr, "b" );
CHECK_EQUAL( *--itr, "f" );
@@ -542,14 +542,14 @@
// 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_CHECK( ++itr == itr_ck.end() );
+ 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_CHECK( ++itr == itr_ck.end() );
+ BOOST_TEST( ++itr == itr_ck.end() );
CHECK_EQUAL( *--itr, "/" );
CHECK_EQUAL( *--itr, "//net" );
@@ -559,7 +559,7 @@
CHECK_EQUAL( *++itr, "/" );
CHECK_EQUAL( *++itr, "bar" );
CHECK_EQUAL( *++itr, "." );
- BOOST_CHECK( ++itr == itr_ck.end() );
+ BOOST_TEST( ++itr == itr_ck.end() );
CHECK_EQUAL( *--itr, "." );
CHECK_EQUAL( *--itr, "bar" );
CHECK_EQUAL( *--itr, "/" );
@@ -572,7 +572,7 @@
CHECK_EQUAL( *++itr, "foo" );
CHECK_EQUAL( *++itr, "bar" );
CHECK_EQUAL( *++itr, "." );
- BOOST_CHECK( ++itr == itr_ck.end() );
+ BOOST_TEST( ++itr == itr_ck.end() );
CHECK_EQUAL( *--itr, "." );
CHECK_EQUAL( *--itr, "bar" );
CHECK_EQUAL( *--itr, "foo" );
@@ -584,80 +584,80 @@
itr = itr_ck.begin();
CHECK_EQUAL( *itr, "c:" );
CHECK_EQUAL( *++itr, "/" );
- BOOST_CHECK( ++itr == itr_ck.end() );
+ BOOST_TEST( ++itr == itr_ck.end() );
CHECK_EQUAL( *--itr, "/" );
CHECK_EQUAL( *--itr, "c:" );
itr_ck = "c:/foo";
itr = itr_ck.begin();
- BOOST_CHECK( *itr == std::string( "c:" ) );
- BOOST_CHECK( *++itr == std::string( "/" ) );
- BOOST_CHECK( *++itr == std::string( "foo" ) );
- BOOST_CHECK( ++itr == itr_ck.end() );
- BOOST_CHECK( *--itr == std::string( "foo" ) );
- BOOST_CHECK( *--itr == std::string( "/" ) );
- BOOST_CHECK( *--itr == std::string( "c:" ) );
+ 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_CHECK( *itr == std::string( "c:" ) );
- BOOST_CHECK( *++itr == std::string( "foo" ) );
- BOOST_CHECK( ++itr == itr_ck.end() );
- BOOST_CHECK( *--itr == std::string( "foo" ) );
- BOOST_CHECK( *--itr == std::string( "c:" ) );
+ 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_CHECK( *itr == std::string( "c:" ) );
- BOOST_CHECK( *++itr == std::string( "foo" ) );
- BOOST_CHECK( *++itr == std::string( "." ) );
- BOOST_CHECK( ++itr == itr_ck.end() );
- BOOST_CHECK( *--itr == std::string( "." ) );
- BOOST_CHECK( *--itr == std::string( "foo" ) );
- BOOST_CHECK( *--itr == std::string( "c:" ) );
+ 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_CHECK( ++itr == itr_ck.end() );
+ BOOST_TEST( ++itr == itr_ck.end() );
}
path p;
p = "";
- BOOST_CHECK( p.relative_path().string() == "" );
- BOOST_CHECK( p.parent_path().string() == "" );
- BOOST_CHECK( p.filename() == "" );
- BOOST_CHECK( p.root_name() == "" );
- BOOST_CHECK( p.root_directory() == "" );
- BOOST_CHECK( p.root_path().string() == "" );
- BOOST_CHECK( !p.has_root_path() );
- BOOST_CHECK( !p.has_root_name() );
- BOOST_CHECK( !p.has_root_directory() );
- BOOST_CHECK( !p.has_relative_path() );
- BOOST_CHECK( !p.has_filename() );
- BOOST_CHECK( !p.has_parent_path() );
- BOOST_CHECK( !p.is_complete() );
+ 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_CHECK( p.relative_path().string() == "" );
- BOOST_CHECK( p.parent_path().string() == "" );
- BOOST_CHECK( p.filename() == "/" );
- BOOST_CHECK( p.root_name() == "" );
- BOOST_CHECK( p.root_directory() == "/" );
- BOOST_CHECK( p.root_path().string() == "/" );
- BOOST_CHECK( p.has_root_path() );
- BOOST_CHECK( !p.has_root_name() );
- BOOST_CHECK( p.has_root_directory() );
- BOOST_CHECK( !p.has_relative_path() );
- BOOST_CHECK( p.has_filename() );
- BOOST_CHECK( !p.has_parent_path() );
+ 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_CHECK( p.is_complete() );
+ BOOST_TEST( p.is_complete() );
else
- BOOST_CHECK( !p.is_complete() );
+ BOOST_TEST( !p.is_complete() );
p = "//";
CHECK_EQUAL( p.relative_path().string(), "" );
@@ -666,13 +666,13 @@
CHECK_EQUAL( p.root_name(), "//" );
CHECK_EQUAL( p.root_directory(), "" );
CHECK_EQUAL( p.root_path().string(), "//" );
- BOOST_CHECK( p.has_root_path() );
- BOOST_CHECK( p.has_root_name() );
- BOOST_CHECK( !p.has_root_directory() );
- BOOST_CHECK( !p.has_relative_path() );
- BOOST_CHECK( p.has_filename() );
- BOOST_CHECK( !p.has_parent_path() );
- BOOST_CHECK( !p.is_complete() );
+ 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 = "///";
@@ -682,61 +682,61 @@
CHECK_EQUAL( p.root_name(), "" );
CHECK_EQUAL( p.root_directory(), "/" );
CHECK_EQUAL( p.root_path().string(), "/" );
- BOOST_CHECK( p.has_root_path() );
- BOOST_CHECK( !p.has_root_name() );
- BOOST_CHECK( p.has_root_directory() );
- BOOST_CHECK( !p.has_relative_path() );
- BOOST_CHECK( p.has_filename() );
- BOOST_CHECK( !p.has_parent_path() );
+ 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_CHECK( p.is_complete() );
+ BOOST_TEST( p.is_complete() );
else
- BOOST_CHECK( !p.is_complete() );
+ BOOST_TEST( !p.is_complete() );
p = ".";
- BOOST_CHECK( p.relative_path().string() == "." );
- BOOST_CHECK( p.parent_path().string() == "" );
- BOOST_CHECK( p.filename() == "." );
- BOOST_CHECK( p.root_name() == "" );
- BOOST_CHECK( p.root_directory() == "" );
- BOOST_CHECK( p.root_path().string() == "" );
- BOOST_CHECK( !p.has_root_path() );
- BOOST_CHECK( !p.has_root_name() );
- BOOST_CHECK( !p.has_root_directory() );
- BOOST_CHECK( p.has_relative_path() );
- BOOST_CHECK( p.has_filename() );
- BOOST_CHECK( !p.has_parent_path() );
- BOOST_CHECK( !p.is_complete() );
+ 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_CHECK( p.relative_path().string() == ".." );
- BOOST_CHECK( p.parent_path().string() == "" );
- BOOST_CHECK( p.filename() == ".." );
- BOOST_CHECK( p.root_name() == "" );
- BOOST_CHECK( p.root_directory() == "" );
- BOOST_CHECK( p.root_path().string() == "" );
- BOOST_CHECK( !p.has_root_path() );
- BOOST_CHECK( !p.has_root_name() );
- BOOST_CHECK( !p.has_root_directory() );
- BOOST_CHECK( p.has_relative_path() );
- BOOST_CHECK( p.has_filename() );
- BOOST_CHECK( !p.has_parent_path() );
- BOOST_CHECK( !p.is_complete() );
+ 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_CHECK( p.relative_path().string() == "foo" );
- BOOST_CHECK( p.parent_path().string() == "" );
- BOOST_CHECK( p.filename() == "foo" );
- BOOST_CHECK( p.root_name() == "" );
- BOOST_CHECK( p.root_directory() == "" );
- BOOST_CHECK( p.root_path().string() == "" );
- BOOST_CHECK( !p.has_root_path() );
- BOOST_CHECK( !p.has_root_name() );
- BOOST_CHECK( !p.has_root_directory() );
- BOOST_CHECK( p.has_relative_path() );
- BOOST_CHECK( p.has_filename() );
- BOOST_CHECK( !p.has_parent_path() );
- BOOST_CHECK( !p.is_complete() );
+ 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" );
@@ -745,16 +745,16 @@
CHECK_EQUAL( p.root_name(), "" );
CHECK_EQUAL( p.root_directory(), "/" );
CHECK_EQUAL( p.root_path().string(), "/" );
- BOOST_CHECK( p.has_root_path() );
- BOOST_CHECK( !p.has_root_name() );
- BOOST_CHECK( p.has_root_directory() );
- BOOST_CHECK( p.has_relative_path() );
- BOOST_CHECK( p.has_filename() );
- BOOST_CHECK( p.has_parent_path() );
+ 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_CHECK( p.is_complete() );
+ BOOST_TEST( p.is_complete() );
else
- BOOST_CHECK( !p.is_complete() );
+ BOOST_TEST( !p.is_complete() );
p = "/foo/";
CHECK_EQUAL( p.relative_path().string(), "foo/" );
@@ -763,16 +763,16 @@
CHECK_EQUAL( p.root_name(), "" );
CHECK_EQUAL( p.root_directory(), "/" );
CHECK_EQUAL( p.root_path().string(), "/" );
- BOOST_CHECK( p.has_root_path() );
- BOOST_CHECK( !p.has_root_name() );
- BOOST_CHECK( p.has_root_directory() );
- BOOST_CHECK( p.has_relative_path() );
- BOOST_CHECK( p.has_filename() );
- BOOST_CHECK( p.has_parent_path() );
+ 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_CHECK( p.is_complete() );
+ BOOST_TEST( p.is_complete() );
else
- BOOST_CHECK( !p.is_complete() );
+ BOOST_TEST( !p.is_complete() );
p = "///foo";
CHECK_EQUAL( p.relative_path().string(), "foo" );
@@ -781,46 +781,46 @@
CHECK_EQUAL( p.root_name(), "" );
CHECK_EQUAL( p.root_directory(), "/" );
CHECK_EQUAL( p.root_path().string(), "/" );
- BOOST_CHECK( p.has_root_path() );
- BOOST_CHECK( !p.has_root_name() );
- BOOST_CHECK( p.has_root_directory() );
- BOOST_CHECK( p.has_relative_path() );
- BOOST_CHECK( p.has_filename() );
- BOOST_CHECK( p.has_parent_path() );
+ 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_CHECK( p.is_complete() );
+ BOOST_TEST( p.is_complete() );
else
- BOOST_CHECK( !p.is_complete() );
+ BOOST_TEST( !p.is_complete() );
p = "foo/bar";
- BOOST_CHECK( p.relative_path().string() == "foo/bar" );
- BOOST_CHECK( p.parent_path().string() == "foo" );
- BOOST_CHECK( p.filename() == "bar" );
- BOOST_CHECK( p.root_name() == "" );
- BOOST_CHECK( p.root_directory() == "" );
- BOOST_CHECK( p.root_path().string() == "" );
- BOOST_CHECK( !p.has_root_path() );
- BOOST_CHECK( !p.has_root_name() );
- BOOST_CHECK( !p.has_root_directory() );
- BOOST_CHECK( p.has_relative_path() );
- BOOST_CHECK( p.has_filename() );
- BOOST_CHECK( p.has_parent_path() );
- BOOST_CHECK( !p.is_complete() );
+ 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_CHECK( p.relative_path().string() == "../foo" );
- BOOST_CHECK( p.parent_path().string() == ".." );
- BOOST_CHECK( p.filename() == "foo" );
- BOOST_CHECK( p.root_name() == "" );
- BOOST_CHECK( p.root_directory() == "" );
- BOOST_CHECK( p.root_path().string() == "" );
- BOOST_CHECK( !p.has_root_path() );
- BOOST_CHECK( !p.has_root_name() );
- BOOST_CHECK( !p.has_root_directory() );
- BOOST_CHECK( p.has_relative_path() );
- BOOST_CHECK( p.has_filename() );
- BOOST_CHECK( p.has_parent_path() );
- BOOST_CHECK( !p.is_complete() );
+ 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" );
@@ -829,31 +829,31 @@
CHECK_EQUAL( p.root_name(), "" );
CHECK_EQUAL( p.root_directory(), "" );
CHECK_EQUAL( p.root_path().string(), "" );
- BOOST_CHECK( !p.has_root_path() );
- BOOST_CHECK( !p.has_root_name() );
- BOOST_CHECK( !p.has_root_directory() );
- BOOST_CHECK( p.has_relative_path() );
- BOOST_CHECK( p.has_filename() );
- BOOST_CHECK( p.has_parent_path() );
- BOOST_CHECK( !p.is_complete() );
+ 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_CHECK( p.relative_path().string() == "foo/bar" );
- BOOST_CHECK( p.parent_path().string() == "/foo" );
- BOOST_CHECK( p.filename() == "bar" );
- BOOST_CHECK( p.root_name() == "" );
- BOOST_CHECK( p.root_directory() == "/" );
- BOOST_CHECK( p.root_path().string() == "/" );
- BOOST_CHECK( p.has_root_path() );
- BOOST_CHECK( !p.has_root_name() );
- BOOST_CHECK( p.has_root_directory() );
- BOOST_CHECK( p.has_relative_path() );
- BOOST_CHECK( p.has_filename() );
- BOOST_CHECK( p.has_parent_path() );
+ 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_CHECK( p.is_complete() );
+ BOOST_TEST( p.is_complete() );
else
- BOOST_CHECK( !p.is_complete() );
+ BOOST_TEST( !p.is_complete() );
// Both POSIX and Windows allow two leading slashs
// (POSIX meaning is implementation defined)
@@ -869,43 +869,43 @@
CHECK_EQUAL( p.root_name(), "//net" );
CHECK_EQUAL( p.root_directory(), "" );
CHECK_EQUAL( p.root_path().string(), "//net" );
- BOOST_CHECK( p.has_root_path() );
- BOOST_CHECK( p.has_root_name() );
- BOOST_CHECK( !p.has_root_directory() );
- BOOST_CHECK( !p.has_relative_path() );
- BOOST_CHECK( p.has_filename() );
- BOOST_CHECK( !p.has_parent_path() );
- BOOST_CHECK( !p.is_complete() );
+ 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_CHECK( p.relative_path().string() == "" );
- BOOST_CHECK( p.parent_path().string() == "//net" );
- BOOST_CHECK( p.filename() == "/" );
- BOOST_CHECK( p.root_name() == "//net" );
- BOOST_CHECK( p.root_directory() == "/" );
- BOOST_CHECK( p.root_path().string() == "//net/" );
- BOOST_CHECK( p.has_root_path() );
- BOOST_CHECK( p.has_root_name() );
- BOOST_CHECK( p.has_root_directory() );
- BOOST_CHECK( !p.has_relative_path() );
- BOOST_CHECK( p.has_filename() );
- BOOST_CHECK( p.has_parent_path() );
- BOOST_CHECK( p.is_complete() );
+ 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_CHECK( p.relative_path().string() == "foo" );
- BOOST_CHECK( p.parent_path().string() == "//net/" );
- BOOST_CHECK( p.filename() == "foo" );
- BOOST_CHECK( p.root_name() == "//net" );
- BOOST_CHECK( p.root_directory() == "/" );
- BOOST_CHECK( p.root_path().string() == "//net/" );
- BOOST_CHECK( p.has_root_path() );
- BOOST_CHECK( p.has_root_name() );
- BOOST_CHECK( p.has_root_directory() );
- BOOST_CHECK( p.has_relative_path() );
- BOOST_CHECK( p.has_filename() );
- BOOST_CHECK( p.has_parent_path() );
- BOOST_CHECK( p.is_complete() );
+ 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" );
@@ -914,13 +914,13 @@
CHECK_EQUAL( p.root_name(), "//net" );
CHECK_EQUAL( p.root_directory(), "/" );
CHECK_EQUAL( p.root_path().string(), "//net/" );
- BOOST_CHECK( p.has_root_path() );
- BOOST_CHECK( p.has_root_name() );
- BOOST_CHECK( p.has_root_directory() );
- BOOST_CHECK( p.has_relative_path() );
- BOOST_CHECK( p.has_filename() );
- BOOST_CHECK( p.has_parent_path() );
- BOOST_CHECK( p.is_complete() );
+ 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" )
{
@@ -970,64 +970,64 @@
PATH_CHECK( path( "prn:" ), "prn:" );
p = path( "c:" );
- BOOST_CHECK( p.relative_path().string() == "" );
- BOOST_CHECK( p.parent_path().string() == "" );
- BOOST_CHECK( p.filename() == "c:" );
- BOOST_CHECK( p.root_name() == "c:" );
- BOOST_CHECK( p.root_directory() == "" );
- BOOST_CHECK( p.root_path().string() == "c:" );
- BOOST_CHECK( p.has_root_path() );
- BOOST_CHECK( p.has_root_name() );
- BOOST_CHECK( !p.has_root_directory() );
- BOOST_CHECK( !p.has_relative_path() );
- BOOST_CHECK( p.has_filename() );
- BOOST_CHECK( !p.has_parent_path() );
- BOOST_CHECK( !p.is_complete() );
+ 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_CHECK( p.relative_path().string() == "foo" );
- BOOST_CHECK( p.parent_path().string() == "c:" );
- BOOST_CHECK( p.filename() == "foo" );
- BOOST_CHECK( p.root_name() == "c:" );
- BOOST_CHECK( p.root_directory() == "" );
- BOOST_CHECK( p.root_path().string() == "c:" );
- BOOST_CHECK( p.has_root_path() );
- BOOST_CHECK( p.has_root_name() );
- BOOST_CHECK( !p.has_root_directory() );
- BOOST_CHECK( p.has_relative_path() );
- BOOST_CHECK( p.has_filename() );
- BOOST_CHECK( p.has_parent_path() );
- BOOST_CHECK( !p.is_complete() );
+ 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_CHECK( p.relative_path().string() == "" );
- BOOST_CHECK( p.parent_path().string() == "c:" );
- BOOST_CHECK( p.filename() == "/" );
- BOOST_CHECK( p.root_name() == "c:" );
- BOOST_CHECK( p.root_directory() == "/" );
- BOOST_CHECK( p.root_path().string() == "c:/" );
- BOOST_CHECK( p.has_root_path() );
- BOOST_CHECK( p.has_root_name() );
- BOOST_CHECK( p.has_root_directory() );
- BOOST_CHECK( !p.has_relative_path() );
- BOOST_CHECK( p.has_filename() );
- BOOST_CHECK( p.has_parent_path() );
- BOOST_CHECK( p.is_complete() );
+ 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_CHECK( p.relative_path().string() == ".." );
- BOOST_CHECK( p.parent_path().string() == "c:" );
- BOOST_CHECK( p.filename() == ".." );
- BOOST_CHECK( p.root_name() == "c:" );
- BOOST_CHECK( p.root_directory() == "" );
- BOOST_CHECK( p.root_path().string() == "c:" );
- BOOST_CHECK( p.has_root_path() );
- BOOST_CHECK( p.has_root_name() );
- BOOST_CHECK( !p.has_root_directory() );
- BOOST_CHECK( p.has_relative_path() );
- BOOST_CHECK( p.has_filename() );
- BOOST_CHECK( p.has_parent_path() );
- BOOST_CHECK( !p.is_complete() );
+ 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" );
@@ -1036,13 +1036,13 @@
CHECK_EQUAL( p.root_name(), "c:" );
CHECK_EQUAL( p.root_directory(), "/" );
CHECK_EQUAL( p.root_path().string(), "c:/" );
- BOOST_CHECK( p.has_root_path() );
- BOOST_CHECK( p.has_root_name() );
- BOOST_CHECK( p.has_root_directory() );
- BOOST_CHECK( p.has_relative_path() );
- BOOST_CHECK( p.has_filename() );
- BOOST_CHECK( p.has_parent_path() );
- BOOST_CHECK( p.is_complete() );
+ 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" );
@@ -1051,13 +1051,13 @@
CHECK_EQUAL( p.root_name(), "c:" );
CHECK_EQUAL( p.root_directory(), "/" );
CHECK_EQUAL( p.root_path().string(), "c:/" );
- BOOST_CHECK( p.has_root_path() );
- BOOST_CHECK( p.has_root_name() );
- BOOST_CHECK( p.has_root_directory() );
- BOOST_CHECK( p.has_relative_path() );
- BOOST_CHECK( p.has_filename() );
- BOOST_CHECK( p.has_parent_path() );
- BOOST_CHECK( p.is_complete() );
+ 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" );
@@ -1066,28 +1066,28 @@
CHECK_EQUAL( p.root_name(), "c:" );
CHECK_EQUAL( p.root_directory(), "/" );
CHECK_EQUAL( p.root_path().string(), "c:/" );
- BOOST_CHECK( p.has_root_path() );
- BOOST_CHECK( p.has_root_name() );
- BOOST_CHECK( p.has_root_directory() );
- BOOST_CHECK( p.has_relative_path() );
- BOOST_CHECK( p.has_filename() );
- BOOST_CHECK( p.has_parent_path() );
- BOOST_CHECK( p.is_complete() );
+ 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_CHECK( p.relative_path().string() == "" );
- BOOST_CHECK( p.parent_path().string() == "" );
- BOOST_CHECK( p.filename() == "prn:" );
- BOOST_CHECK( p.root_name() == "prn:" );
- BOOST_CHECK( p.root_directory() == "" );
- BOOST_CHECK( p.root_path().string() == "prn:" );
- BOOST_CHECK( p.has_root_path() );
- BOOST_CHECK( p.has_root_name() );
- BOOST_CHECK( !p.has_root_directory() );
- BOOST_CHECK( !p.has_relative_path() );
- BOOST_CHECK( p.has_filename() );
- BOOST_CHECK( !p.has_parent_path() );
- BOOST_CHECK( !p.is_complete() );
+ 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" );
@@ -1096,75 +1096,75 @@
CHECK_EQUAL( p.root_name(), "//net" );
CHECK_EQUAL( p.root_directory(), "/" );
CHECK_EQUAL( p.root_path().string(), "//net/" );
- BOOST_CHECK( p.has_root_path() );
- BOOST_CHECK( p.has_root_name() );
- BOOST_CHECK( p.has_root_directory() );
- BOOST_CHECK( p.has_relative_path() );
- BOOST_CHECK( p.has_filename() );
- BOOST_CHECK( p.has_parent_path() );
- BOOST_CHECK( p.is_complete() );
+ 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_CHECK( *itr_ck.begin() == std::string( "c:" ) );
- BOOST_CHECK( next( itr_ck.begin() ) == itr_ck.end() );
- BOOST_CHECK( prior( itr_ck.end() ) == itr_ck.begin() );
- BOOST_CHECK( *prior( itr_ck.end() ) == std::string( "c:" ) );
+ BOOST_TEST( *itr_ck.begin() == std::string( "c:" ) );
+ BOOST_TEST( next( itr_ck.begin() ) == itr_ck.end() );
+ BOOST_TEST( prior( itr_ck.end() ) == itr_ck.begin() );
+ BOOST_TEST( *prior( itr_ck.end() ) == std::string( "c:" ) );
itr_ck = path( "c:/" );
- BOOST_CHECK( *itr_ck.begin() == std::string( "c:" ) );
- BOOST_CHECK( *next( itr_ck.begin() ) == std::string( "/" ) );
- BOOST_CHECK( next( next( itr_ck.begin() )) == itr_ck.end() );
- BOOST_CHECK( prior( prior( itr_ck.end() )) == itr_ck.begin() );
- BOOST_CHECK( *prior( itr_ck.end() ) == std::string( "/" ) );
- BOOST_CHECK( *prior( prior( itr_ck.end() )) == std::string( "c:" ) );
+ BOOST_TEST( *itr_ck.begin() == std::string( "c:" ) );
+ BOOST_TEST( *next( itr_ck.begin() ) == std::string( "/" ) );
+ BOOST_TEST( next( next( itr_ck.begin() )) == itr_ck.end() );
+ BOOST_TEST( prior( prior( itr_ck.end() )) == itr_ck.begin() );
+ BOOST_TEST( *prior( itr_ck.end() ) == std::string( "/" ) );
+ BOOST_TEST( *prior( prior( itr_ck.end() )) == std::string( "c:" ) );
itr_ck = path( "c:foo" );
- BOOST_CHECK( *itr_ck.begin() == std::string( "c:" ) );
- BOOST_CHECK( *next( itr_ck.begin() ) == std::string( "foo" ) );
- BOOST_CHECK( next(next( itr_ck.begin() )) == itr_ck.end() );
- BOOST_CHECK( prior(prior( itr_ck.end() )) == itr_ck.begin() );
- BOOST_CHECK( *prior( itr_ck.end() ) == std::string( "foo" ) );
- BOOST_CHECK( *prior(prior( itr_ck.end() )) == std::string( "c:" ) );
+ BOOST_TEST( *itr_ck.begin() == std::string( "c:" ) );
+ BOOST_TEST( *next( itr_ck.begin() ) == std::string( "foo" ) );
+ BOOST_TEST( next(next( itr_ck.begin() )) == itr_ck.end() );
+ BOOST_TEST( prior(prior( itr_ck.end() )) == itr_ck.begin() );
+ BOOST_TEST( *prior( itr_ck.end() ) == std::string( "foo" ) );
+ BOOST_TEST( *prior(prior( itr_ck.end() )) == std::string( "c:" ) );
itr_ck = path( "c:/foo" );
- BOOST_CHECK( *itr_ck.begin() == std::string( "c:" ) );
- BOOST_CHECK( *next( itr_ck.begin() ) == std::string( "/" ) );
- BOOST_CHECK( *next( next( itr_ck.begin() )) == std::string( "foo" ) );
- BOOST_CHECK( next( next( next( itr_ck.begin() ))) == itr_ck.end() );
- BOOST_CHECK( prior( prior( prior( itr_ck.end() ))) == itr_ck.begin() );
- BOOST_CHECK( *prior( itr_ck.end() ) == std::string( "foo" ) );
- BOOST_CHECK( *prior( prior( itr_ck.end() )) == std::string( "/" ) );
- BOOST_CHECK( *prior( prior( prior( itr_ck.end() ))) == std::string( "c:" ) );
+ BOOST_TEST( *itr_ck.begin() == std::string( "c:" ) );
+ BOOST_TEST( *next( itr_ck.begin() ) == std::string( "/" ) );
+ BOOST_TEST( *next( next( itr_ck.begin() )) == std::string( "foo" ) );
+ BOOST_TEST( next( next( next( itr_ck.begin() ))) == itr_ck.end() );
+ BOOST_TEST( prior( prior( prior( itr_ck.end() ))) == itr_ck.begin() );
+ BOOST_TEST( *prior( itr_ck.end() ) == std::string( "foo" ) );
+ BOOST_TEST( *prior( prior( itr_ck.end() )) == std::string( "/" ) );
+ BOOST_TEST( *prior( prior( prior( itr_ck.end() ))) == std::string( "c:" ) );
itr_ck = path( "//net" );
- BOOST_CHECK( *itr_ck.begin() == std::string( "//net" ) );
- BOOST_CHECK( next( itr_ck.begin() ) == itr_ck.end() );
- BOOST_CHECK( prior( itr_ck.end() ) == itr_ck.begin() );
- BOOST_CHECK( *prior( itr_ck.end() ) == std::string( "//net" ) );
+ BOOST_TEST( *itr_ck.begin() == std::string( "//net" ) );
+ BOOST_TEST( next( itr_ck.begin() ) == itr_ck.end() );
+ BOOST_TEST( prior( itr_ck.end() ) == itr_ck.begin() );
+ BOOST_TEST( *prior( itr_ck.end() ) == std::string( "//net" ) );
itr_ck = path( "//net/" );
CHECK_EQUAL( *itr_ck.begin(), "//net" );
CHECK_EQUAL( *next( itr_ck.begin() ), "/" );
- BOOST_CHECK( next(next( itr_ck.begin() )) == itr_ck.end() );
- BOOST_CHECK( prior(prior( itr_ck.end() )) == itr_ck.begin() );
+ BOOST_TEST( next(next( itr_ck.begin() )) == itr_ck.end() );
+ BOOST_TEST( prior(prior( itr_ck.end() )) == itr_ck.begin() );
CHECK_EQUAL( *prior( itr_ck.end() ), "/" );
CHECK_EQUAL( *prior(prior( itr_ck.end() )), "//net" );
itr_ck = path( "//net/foo" );
- BOOST_CHECK( *itr_ck.begin() == std::string( "//net" ) );
- BOOST_CHECK( *next( itr_ck.begin() ) == std::string( "/" ) );
- BOOST_CHECK( *next(next( itr_ck.begin() )) == std::string( "foo" ) );
- BOOST_CHECK( next(next(next( itr_ck.begin() ))) == itr_ck.end() );
- BOOST_CHECK( prior(prior(prior( itr_ck.end() ))) == itr_ck.begin() );
- BOOST_CHECK( *prior( itr_ck.end() ) == std::string( "foo" ) );
- BOOST_CHECK( *prior(prior( itr_ck.end() )) == std::string( "/" ) );
- BOOST_CHECK( *prior(prior(prior( itr_ck.end() ))) == std::string( "//net" ) );
+ BOOST_TEST( *itr_ck.begin() == std::string( "//net" ) );
+ BOOST_TEST( *next( itr_ck.begin() ) == std::string( "/" ) );
+ BOOST_TEST( *next(next( itr_ck.begin() )) == std::string( "foo" ) );
+ BOOST_TEST( next(next(next( itr_ck.begin() ))) == itr_ck.end() );
+ BOOST_TEST( prior(prior(prior( itr_ck.end() ))) == itr_ck.begin() );
+ BOOST_TEST( *prior( itr_ck.end() ) == std::string( "foo" ) );
+ BOOST_TEST( *prior(prior( itr_ck.end() )) == std::string( "/" ) );
+ BOOST_TEST( *prior(prior(prior( itr_ck.end() ))) == std::string( "//net" ) );
itr_ck = path( "prn:" );
- BOOST_CHECK( *itr_ck.begin() == std::string( "prn:" ) );
- BOOST_CHECK( next( itr_ck.begin() ) == itr_ck.end() );
- BOOST_CHECK( prior( itr_ck.end() ) == itr_ck.begin() );
- BOOST_CHECK( *prior( itr_ck.end() ) == std::string( "prn:" ) );
+ BOOST_TEST( *itr_ck.begin() == std::string( "prn:" ) );
+ BOOST_TEST( next( itr_ck.begin() ) == itr_ck.end() );
+ BOOST_TEST( prior( itr_ck.end() ) == itr_ck.begin() );
+ BOOST_TEST( *prior( itr_ck.end() ) == std::string( "prn:" ) );
} // Windows
else
@@ -1174,7 +1174,7 @@
DIR_CHECK( path( "///foo///bar///" ), "///foo///bar///" );
p = path( "/usr/local/bin:/usr/bin:/bin" );
- BOOST_CHECK( p.file_string() == "/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
@@ -1198,137 +1198,137 @@
// swap
a.swap( b );
- BOOST_CHECK( a.string() == "b" );
- BOOST_CHECK( b.string() == "a" );
+ BOOST_TEST( a.string() == "b" );
+ BOOST_TEST( b.string() == "a" );
fs::swap( a, b );
- BOOST_CHECK( a.string() == "a" );
- BOOST_CHECK( b.string() == "b" );
+ BOOST_TEST( a.string() == "a" );
+ BOOST_TEST( b.string() == "b" );
// probe operator /
- BOOST_CHECK( (b / a).string() == "b/a" );
- BOOST_CHECK( (bs / a).string() == "b/a" );
- BOOST_CHECK( (bcs / a).string() == "b/a" );
- BOOST_CHECK( (b / as).string() == "b/a" );
- BOOST_CHECK( (b / acs).string() == "b/a" );
+ 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_CHECK( !(e < e2) );
- BOOST_CHECK( !(es < e2) );
- BOOST_CHECK( !(ecs < e2) );
- BOOST_CHECK( !(e < es2) );
- BOOST_CHECK( !(e < ecs2) );
-
- BOOST_CHECK( e < a );
- BOOST_CHECK( es < a );
- BOOST_CHECK( ecs < a );
- BOOST_CHECK( e < as );
- BOOST_CHECK( e < acs );
-
- BOOST_CHECK( a < b );
- BOOST_CHECK( as < b );
- BOOST_CHECK( acs < b );
- BOOST_CHECK( a < bs );
- BOOST_CHECK( a < bcs );
-
- BOOST_CHECK( !(a < a2) );
- BOOST_CHECK( !(as < a2) );
- BOOST_CHECK( !(acs < a2) );
- BOOST_CHECK( !(a < as2) );
- BOOST_CHECK( !(a < acs2) );
+ 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_CHECK( !(as < as) );
- BOOST_CHECK( !(as < acs) );
- BOOST_CHECK( !(acs < as) );
+ BOOST_TEST( !(as < as) );
+ BOOST_TEST( !(as < acs) );
+ BOOST_TEST( !(acs < as) );
// reality check character set is as expected
- BOOST_CHECK( std::string("a.b") < std::string("a/b") );
+ BOOST_TEST( std::string("a.b") < std::string("a/b") );
// verify compare is actually lexicographical
- BOOST_CHECK( path("a/b") < path("a.b") );
+ BOOST_TEST( path("a/b") < path("a.b") );
// make sure the derivative operators also work
- BOOST_CHECK( a == a2 );
- BOOST_CHECK( as == a2 );
- BOOST_CHECK( acs == a2 );
- BOOST_CHECK( a == as2 );
- BOOST_CHECK( a == acs2 );
-
- BOOST_CHECK( a != b );
- BOOST_CHECK( as != b );
- BOOST_CHECK( acs != b );
- BOOST_CHECK( a != bs );
- BOOST_CHECK( a != bcs );
-
- BOOST_CHECK( b > a );
- BOOST_CHECK( b > as );
- BOOST_CHECK( b > acs );
- BOOST_CHECK( bs > a);
- BOOST_CHECK( bcs > a);
-
- BOOST_CHECK( !(a2 > a) );
- BOOST_CHECK( !(a2 > as) );
- BOOST_CHECK( !(a2 > acs) );
- BOOST_CHECK( !(as2 > a) );
- BOOST_CHECK( !(acs2 > a) );
-
- BOOST_CHECK( a <= b );
- BOOST_CHECK( as <= b );
- BOOST_CHECK( acs <= b );
- BOOST_CHECK( a <= bs );
- BOOST_CHECK( a <= bcs );
-
- BOOST_CHECK( a <= a2 );
- BOOST_CHECK( as <= a2 );
- BOOST_CHECK( acs <= a2 );
- BOOST_CHECK( a <= as2 );
- BOOST_CHECK( a <= acs2 );
-
- BOOST_CHECK( b >= a );
- BOOST_CHECK( bs >= a );
- BOOST_CHECK( bcs >= a );
- BOOST_CHECK( b >= as );
- BOOST_CHECK( b >= acs );
-
- BOOST_CHECK( a2 >= a );
- BOOST_CHECK( as2 >= a );
- BOOST_CHECK( acs2 >= a );
- BOOST_CHECK( a2 >= as );
- BOOST_CHECK( a2 >= acs );
+ 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_CHECK( path("a/b").extension() == "" );
- BOOST_CHECK( path("a/b.txt").extension() == ".txt" );
- BOOST_CHECK( path("a/b.").extension() == "." );
- BOOST_CHECK( path("a.b.c").extension() == ".c" );
- BOOST_CHECK( path("a.b.c.").extension() == "." );
- BOOST_CHECK( path("").extension() == "" );
- BOOST_CHECK( path("a/").extension() == "." );
+ 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_CHECK( path("b").stem() == "b" );
- BOOST_CHECK( path("a/b.txt").stem() == "b" );
- BOOST_CHECK( path("a/b.").stem() == "b" );
- BOOST_CHECK( path("a.b.c").stem() == "a.b" );
- BOOST_CHECK( path("a.b.c.").stem() == "a.b.c" );
- BOOST_CHECK( path("").stem() == "" );
+ 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_CHECK( path("a.txt").replace_extension("").string() == "a" );
- BOOST_CHECK( path("a.txt").replace_extension(".").string() == "a." );
- BOOST_CHECK( path("a.txt").replace_extension(".tex").string() == "a.tex" );
- BOOST_CHECK( path("a.txt").replace_extension("tex").string() == "a.tex" );
- BOOST_CHECK( path("a.").replace_extension(".tex").string() == "a.tex" );
- BOOST_CHECK( path("a.").replace_extension("tex").string() == "a.tex" );
- BOOST_CHECK( path("a").replace_extension(".txt").string() == "a.txt" );
- BOOST_CHECK( path("a").replace_extension("txt").string() == "a.txt" );
- BOOST_CHECK( path("a.b.txt" ).replace_extension(".tex").string() == "a.b.tex" );
- BOOST_CHECK( path("a.b.txt" ).replace_extension("tex").string() == "a.b.tex" );
+ 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_CHECK( path("").replace_extension(".png").string() == ".png" );
+ 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
@@ -1337,9 +1337,9 @@
ss << fs::path( "foo/bar" ) << std::endl;
fs::path round_trip;
ss >> round_trip;
- BOOST_CHECK( round_trip.string() == "foo/bar" );
+ BOOST_TEST( round_trip.string() == "foo/bar" );
std::cout << round_trip.string() << "..." << round_trip << " complete\n";
# endif
- return boost::test_framework::errors();
+ return ::boost::report_errors();
}
Modified: trunk/libs/filesystem/test/wide_test.cpp
==============================================================================
--- trunk/libs/filesystem/test/wide_test.cpp (original)
+++ trunk/libs/filesystem/test/wide_test.cpp 2009-03-25 08:11:47 EDT (Wed, 25 Mar 2009)
@@ -21,7 +21,7 @@
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/fstream.hpp>
#include <boost/scoped_array.hpp>
-#include <boost/detail/test_framework.hpp>
+#include <boost/detail/lightweight_test.hpp>
#include "../src/utf8_codecvt_facet.hpp"
@@ -60,37 +60,37 @@
{
Path tmp;
tmp = file;
- BOOST_CHECK( tmp == file );
+ BOOST_TEST( tmp == file );
tmp = file.string();
- BOOST_CHECK( tmp == file );
+ BOOST_TEST( tmp == file );
tmp = file.string().c_str();
- BOOST_CHECK( tmp == file );
+ BOOST_TEST( tmp == file );
fs::initial_path<Path>();
fs::current_path<Path>();
fs::remove( dir / file );
fs::remove( dir );
- BOOST_CHECK( !fs::exists( dir / file ) );
- BOOST_CHECK( !fs::exists( dir ) );
- BOOST_CHECK( fs::create_directory( dir ) );
- BOOST_CHECK( fs::exists( dir ) );
- BOOST_CHECK( fs::is_directory( dir ) );
- BOOST_CHECK( fs::is_empty( 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_CHECK( fs::exists( dir / file ) );
- BOOST_CHECK( !fs::is_directory( dir / file ) );
- BOOST_CHECK( !fs::is_empty( dir / file ) );
- BOOST_CHECK( fs::file_size( dir / file ) == 23 || fs::file_size( dir / file ) == 24 );
- BOOST_CHECK( fs::equivalent( dir / file, dot / dir / file ) );
- BOOST_CHECK( fs::last_write_time( dir / file ) );
+ 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_CHECK( it->path() == dir / file );
- BOOST_CHECK( !fs::is_empty( it->path() ) );
+ BOOST_TEST( it->path() == dir / file );
+ BOOST_TEST( !fs::is_empty( it->path() ) );
++count;
}
- BOOST_CHECK( count == 1 );
+ BOOST_TEST( count == 1 );
if ( cleanup )
{
fs::remove( dir / file );
@@ -134,8 +134,8 @@
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_CHECK( to_external( L"\x2780" ).size() == 3 );
- BOOST_CHECK( to_external( L"\x2780" ) == "\xE2\x9E\x80" );
+ 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;
@@ -157,5 +157,5 @@
test( ::user::lpath( dir ), ::user::lpath( file ), ::user::lpath( dot ) );
std::cout << "complete\n\n";
- return boost::test_framework::errors();
+ return ::boost::report_errors();
}
Modified: trunk/libs/system/test/error_code_test.cpp
==============================================================================
--- trunk/libs/system/test/error_code_test.cpp (original)
+++ trunk/libs/system/test/error_code_test.cpp 2009-03-25 08:11:47 EDT (Wed, 25 Mar 2009)
@@ -11,7 +11,7 @@
#include <boost/config/warning_disable.hpp>
-#include <boost/detail/test_framework.hpp>
+#include <boost/detail/lightweight_test.hpp>
#include <boost/system/error_code.hpp>
#include <boost/system/cygwin_error.hpp>
#include <boost/system/linux_error.hpp>
@@ -45,7 +45,7 @@
ss << ec;
ss >> s;
- BOOST_CHECK( s == expected );
+ BOOST_TEST( s == expected );
}
}
@@ -59,86 +59,86 @@
std::cout << "General tests...\n";
// unit tests:
- BOOST_CHECK( posix_category == posix_category );
- BOOST_CHECK( system_category == system_category );
- BOOST_CHECK( posix_category != system_category );
- BOOST_CHECK( system_category != posix_category );
+ BOOST_TEST( posix_category == posix_category );
+ BOOST_TEST( system_category == system_category );
+ BOOST_TEST( posix_category != system_category );
+ BOOST_TEST( system_category != posix_category );
if ( std::less<const error_category*>()( &posix_category, &system_category ) )
{
- BOOST_CHECK( posix_category < system_category );
- BOOST_CHECK( !(system_category < posix_category) );
+ BOOST_TEST( posix_category < system_category );
+ BOOST_TEST( !(system_category < posix_category) );
}
else
{
- BOOST_CHECK( system_category < posix_category );
- BOOST_CHECK( !(posix_category < system_category) );
+ BOOST_TEST( system_category < posix_category );
+ BOOST_TEST( !(posix_category < system_category) );
}
error_code ec;
error_condition dec;
- BOOST_CHECK( !ec );
- BOOST_CHECK( ec.value() == 0 );
+ BOOST_TEST( !ec );
+ BOOST_TEST( ec.value() == 0 );
dec = ec.default_error_condition();
- BOOST_CHECK( dec.value() == 0 );
- BOOST_CHECK( dec.category() == posix_category );
- BOOST_CHECK( ec == posix::success );
- BOOST_CHECK( ec.category() == system_category );
- BOOST_CHECK( std::strcmp( ec.category().name(), "system") == 0 );
- BOOST_CHECK( !(ec < error_code( 0, system_category )) );
- BOOST_CHECK( !(error_code( 0, system_category ) < ec) );
- BOOST_CHECK( ec < error_code( 1, system_category ) );
- BOOST_CHECK( !(error_code( 1, system_category ) < ec) );
+ BOOST_TEST( dec.value() == 0 );
+ BOOST_TEST( dec.category() == posix_category );
+ BOOST_TEST( ec == posix::success );
+ BOOST_TEST( ec.category() == system_category );
+ BOOST_TEST( std::strcmp( ec.category().name(), "system") == 0 );
+ BOOST_TEST( !(ec < error_code( 0, system_category )) );
+ BOOST_TEST( !(error_code( 0, system_category ) < ec) );
+ BOOST_TEST( ec < error_code( 1, system_category ) );
+ BOOST_TEST( !(error_code( 1, system_category ) < ec) );
error_code ec_0_system( 0, system_category );
- BOOST_CHECK( !ec_0_system );
- BOOST_CHECK( ec_0_system.value() == 0 );
+ BOOST_TEST( !ec_0_system );
+ BOOST_TEST( ec_0_system.value() == 0 );
dec = ec_0_system.default_error_condition();
- BOOST_CHECK( dec.value() == 0 );
- BOOST_CHECK( dec.category() == posix_category );
- BOOST_CHECK( ec_0_system == posix::success );
- BOOST_CHECK( ec_0_system.category() == system_category );
- BOOST_CHECK( std::strcmp( ec_0_system.category().name(), "system") == 0 );
+ BOOST_TEST( dec.value() == 0 );
+ BOOST_TEST( dec.category() == posix_category );
+ BOOST_TEST( ec_0_system == posix::success );
+ BOOST_TEST( ec_0_system.category() == system_category );
+ BOOST_TEST( std::strcmp( ec_0_system.category().name(), "system") == 0 );
check_ostream( ec_0_system, "system:0" );
- BOOST_CHECK( ec_0_system == ec );
+ BOOST_TEST( ec_0_system == ec );
error_code ec_1_system( 1, system_category );
- BOOST_CHECK( ec_1_system );
- BOOST_CHECK( ec_1_system.value() == 1 );
- BOOST_CHECK( ec_1_system.value() != 0 );
- BOOST_CHECK( ec != ec_1_system );
- BOOST_CHECK( ec_0_system != ec_1_system );
+ BOOST_TEST( ec_1_system );
+ BOOST_TEST( ec_1_system.value() == 1 );
+ BOOST_TEST( ec_1_system.value() != 0 );
+ BOOST_TEST( ec != ec_1_system );
+ BOOST_TEST( ec_0_system != ec_1_system );
check_ostream( ec_1_system, "system:1" );
ec = error_code( BOOST_ACCESS_ERROR_MACRO, system_category );
- BOOST_CHECK( ec );
- BOOST_CHECK( ec.value() == BOOST_ACCESS_ERROR_MACRO );
+ BOOST_TEST( ec );
+ BOOST_TEST( ec.value() == BOOST_ACCESS_ERROR_MACRO );
dec = ec.default_error_condition();
- BOOST_CHECK( dec.value() == static_cast<int>(posix::permission_denied) );
- BOOST_CHECK( dec.category() == posix_category );
- BOOST_CHECK( dec == error_condition( posix::permission_denied, posix_category ) );
- BOOST_CHECK( dec == posix::permission_denied );
- BOOST_CHECK( posix::permission_denied == dec );
- BOOST_CHECK( ec == posix::permission_denied );
- BOOST_CHECK( ec.category() == system_category );
- BOOST_CHECK( std::strcmp( ec.category().name(), "system") == 0 );
+ BOOST_TEST( dec.value() == static_cast<int>(posix::permission_denied) );
+ BOOST_TEST( dec.category() == posix_category );
+ BOOST_TEST( dec == error_condition( posix::permission_denied, posix_category ) );
+ BOOST_TEST( dec == posix::permission_denied );
+ BOOST_TEST( posix::permission_denied == dec );
+ BOOST_TEST( ec == posix::permission_denied );
+ BOOST_TEST( ec.category() == system_category );
+ BOOST_TEST( std::strcmp( ec.category().name(), "system") == 0 );
// test the explicit make_error_code conversion for posix
ec = make_error_code( posix::bad_message );
- BOOST_CHECK( ec );
- BOOST_CHECK( ec == posix::bad_message );
- BOOST_CHECK( posix::bad_message == ec );
- BOOST_CHECK( ec != posix::permission_denied );
- BOOST_CHECK( posix::permission_denied != ec );
- BOOST_CHECK( ec.category() == posix_category );
+ BOOST_TEST( ec );
+ BOOST_TEST( ec == posix::bad_message );
+ BOOST_TEST( posix::bad_message == ec );
+ BOOST_TEST( ec != posix::permission_denied );
+ BOOST_TEST( posix::permission_denied != ec );
+ BOOST_TEST( ec.category() == posix_category );
// test the deprecated predefined error_category synonyms
- BOOST_CHECK( &system_category == &native_ecat );
- BOOST_CHECK( &posix_category == &errno_ecat );
- BOOST_CHECK( system_category == native_ecat );
- BOOST_CHECK( posix_category == errno_ecat );
+ BOOST_TEST( &system_category == &native_ecat );
+ BOOST_TEST( &posix_category == &errno_ecat );
+ BOOST_TEST( system_category == native_ecat );
+ BOOST_TEST( posix_category == errno_ecat );
// test error_code and error_condition message();
// see Boost.Filesystem operations_test for code specific message() tests
@@ -146,120 +146,120 @@
std::cout << "error_code message for -1 is \"" << ec.message() << "\"\n";
#if defined(BOOST_WINDOWS_API)
// Borland appends newline, so just check text
- BOOST_CHECK( ec.message().substr(0,13) == "Unknown error" );
+ BOOST_TEST( ec.message().substr(0,13) == "Unknown error" );
#elif defined(linux) || defined(__linux) || defined(__linux__)
// Linux appends value to message as unsigned, so it varies with # of bits
- BOOST_CHECK( ec.message().substr(0,13) == "Unknown error" );
+ BOOST_TEST( ec.message().substr(0,13) == "Unknown error" );
#elif defined(__hpux)
- BOOST_CHECK( ec.message() == "" );
+ BOOST_TEST( ec.message() == "" );
#elif defined(__osf__)
- BOOST_CHECK( ec.message() == "Error -1 occurred." );
+ BOOST_TEST( ec.message() == "Error -1 occurred." );
#elif defined(__vms)
- BOOST_CHECK( ec.message() == "error -1" );
+ BOOST_TEST( ec.message() == "error -1" );
#endif
ec = error_code( BOOST_ACCESS_ERROR_MACRO, system_category );
- BOOST_CHECK( ec.message() != "" );
- BOOST_CHECK( ec.message().substr( 0, 13) != "Unknown error" );
+ BOOST_TEST( ec.message() != "" );
+ BOOST_TEST( ec.message().substr( 0, 13) != "Unknown error" );
dec = error_condition( -1, posix_category );
std::cout << "error_condition message for -1 is \"" << dec.message() << "\"\n";
#if defined(BOOST_WINDOWS_API)
// Borland appends newline, so just check text
- BOOST_CHECK( dec.message().substr(0,13) == "Unknown error" );
+ BOOST_TEST( dec.message().substr(0,13) == "Unknown error" );
#elif defined(linux) || defined(__linux) || defined(__linux__)
// Linux appends value to message as unsigned, so it varies with # of bits
- BOOST_CHECK( dec.message().substr(0,13) == "Unknown error" );
+ BOOST_TEST( dec.message().substr(0,13) == "Unknown error" );
#elif defined(__hpux)
- BOOST_CHECK( dec.message() == "" );
+ BOOST_TEST( dec.message() == "" );
#elif defined(__osf__)
- BOOST_CHECK( dec.message() == "Error -1 occurred." );
+ BOOST_TEST( dec.message() == "Error -1 occurred." );
#elif defined(__vms)
- BOOST_CHECK( dec.message() == "error -1" );
+ BOOST_TEST( dec.message() == "error -1" );
#endif
dec = error_condition( BOOST_ACCESS_ERROR_MACRO, posix_category );
- BOOST_CHECK( dec.message() != "" );
- BOOST_CHECK( dec.message().substr( 0, 13) != "Unknown error" );
+ BOOST_TEST( dec.message() != "" );
+ BOOST_TEST( dec.message().substr( 0, 13) != "Unknown error" );
#ifdef BOOST_WINDOWS_API
std::cout << "Windows tests...\n";
// these tests probe the Windows posix decoder
// test the first entry in the decoder table:
ec = error_code( ERROR_ACCESS_DENIED, system_category );
- BOOST_CHECK( ec.value() == ERROR_ACCESS_DENIED );
- BOOST_CHECK( ec == posix::permission_denied );
- BOOST_CHECK( ec.default_error_condition().value() == posix::permission_denied );
- BOOST_CHECK( ec.default_error_condition().category() == posix_category );
+ BOOST_TEST( ec.value() == ERROR_ACCESS_DENIED );
+ BOOST_TEST( ec == posix::permission_denied );
+ BOOST_TEST( ec.default_error_condition().value() == posix::permission_denied );
+ BOOST_TEST( ec.default_error_condition().category() == posix_category );
// test the second entry in the decoder table:
ec = error_code( ERROR_ALREADY_EXISTS, system_category );
- BOOST_CHECK( ec.value() == ERROR_ALREADY_EXISTS );
- BOOST_CHECK( ec == posix::file_exists );
- BOOST_CHECK( ec.default_error_condition().value() == posix::file_exists );
- BOOST_CHECK( ec.default_error_condition().category() == posix_category );
+ BOOST_TEST( ec.value() == ERROR_ALREADY_EXISTS );
+ BOOST_TEST( ec == posix::file_exists );
+ BOOST_TEST( ec.default_error_condition().value() == posix::file_exists );
+ BOOST_TEST( ec.default_error_condition().category() == posix_category );
// test the third entry in the decoder table:
ec = error_code( ERROR_BAD_UNIT, system_category );
- BOOST_CHECK( ec.value() == ERROR_BAD_UNIT );
- BOOST_CHECK( ec == posix::no_such_device );
- BOOST_CHECK( ec.default_error_condition().value() == posix::no_such_device );
- BOOST_CHECK( ec.default_error_condition().category() == posix_category );
+ BOOST_TEST( ec.value() == ERROR_BAD_UNIT );
+ BOOST_TEST( ec == posix::no_such_device );
+ BOOST_TEST( ec.default_error_condition().value() == posix::no_such_device );
+ BOOST_TEST( ec.default_error_condition().category() == posix_category );
// test the last non-Winsock entry in the decoder table:
ec = error_code( ERROR_WRITE_PROTECT, system_category );
- BOOST_CHECK( ec.value() == ERROR_WRITE_PROTECT );
- BOOST_CHECK( ec == posix::permission_denied );
- BOOST_CHECK( ec.default_error_condition().value() == posix::permission_denied );
- BOOST_CHECK( ec.default_error_condition().category() == posix_category );
+ BOOST_TEST( ec.value() == ERROR_WRITE_PROTECT );
+ BOOST_TEST( ec == posix::permission_denied );
+ BOOST_TEST( ec.default_error_condition().value() == posix::permission_denied );
+ BOOST_TEST( ec.default_error_condition().category() == posix_category );
// test the last Winsock entry in the decoder table:
ec = error_code( WSAEWOULDBLOCK, system_category );
- BOOST_CHECK( ec.value() == WSAEWOULDBLOCK );
- BOOST_CHECK( ec == posix::operation_would_block );
- BOOST_CHECK( ec.default_error_condition().value() == posix::operation_would_block );
- BOOST_CHECK( ec.default_error_condition().category() == posix_category );
+ BOOST_TEST( ec.value() == WSAEWOULDBLOCK );
+ BOOST_TEST( ec == posix::operation_would_block );
+ BOOST_TEST( ec.default_error_condition().value() == posix::operation_would_block );
+ BOOST_TEST( ec.default_error_condition().category() == posix_category );
// test not-in-table condition:
ec = error_code( 1234567890, system_category );
- BOOST_CHECK( ec.value() == 1234567890 );
- BOOST_CHECK( ec.default_error_condition().value() == 1234567890 );
- BOOST_CHECK( ec.default_error_condition().category() == system_category );
+ BOOST_TEST( ec.value() == 1234567890 );
+ BOOST_TEST( ec.default_error_condition().value() == 1234567890 );
+ BOOST_TEST( ec.default_error_condition().category() == system_category );
#else // POSIX
std::cout << "POSIX tests...\n";
ec = error_code( EACCES, system_category );
- BOOST_CHECK( ec == error_code( posix::permission_denied, system_category ) );
- BOOST_CHECK( error_code( posix::permission_denied, system_category ) == ec );
- BOOST_CHECK( ec == posix::permission_denied );
- BOOST_CHECK( posix::permission_denied == ec );
- BOOST_CHECK( ec.default_error_condition().value() == posix::permission_denied );
- BOOST_CHECK( ec.default_error_condition().category() == posix_category );
+ BOOST_TEST( ec == error_code( posix::permission_denied, system_category ) );
+ BOOST_TEST( error_code( posix::permission_denied, system_category ) == ec );
+ BOOST_TEST( ec == posix::permission_denied );
+ BOOST_TEST( posix::permission_denied == ec );
+ BOOST_TEST( ec.default_error_condition().value() == posix::permission_denied );
+ BOOST_TEST( ec.default_error_condition().category() == posix_category );
# ifdef __CYGWIN__
std::cout << "Cygwin tests...\n";
ec = cygwin_error::no_package;
- BOOST_CHECK( ec == cygwin_error::no_package );
- BOOST_CHECK( ec == error_code( ENOPKG, system_category ) );
- BOOST_CHECK( ec == error_code( cygwin_error::no_package, system_category ) );
- BOOST_CHECK( ec.default_error_condition().category() == system_category );
+ BOOST_TEST( ec == cygwin_error::no_package );
+ BOOST_TEST( ec == error_code( ENOPKG, system_category ) );
+ BOOST_TEST( ec == error_code( cygwin_error::no_package, system_category ) );
+ BOOST_TEST( ec.default_error_condition().category() == system_category );
# elif defined(linux) || defined(__linux) || defined(__linux__)
std::cout << "Linux tests...\n";
ec = linux_error::dot_dot_error;
- BOOST_CHECK( ec == linux_error::dot_dot_error );
- BOOST_CHECK( ec == error_code( EDOTDOT, system_category ) );
- BOOST_CHECK( ec == error_code( linux_error::dot_dot_error, system_category ) );
- BOOST_CHECK( ec.default_error_condition().category() == system_category );
+ BOOST_TEST( ec == linux_error::dot_dot_error );
+ BOOST_TEST( ec == error_code( EDOTDOT, system_category ) );
+ BOOST_TEST( ec == error_code( linux_error::dot_dot_error, system_category ) );
+ BOOST_TEST( ec.default_error_condition().category() == system_category );
# endif
#endif
- return boost::test_framework::errors();
+ 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