From 888786e838d9d486d74a906d5b7941a42d7abdc6 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Sun, 12 Oct 2008 14:07:22 +0000 Subject: [PATCH 01/10] System: apply patch from ticket #2175 [SVN r49293] --- src/error_code.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/error_code.cpp b/src/error_code.cpp index 55fcfc6..030ab70 100644 --- a/src/error_code.cpp +++ b/src/error_code.cpp @@ -80,7 +80,8 @@ namespace # if defined(BOOST_WINDOWS_API) || defined(__hpux) || defined(__sun)\ || (defined(__linux) && (!defined(__USE_XOPEN2K) || defined(BOOST_SYSTEM_USE_STRERROR)))\ || (defined(__osf__) && !defined(_REENTRANT))\ - || (defined(__vms)) + || (defined(__vms))\ + || (defined(__QNXNTO__)) const char * c_str = std::strerror( ev ); return c_str ? std::string( c_str ) From 3e8a2633f4687c139c03b1be08378679f4994249 Mon Sep 17 00:00:00 2001 From: "Michael A. Jackson" Date: Sat, 1 Nov 2008 13:15:41 +0000 Subject: [PATCH 02/10] Continuing merge of CMake build system files into trunk with the encouragement of Doug Gregor [SVN r49510] --- CMakeLists.txt | 21 +++++++++++++++++++++ module.cmake | 1 + src/CMakeLists.txt | 7 +++++++ 3 files changed, 29 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 module.cmake create mode 100644 src/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..f47093f --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,21 @@ +#---------------------------------------------------------------------------- +# This file was automatically generated from the original CMakeLists.txt file +# Add a variable to hold the headers for the library +set (lib_headers + system +) + +# Add a library target to the build system +boost_library_project( + system + SRCDIRS src + # TESTDIRS + HEADERS ${lib_headers} + # DOCDIRS + # DESCRIPTION + MODULARIZED + # AUTHORS + # MAINTAINERS +) + + diff --git a/module.cmake b/module.cmake new file mode 100644 index 0000000..9a50a96 --- /dev/null +++ b/module.cmake @@ -0,0 +1 @@ +boost_module(system DEPENDS utility) \ No newline at end of file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..38c4818 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,7 @@ +boost_add_library( + boost_system + error_code.cpp + SHARED_COMPILE_FLAGS "-DBOOST_SYSTEM_DYN_LINK=1" + STATIC_COMPILE_FLAGS "-DBOOST_SYSTEM_STATIC_LINK=1" + ) + From 99ee7ddaab9e783be11410c52ed64a6ad2b95519 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Thu, 13 Nov 2008 15:57:04 +0000 Subject: [PATCH 03/10] System: rename msvc_system -> system->msvc so VC++ start page recent solutions list is easier to use [SVN r49716] --- test/{msvc_system => system_msvc}/common.vsprops | 0 .../error_code_test/error_code_test.vcproj | 0 test/{msvc_system/msvc_system.sln => system_msvc/system_msvc.sln} | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename test/{msvc_system => system_msvc}/common.vsprops (100%) rename test/{msvc_system => system_msvc}/error_code_test/error_code_test.vcproj (100%) rename test/{msvc_system/msvc_system.sln => system_msvc/system_msvc.sln} (100%) diff --git a/test/msvc_system/common.vsprops b/test/system_msvc/common.vsprops similarity index 100% rename from test/msvc_system/common.vsprops rename to test/system_msvc/common.vsprops diff --git a/test/msvc_system/error_code_test/error_code_test.vcproj b/test/system_msvc/error_code_test/error_code_test.vcproj similarity index 100% rename from test/msvc_system/error_code_test/error_code_test.vcproj rename to test/system_msvc/error_code_test/error_code_test.vcproj diff --git a/test/msvc_system/msvc_system.sln b/test/system_msvc/system_msvc.sln similarity index 100% rename from test/msvc_system/msvc_system.sln rename to test/system_msvc/system_msvc.sln From a6728e5fb9c449451dd14fbfe124f2ac23026e6e Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Thu, 13 Nov 2008 16:05:49 +0000 Subject: [PATCH 04/10] System: add deprecated get_posix_category() to fix ticket #2461 [SVN r49717] --- include/boost/system/error_code.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/boost/system/error_code.hpp b/include/boost/system/error_code.hpp index c79c26c..8f795d7 100644 --- a/include/boost/system/error_code.hpp +++ b/include/boost/system/error_code.hpp @@ -207,6 +207,7 @@ namespace boost # ifndef BOOST_SYSTEM_NO_DEPRECATED // deprecated synonyms + inline const error_category & get_posix_category() { return get_generic_category(); } static const error_category & posix_category = get_generic_category(); static const error_category & errno_ecat = get_generic_category(); static const error_category & native_ecat = get_system_category(); @@ -214,7 +215,7 @@ namespace boost // class error_condition -----------------------------------------------// - // error_conditions are portable, error_codes are system or lib specific + // error_conditions are portable, error_codes are system or library specific class error_condition { From 5bc362e4f303f18b9e70b60ee975ad1491bbdc5e Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Wed, 21 Jan 2009 18:01:14 +0000 Subject: [PATCH 05/10] System: provide optional throws function rather than throws object [SVN r50705] --- include/boost/system/error_code.hpp | 10 ++++++++++ src/error_code.cpp | 2 ++ 2 files changed, 12 insertions(+) diff --git a/include/boost/system/error_code.hpp b/include/boost/system/error_code.hpp index 8f795d7..55c3b04 100644 --- a/include/boost/system/error_code.hpp +++ b/include/boost/system/error_code.hpp @@ -384,7 +384,17 @@ namespace boost }; // predefined error_code object used as "throw on error" tag +# ifndef BOOST_SYSTEM_THROWS_FUNCTION BOOST_SYSTEM_DECL extern error_code throws; +# else + namespace detail { inline error_code * throws() { return 0; } } + // prevent misuse by poisoning the reference in a way that doesn't + // produce warnings or errors from popular compilers, and is also + // very efficient (as determined by inspectiing generated code) + + inline error_code & throws() + { return *detail::throws(); } +# endif // non-member functions ------------------------------------------------// diff --git a/src/error_code.cpp b/src/error_code.cpp index 030ab70..fac174e 100644 --- a/src/error_code.cpp +++ b/src/error_code.cpp @@ -411,11 +411,13 @@ namespace boost namespace system { +# ifndef BOOST_SYSTEM_THROWS_FUNCTION BOOST_SYSTEM_DECL error_code throws; // "throw on error" special error_code; // note that it doesn't matter if this // isn't initialized before use since // the only use is to take its // address for comparison purposes +# endif BOOST_SYSTEM_DECL const error_category & get_system_category() { From f1cdde273ab641d91eab9c4baf9ea218dac527c5 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Thu, 22 Jan 2009 14:47:50 +0000 Subject: [PATCH 06/10] System: move throws function to namespace boost to allow peaceful coexistence with throws object. [SVN r50727] --- include/boost/system/error_code.hpp | 30 ++++++++++++++++++++--------- src/error_code.cpp | 2 +- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/include/boost/system/error_code.hpp b/include/boost/system/error_code.hpp index 55c3b04..87f255d 100644 --- a/include/boost/system/error_code.hpp +++ b/include/boost/system/error_code.hpp @@ -384,18 +384,30 @@ namespace boost }; // predefined error_code object used as "throw on error" tag -# ifndef BOOST_SYSTEM_THROWS_FUNCTION +# ifndef BOOST_SYSTEM_NO_DEPRECATED BOOST_SYSTEM_DECL extern error_code throws; -# else - namespace detail { inline error_code * throws() { return 0; } } - // prevent misuse by poisoning the reference in a way that doesn't - // produce warnings or errors from popular compilers, and is also - // very efficient (as determined by inspectiing generated code) - - inline error_code & throws() - { return *detail::throws(); } # endif + // Moving from a "throws" object to a "throws" function without breaking + // existing code is a bit of a problem. The workaround is to place the + // "throws" function in namespace boost rather than namespace boost::system. + + } // namespace system + + namespace detail { inline system::error_code * throws() { return 0; } } + // Misuse of the error_code object is turned into a noisy failure by + // poisoning the reference. This particular implementation doesn't + // produce warnings or errors from popular compilers, is very efficient + // (as determined by inspecting generated code), and does not suffer + // from order of initialization problems. In practice, it also seems + // cause user function error handling implementation errors to be detected + // very early in the development cycle. + + inline system::error_code & throws() + { return *detail::throws(); } + + namespace system + { // non-member functions ------------------------------------------------// inline bool operator!=( const error_code & lhs, diff --git a/src/error_code.cpp b/src/error_code.cpp index fac174e..43119ae 100644 --- a/src/error_code.cpp +++ b/src/error_code.cpp @@ -411,7 +411,7 @@ namespace boost namespace system { -# ifndef BOOST_SYSTEM_THROWS_FUNCTION +# ifndef BOOST_SYSTEM_NO_DEPRECATED BOOST_SYSTEM_DECL error_code throws; // "throw on error" special error_code; // note that it doesn't matter if this // isn't initialized before use since From 83db702d995388b885f1cd51ffdc467650e790b8 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Tue, 24 Mar 2009 15:38:10 +0000 Subject: [PATCH 07/10] System: removed dependency on Boost.Test [SVN r51960] --- test/error_code_test.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/error_code_test.cpp b/test/error_code_test.cpp index 330ddf0..626690e 100644 --- a/test/error_code_test.cpp +++ b/test/error_code_test.cpp @@ -11,7 +11,7 @@ #include -#include +#include #include #include #include @@ -49,11 +49,11 @@ namespace } } -// test_main ---------------------------------------------------------------// +// main ------------------------------------------------------------------------------// // TODO: add hash_value tests -int test_main( int, char ** ) +int main( int, char ** ) { std::cout << "General tests...\n"; @@ -259,7 +259,7 @@ int test_main( int, char ** ) #endif - return 0; + return boost::test_framework::errors(); } From fd0605bd7ed2344c2116bf96f26f85c5fb1215de Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Wed, 25 Mar 2009 12:11:47 +0000 Subject: [PATCH 08/10] System, Filesystem: remove boost/detail/test_framework.hpp; use boost/detail/lightweight_test.hpp instead (Thanks to Peter Dimov for pointing this out) [SVN r51966] --- test/error_code_test.cpp | 212 +++++++++++++++++++-------------------- 1 file changed, 106 insertions(+), 106 deletions(-) diff --git a/test/error_code_test.cpp b/test/error_code_test.cpp index 626690e..69f6c3c 100644 --- a/test/error_code_test.cpp +++ b/test/error_code_test.cpp @@ -11,7 +11,7 @@ #include -#include +#include #include #include #include @@ -45,7 +45,7 @@ namespace ss << ec; ss >> s; - BOOST_CHECK( s == expected ); + BOOST_TEST( s == expected ); } } @@ -59,86 +59,86 @@ int main( int, char ** ) 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()( &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(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(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 @@ int main( int, char ** ) 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(); } From 3f26239374c4d20d5d37e45658fd924e95d60857 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Sat, 30 May 2009 15:13:39 +0000 Subject: [PATCH 09/10] System: fix #3113 [SVN r53460] --- src/error_code.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/error_code.cpp b/src/error_code.cpp index 43119ae..3eb6a21 100644 --- a/src/error_code.cpp +++ b/src/error_code.cpp @@ -23,7 +23,7 @@ #include using namespace boost::system; -using namespace boost::system::posix_error; +using namespace boost::system::errc; #include // for strerror/strerror_r From 078a1f23c4824ee7ddfa0eca2cc84fbba9cb4d0c Mon Sep 17 00:00:00 2001 From: "Troy D. Straszheim" Date: Sun, 26 Jul 2009 00:49:56 +0000 Subject: [PATCH 10/10] Copyrights on CMakeLists.txt to keep them from clogging up the inspect reports. This is essentially the same commit as r55095 on the release branch. [SVN r55159] --- CMakeLists.txt | 6 ++++++ src/CMakeLists.txt | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index f47093f..b4f92f3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,3 +1,9 @@ +# +# Copyright Troy D. Straszheim +# +# Distributed under the Boost Software License, Version 1.0. +# See http://www.boost.org/LICENSE_1_0.txt +# #---------------------------------------------------------------------------- # This file was automatically generated from the original CMakeLists.txt file # Add a variable to hold the headers for the library diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 38c4818..999684f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,3 +1,9 @@ +# +# Copyright Troy D. Straszheim +# +# Distributed under the Boost Software License, Version 1.0. +# See http://www.boost.org/LICENSE_1_0.txt +# boost_add_library( boost_system error_code.cpp