forked from boostorg/system
Merge trunk, including changes to come into closer conformance with C++0x FCD
[SVN r63685]
This commit is contained in:
+13
-3
@@ -12,6 +12,12 @@ project
|
||||
<library>/boost/system//boost_system
|
||||
<toolset>msvc:<asynch-exceptions>on
|
||||
;
|
||||
|
||||
lib throw_test
|
||||
: throw_test.cpp
|
||||
: <link>shared:<define>BOOST_SYSTEM_DYN_LINK=1
|
||||
;
|
||||
|
||||
|
||||
test-suite "system"
|
||||
: [ run error_code_test.cpp
|
||||
@@ -21,21 +27,25 @@ project
|
||||
<link>static
|
||||
]
|
||||
[ run error_code_test.cpp
|
||||
: : : : error_code_test_dll
|
||||
: : : <link>shared : error_code_test_shared
|
||||
]
|
||||
[ run error_code_user_test.cpp
|
||||
: : : <link>static
|
||||
]
|
||||
[ run error_code_user_test.cpp
|
||||
: : : : error_code_user_test_dll
|
||||
: : : <link>shared : error_code_user_test_shared
|
||||
]
|
||||
[ run system_error_test.cpp
|
||||
: : : <link>static
|
||||
]
|
||||
[ run system_error_test.cpp
|
||||
: : : : system_error_test_dll
|
||||
: : : <link>shared : system_error_test_shared
|
||||
]
|
||||
[ run dynamic_link_test.cpp throw_test
|
||||
: : : <link>shared : throw_test_shared
|
||||
]
|
||||
[ run initialization_test.cpp
|
||||
: : : <link>shared : initialization_test_shared
|
||||
]
|
||||
[ run header_only_test.cpp
|
||||
: : : <link>static
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
// dynamic_link_test.cpp -------------------------------------------------------------//
|
||||
|
||||
// Copyright Beman Dawes 2010
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
// Library home page is www.boost.org/libs/system
|
||||
|
||||
//--------------------------------------------------------------------------------------//
|
||||
|
||||
// Dynamic link libraries (DLL's), also know as dynamic shared objects (DSO's),
|
||||
// can cause symbol visability problems unless carefully configured. One of the
|
||||
// manifestations, particularly with GCC, is that a system_error exception thrown from
|
||||
// a DLL or DSO is not caught.
|
||||
//
|
||||
// The purpose of this program is to test for that error.
|
||||
|
||||
//--------------------------------------------------------------------------------------//
|
||||
|
||||
#include <boost/system/system_error.hpp>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace system
|
||||
{
|
||||
BOOST_SYSTEM_DECL void throw_test();
|
||||
}
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
try
|
||||
{
|
||||
boost::system::throw_test();
|
||||
}
|
||||
catch (const boost::system::system_error& ex)
|
||||
{
|
||||
std::cout << " caught boost::system::system_error as expected\n";
|
||||
std::cout << " what() reports " << ex.what() << '\n';
|
||||
return 0;
|
||||
}
|
||||
|
||||
catch (const std::runtime_error& ex)
|
||||
{
|
||||
std::cout << " error: caught std::runtime_error instead of boost::system::system_error\n";
|
||||
std::cout << " what() reports " << ex.what() << '\n';
|
||||
return 1;
|
||||
}
|
||||
|
||||
std::cout << " error: failed to catch boost::system::system_error\n";
|
||||
return 1;
|
||||
}
|
||||
+110
-96
@@ -7,7 +7,10 @@
|
||||
|
||||
// See library home page at http://www.boost.org/libs/system
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
//----------------------------------------------------------------------------//
|
||||
|
||||
// test without deprecated features
|
||||
#define BOOST_SYSTEM_NO_DEPRECATED
|
||||
|
||||
#include <boost/config/warning_disable.hpp>
|
||||
|
||||
@@ -56,55 +59,61 @@ namespace
|
||||
int main( int, char ** )
|
||||
{
|
||||
|
||||
std::cout << "Conversion use cases...\n";
|
||||
error_condition x1( errc::file_exists );
|
||||
//error_code x2( errc::file_exists ); // should fail to compile
|
||||
make_error_code(errc::file_exists);
|
||||
make_error_condition(errc::file_exists);
|
||||
|
||||
std::cout << "General tests...\n";
|
||||
// unit tests:
|
||||
|
||||
BOOST_TEST( posix_category == posix_category );
|
||||
BOOST_TEST( system_category == system_category );
|
||||
BOOST_TEST( posix_category != system_category );
|
||||
BOOST_TEST( system_category != posix_category );
|
||||
BOOST_TEST( generic_category() == generic_category() );
|
||||
BOOST_TEST( system_category() == system_category() );
|
||||
BOOST_TEST( generic_category() != system_category() );
|
||||
BOOST_TEST( system_category() != generic_category() );
|
||||
|
||||
if ( std::less<const error_category*>()( &posix_category, &system_category ) )
|
||||
if ( std::less<const error_category*>()( &generic_category(), &system_category() ) )
|
||||
{
|
||||
BOOST_TEST( posix_category < system_category );
|
||||
BOOST_TEST( !(system_category < posix_category) );
|
||||
BOOST_TEST( generic_category() < system_category() );
|
||||
BOOST_TEST( !(system_category() < generic_category()) );
|
||||
}
|
||||
else
|
||||
{
|
||||
BOOST_TEST( system_category < posix_category );
|
||||
BOOST_TEST( !(posix_category < system_category) );
|
||||
BOOST_TEST( system_category() < generic_category() );
|
||||
BOOST_TEST( !(generic_category() < system_category()) );
|
||||
}
|
||||
|
||||
|
||||
error_code ec;
|
||||
error_condition dec;
|
||||
error_condition econd;
|
||||
BOOST_TEST( !ec );
|
||||
BOOST_TEST( ec.value() == 0 );
|
||||
dec = ec.default_error_condition();
|
||||
BOOST_TEST( dec.value() == 0 );
|
||||
BOOST_TEST( dec.category() == posix_category );
|
||||
BOOST_TEST( ec == posix::success );
|
||||
BOOST_TEST( ec.category() == system_category );
|
||||
econd = ec.default_error_condition();
|
||||
BOOST_TEST( econd.value() == 0 );
|
||||
BOOST_TEST( econd.category() == generic_category() );
|
||||
BOOST_TEST( ec == errc::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) );
|
||||
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 );
|
||||
error_code ec_0_system( 0, system_category() );
|
||||
BOOST_TEST( !ec_0_system );
|
||||
BOOST_TEST( ec_0_system.value() == 0 );
|
||||
dec = ec_0_system.default_error_condition();
|
||||
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 );
|
||||
econd = ec_0_system.default_error_condition();
|
||||
BOOST_TEST( econd.value() == 0 );
|
||||
BOOST_TEST( econd.category() == generic_category() );
|
||||
BOOST_TEST( ec_0_system == errc::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_TEST( ec_0_system == ec );
|
||||
|
||||
error_code ec_1_system( 1, system_category );
|
||||
error_code ec_1_system( 1, system_category() );
|
||||
BOOST_TEST( ec_1_system );
|
||||
BOOST_TEST( ec_1_system.value() == 1 );
|
||||
BOOST_TEST( ec_1_system.value() != 0 );
|
||||
@@ -112,41 +121,43 @@ int main( int, char ** )
|
||||
BOOST_TEST( ec_0_system != ec_1_system );
|
||||
check_ostream( ec_1_system, "system:1" );
|
||||
|
||||
ec = error_code( BOOST_ACCESS_ERROR_MACRO, system_category );
|
||||
ec = error_code( BOOST_ACCESS_ERROR_MACRO, system_category() );
|
||||
BOOST_TEST( ec );
|
||||
BOOST_TEST( ec.value() == BOOST_ACCESS_ERROR_MACRO );
|
||||
dec = ec.default_error_condition();
|
||||
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 );
|
||||
econd = ec.default_error_condition();
|
||||
BOOST_TEST( econd.value() == static_cast<int>(errc::permission_denied) );
|
||||
BOOST_TEST( econd.category() == generic_category() );
|
||||
BOOST_TEST( econd == error_condition( errc::permission_denied, generic_category() ) );
|
||||
BOOST_TEST( econd == errc::permission_denied );
|
||||
BOOST_TEST( errc::permission_denied == econd );
|
||||
BOOST_TEST( ec == errc::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 );
|
||||
// test the explicit make_error_code conversion for errc
|
||||
ec = make_error_code( errc::bad_message );
|
||||
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 );
|
||||
BOOST_TEST( ec == errc::bad_message );
|
||||
BOOST_TEST( errc::bad_message == ec );
|
||||
BOOST_TEST( ec != errc::permission_denied );
|
||||
BOOST_TEST( errc::permission_denied != ec );
|
||||
BOOST_TEST( ec.category() == generic_category() );
|
||||
|
||||
// test the deprecated predefined error_category synonyms
|
||||
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 the deprecated predefined error_category synonyms
|
||||
//BOOST_TEST( &system_category() == &native_ecat );
|
||||
//BOOST_TEST( &generic_category() == &errno_ecat );
|
||||
//BOOST_TEST( system_category() == native_ecat );
|
||||
//BOOST_TEST( generic_category() == errno_ecat );
|
||||
|
||||
// test error_code and error_condition message();
|
||||
// see Boost.Filesystem operations_test for code specific message() tests
|
||||
ec = error_code( -1, system_category );
|
||||
ec = error_code( -1, system_category() );
|
||||
std::cout << "error_code message for -1 is \"" << ec.message() << "\"\n";
|
||||
std::cout << "error_code message for 0 is \"" << ec_0_system.message() << "\"\n";
|
||||
#if defined(BOOST_WINDOWS_API)
|
||||
// Borland appends newline, so just check text
|
||||
BOOST_TEST( ec.message().substr(0,13) == "Unknown error" );
|
||||
BOOST_TEST( ec_0_system.message().substr(0,36) == "The operation completed successfully" );
|
||||
#elif defined(linux) || defined(__linux) || defined(__linux__)
|
||||
// Linux appends value to message as unsigned, so it varies with # of bits
|
||||
BOOST_TEST( ec.message().substr(0,13) == "Unknown error" );
|
||||
@@ -158,102 +169,105 @@ int main( int, char ** )
|
||||
BOOST_TEST( ec.message() == "error -1" );
|
||||
#endif
|
||||
|
||||
ec = error_code( BOOST_ACCESS_ERROR_MACRO, system_category );
|
||||
ec = error_code( BOOST_ACCESS_ERROR_MACRO, system_category() );
|
||||
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";
|
||||
econd = error_condition( -1, generic_category() );
|
||||
error_condition econd_ok;
|
||||
std::cout << "error_condition message for -1 is \"" << econd.message() << "\"\n";
|
||||
std::cout << "error_condition message for 0 is \"" << econd_ok.message() << "\"\n";
|
||||
#if defined(BOOST_WINDOWS_API)
|
||||
// Borland appends newline, so just check text
|
||||
BOOST_TEST( dec.message().substr(0,13) == "Unknown error" );
|
||||
BOOST_TEST( econd.message().substr(0,13) == "Unknown error" );
|
||||
BOOST_TEST( econd_ok.message().substr(0,8) == "No error" );
|
||||
#elif defined(linux) || defined(__linux) || defined(__linux__)
|
||||
// Linux appends value to message as unsigned, so it varies with # of bits
|
||||
BOOST_TEST( dec.message().substr(0,13) == "Unknown error" );
|
||||
BOOST_TEST( econd.message().substr(0,13) == "Unknown error" );
|
||||
#elif defined(__hpux)
|
||||
BOOST_TEST( dec.message() == "" );
|
||||
BOOST_TEST( econd.message() == "" );
|
||||
#elif defined(__osf__)
|
||||
BOOST_TEST( dec.message() == "Error -1 occurred." );
|
||||
BOOST_TEST( econd.message() == "Error -1 occurred." );
|
||||
#elif defined(__vms)
|
||||
BOOST_TEST( dec.message() == "error -1" );
|
||||
BOOST_TEST( econd.message() == "error -1" );
|
||||
#endif
|
||||
|
||||
dec = error_condition( BOOST_ACCESS_ERROR_MACRO, posix_category );
|
||||
BOOST_TEST( dec.message() != "" );
|
||||
BOOST_TEST( dec.message().substr( 0, 13) != "Unknown error" );
|
||||
econd = error_condition( BOOST_ACCESS_ERROR_MACRO, generic_category() );
|
||||
BOOST_TEST( econd.message() != "" );
|
||||
BOOST_TEST( econd.message().substr( 0, 13) != "Unknown error" );
|
||||
|
||||
#ifdef BOOST_WINDOWS_API
|
||||
std::cout << "Windows tests...\n";
|
||||
// these tests probe the Windows posix decoder
|
||||
// these tests probe the Windows errc decoder
|
||||
// test the first entry in the decoder table:
|
||||
ec = error_code( ERROR_ACCESS_DENIED, system_category );
|
||||
ec = error_code( ERROR_ACCESS_DENIED, system_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 );
|
||||
BOOST_TEST( ec == errc::permission_denied );
|
||||
BOOST_TEST( ec.default_error_condition().value() == errc::permission_denied );
|
||||
BOOST_TEST( ec.default_error_condition().category() == generic_category() );
|
||||
|
||||
// test the second entry in the decoder table:
|
||||
ec = error_code( ERROR_ALREADY_EXISTS, system_category );
|
||||
ec = error_code( ERROR_ALREADY_EXISTS, system_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 );
|
||||
BOOST_TEST( ec == errc::file_exists );
|
||||
BOOST_TEST( ec.default_error_condition().value() == errc::file_exists );
|
||||
BOOST_TEST( ec.default_error_condition().category() == generic_category() );
|
||||
|
||||
// test the third entry in the decoder table:
|
||||
ec = error_code( ERROR_BAD_UNIT, system_category );
|
||||
ec = error_code( ERROR_BAD_UNIT, system_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 );
|
||||
BOOST_TEST( ec == errc::no_such_device );
|
||||
BOOST_TEST( ec.default_error_condition().value() == errc::no_such_device );
|
||||
BOOST_TEST( ec.default_error_condition().category() == generic_category() );
|
||||
|
||||
// test the last non-Winsock entry in the decoder table:
|
||||
ec = error_code( ERROR_WRITE_PROTECT, system_category );
|
||||
ec = error_code( ERROR_WRITE_PROTECT, system_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 );
|
||||
BOOST_TEST( ec == errc::permission_denied );
|
||||
BOOST_TEST( ec.default_error_condition().value() == errc::permission_denied );
|
||||
BOOST_TEST( ec.default_error_condition().category() == generic_category() );
|
||||
|
||||
// test the last Winsock entry in the decoder table:
|
||||
ec = error_code( WSAEWOULDBLOCK, system_category );
|
||||
ec = error_code( WSAEWOULDBLOCK, system_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 );
|
||||
BOOST_TEST( ec == errc::operation_would_block );
|
||||
BOOST_TEST( ec.default_error_condition().value() == errc::operation_would_block );
|
||||
BOOST_TEST( ec.default_error_condition().category() == generic_category() );
|
||||
|
||||
// test not-in-table condition:
|
||||
ec = error_code( 1234567890, system_category );
|
||||
ec = error_code( 1234567890, system_category() );
|
||||
BOOST_TEST( ec.value() == 1234567890 );
|
||||
BOOST_TEST( ec.default_error_condition().value() == 1234567890 );
|
||||
BOOST_TEST( ec.default_error_condition().category() == system_category );
|
||||
BOOST_TEST( ec.default_error_condition().category() == system_category() );
|
||||
|
||||
#else // POSIX
|
||||
|
||||
std::cout << "POSIX tests...\n";
|
||||
ec = error_code( EACCES, system_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 );
|
||||
ec = error_code( EACCES, system_category() );
|
||||
BOOST_TEST( ec == error_code( errc::permission_denied, system_category() ) );
|
||||
BOOST_TEST( error_code( errc::permission_denied, system_category() ) == ec );
|
||||
BOOST_TEST( ec == errc::permission_denied );
|
||||
BOOST_TEST( errc::permission_denied == ec );
|
||||
BOOST_TEST( ec.default_error_condition().value() == errc::permission_denied );
|
||||
BOOST_TEST( ec.default_error_condition().category() == generic_category() );
|
||||
|
||||
# ifdef __CYGWIN__
|
||||
|
||||
std::cout << "Cygwin tests...\n";
|
||||
ec = cygwin_error::no_package;
|
||||
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 );
|
||||
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_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 );
|
||||
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
|
||||
|
||||
|
||||
@@ -14,11 +14,13 @@
|
||||
|
||||
// Motivation was a Boost posting by Christopher Kohlhoff on June 28, 2006.
|
||||
|
||||
#define BOOST_SYSTEM_NO_DEPRECATED
|
||||
|
||||
#include <boost/system/error_code.hpp>
|
||||
#include <boost/cerrno.hpp>
|
||||
#include <string>
|
||||
#include <cstdio>
|
||||
#include <boost/test/minimal.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
|
||||
#ifdef BOOST_POSIX_API
|
||||
# include <sys/stat.h>
|
||||
@@ -40,7 +42,7 @@ boost::system::error_code my_mkdir( const std::string & path )
|
||||
# else
|
||||
::CreateDirectoryA( path.c_str(), 0 ) != 0 ? 0 : ::GetLastError(),
|
||||
# endif
|
||||
boost::system::system_category );
|
||||
boost::system::system_category() );
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------ //
|
||||
@@ -53,9 +55,9 @@ boost::system::error_code my_remove( const std::string & path )
|
||||
{
|
||||
return boost::system::error_code(
|
||||
std::remove( path.c_str() ) == 0 ? 0 : errno,
|
||||
boost::system::posix_category ); // OK for both Windows and POSIX
|
||||
// Alternatively, could use posix_category
|
||||
// on Windows and system_category on
|
||||
boost::system::generic_category() ); // OK for both Windows and POSIX
|
||||
// Alternatively, could use generic_category()
|
||||
// on Windows and system_category() on
|
||||
// POSIX-based systems.
|
||||
}
|
||||
|
||||
@@ -118,8 +120,8 @@ namespace boost
|
||||
boost::system::error_condition default_error_condition( int ev ) const
|
||||
{
|
||||
return ev == boo_boo
|
||||
? boost::system::error_condition( boost::system::posix::io_error,
|
||||
boost::system::posix_category )
|
||||
? boost::system::error_condition( boost::system::errc::io_error,
|
||||
boost::system::generic_category() )
|
||||
: boost::system::error_condition( ev,
|
||||
boost::lib3::lib3_error_category );
|
||||
}
|
||||
@@ -180,8 +182,8 @@ namespace lib4
|
||||
boost::system::error_condition default_error_condition( int ev ) const
|
||||
{
|
||||
return ev == boo_boo.value()
|
||||
? boost::system::error_condition( boost::system::posix::io_error,
|
||||
boost::system::posix_category )
|
||||
? boost::system::error_condition( boost::system::errc::io_error,
|
||||
boost::system::generic_category() )
|
||||
: boost::system::error_condition( ev, lib4::lib4_error_category );
|
||||
}
|
||||
|
||||
@@ -237,15 +239,15 @@ namespace lib4
|
||||
// switch (ev)
|
||||
// {
|
||||
// case user_success:
|
||||
// return boost::system::error_code(boost::system::posix::success, boost::system::posix_category);
|
||||
// return boost::system::error_code(boost::system::errc::success, boost::system::generic_category());
|
||||
// case user_permission_denied:
|
||||
// return boost::system::error_code(boost::system::posix::permission_denied, boost::system::posix_category);
|
||||
// return boost::system::error_code(boost::system::errc::permission_denied, boost::system::generic_category());
|
||||
// case user_out_of_memory:
|
||||
// return boost::system::error_code(boost::system::posix::not_enough_memory, boost::system::posix_category);
|
||||
// return boost::system::error_code(boost::system::errc::not_enough_memory, boost::system::generic_category());
|
||||
// default:
|
||||
// break;
|
||||
// }
|
||||
// return boost::system::error_code(boost::system::posix::no_posix_equivalent, boost::system::posix_category);
|
||||
// return boost::system::error_code(boost::system::errc::no_posix_equivalent, boost::system::generic_category());
|
||||
// }
|
||||
//
|
||||
// };
|
||||
@@ -264,8 +266,8 @@ namespace lib4
|
||||
//
|
||||
// void check_success(const boost::system::error_code& ec, bool expect)
|
||||
// {
|
||||
// BOOST_CHECK( (ec == boost::system::posix::success) == expect );
|
||||
// if (ec == boost::system::posix::success)
|
||||
// BOOST_TEST( (ec == boost::system::errc::success) == expect );
|
||||
// if (ec == boost::system::errc::success)
|
||||
// std::cout << "yes... " << (expect ? "ok" : "fail") << '\n';
|
||||
// else
|
||||
// std::cout << "no... " << (expect ? "fail" : "ok") << '\n';
|
||||
@@ -273,8 +275,8 @@ namespace lib4
|
||||
//
|
||||
// void check_permission_denied(const boost::system::error_code& ec, bool expect)
|
||||
// {
|
||||
// BOOST_CHECK( (ec == boost::system::posix::permission_denied) == expect );
|
||||
// if (ec == boost::system::posix::permission_denied)
|
||||
// BOOST_TEST( (ec == boost::system::errc::permission_denied) == expect );
|
||||
// if (ec == boost::system::errc::permission_denied)
|
||||
// std::cout << "yes... " << (expect ? "ok" : "fail") << '\n';
|
||||
// else
|
||||
// std::cout << "no... " << (expect ? "fail" : "ok") << '\n';
|
||||
@@ -282,8 +284,8 @@ namespace lib4
|
||||
//
|
||||
// void check_out_of_memory(const boost::system::error_code& ec, bool expect)
|
||||
// {
|
||||
// BOOST_CHECK( (ec == boost::system::posix::not_enough_memory) == expect );
|
||||
// if (ec == boost::system::posix::not_enough_memory)
|
||||
// BOOST_TEST( (ec == boost::system::errc::not_enough_memory) == expect );
|
||||
// if (ec == boost::system::errc::not_enough_memory)
|
||||
// std::cout << "yes... " << (expect ? "ok" : "fail") << '\n';
|
||||
// else
|
||||
// std::cout << "no... " << (expect ? "fail" : "ok") << '\n';
|
||||
@@ -295,23 +297,23 @@ namespace lib4
|
||||
// printf("=====\n");
|
||||
// boost::system::error_code ec;
|
||||
// check_success(ec, true);
|
||||
// check_success(boost::system::posix::success, true);
|
||||
// check_success(boost::system::posix::permission_denied, false);
|
||||
// check_success(boost::system::posix::not_enough_memory, false);
|
||||
// check_success(boost::system::errc::success, true);
|
||||
// check_success(boost::system::errc::permission_denied, false);
|
||||
// check_success(boost::system::errc::not_enough_memory, false);
|
||||
// check_success(user_success, true);
|
||||
// check_success(user_permission_denied, false);
|
||||
// check_success(user_out_of_memory, false);
|
||||
// check_permission_denied(ec, false);
|
||||
// check_permission_denied(boost::system::posix::success, false);
|
||||
// check_permission_denied(boost::system::posix::permission_denied, true);
|
||||
// check_permission_denied(boost::system::posix::not_enough_memory, false);
|
||||
// check_permission_denied(boost::system::errc::success, false);
|
||||
// check_permission_denied(boost::system::errc::permission_denied, true);
|
||||
// check_permission_denied(boost::system::errc::not_enough_memory, false);
|
||||
// check_permission_denied(user_success, false);
|
||||
// check_permission_denied(user_permission_denied, true);
|
||||
// check_permission_denied(user_out_of_memory, false);
|
||||
// check_out_of_memory(ec, false);
|
||||
// check_out_of_memory(boost::system::posix::success, false);
|
||||
// check_out_of_memory(boost::system::posix::permission_denied, false);
|
||||
// check_out_of_memory(boost::system::posix::not_enough_memory, true);
|
||||
// check_out_of_memory(boost::system::errc::success, false);
|
||||
// check_out_of_memory(boost::system::errc::permission_denied, false);
|
||||
// check_out_of_memory(boost::system::errc::not_enough_memory, true);
|
||||
// check_out_of_memory(user_success, false);
|
||||
// check_out_of_memory(user_permission_denied, false);
|
||||
// check_out_of_memory(user_out_of_memory, true);
|
||||
@@ -337,7 +339,7 @@ namespace lib4
|
||||
|
||||
// ------------------------------------------------------------------------ //
|
||||
|
||||
int test_main( int, char *[] )
|
||||
int main( int, char *[] )
|
||||
{
|
||||
boost::system::error_code ec;
|
||||
|
||||
@@ -346,35 +348,35 @@ int test_main( int, char *[] )
|
||||
ec = my_mkdir( "/no-such-file-or-directory/will-not-succeed" );
|
||||
std::cout << "ec.value() is " << ec.value() << '\n';
|
||||
|
||||
BOOST_CHECK( ec );
|
||||
BOOST_CHECK( ec == boost::system::posix::no_such_file_or_directory );
|
||||
BOOST_CHECK( ec.category() == boost::system::system_category );
|
||||
BOOST_TEST( ec );
|
||||
BOOST_TEST( ec == boost::system::errc::no_such_file_or_directory );
|
||||
BOOST_TEST( ec.category() == boost::system::system_category() );
|
||||
|
||||
// Library 2 tests:
|
||||
|
||||
ec = my_remove( "/no-such-file-or-directory" );
|
||||
std::cout << "ec.value() is " << ec.value() << '\n';
|
||||
|
||||
BOOST_CHECK( ec );
|
||||
BOOST_CHECK( ec == boost::system::posix::no_such_file_or_directory );
|
||||
BOOST_CHECK( ec.category() == boost::system::posix_category );
|
||||
BOOST_TEST( ec );
|
||||
BOOST_TEST( ec == boost::system::errc::no_such_file_or_directory );
|
||||
BOOST_TEST( ec.category() == boost::system::generic_category() );
|
||||
|
||||
// Library 3 tests:
|
||||
|
||||
ec = boost::lib3::boo_boo;
|
||||
std::cout << "ec.value() is " << ec.value() << '\n';
|
||||
|
||||
BOOST_CHECK( ec );
|
||||
BOOST_CHECK( ec == boost::lib3::boo_boo );
|
||||
BOOST_CHECK( ec.value() == boost::lib3::boo_boo );
|
||||
BOOST_CHECK( ec.category() == boost::lib3::lib3_error_category );
|
||||
BOOST_TEST( ec );
|
||||
BOOST_TEST( ec == boost::lib3::boo_boo );
|
||||
BOOST_TEST( ec.value() == boost::lib3::boo_boo );
|
||||
BOOST_TEST( ec.category() == boost::lib3::lib3_error_category );
|
||||
|
||||
BOOST_CHECK( ec == boost::system::posix::io_error );
|
||||
BOOST_TEST( ec == boost::system::errc::io_error );
|
||||
|
||||
boost::system::error_code ec3( boost::lib3::boo_boo+100,
|
||||
boost::lib3::lib3_error_category );
|
||||
BOOST_CHECK( ec3.category() == boost::lib3::lib3_error_category );
|
||||
BOOST_CHECK( ec3.default_error_condition().category()
|
||||
BOOST_TEST( ec3.category() == boost::lib3::lib3_error_category );
|
||||
BOOST_TEST( ec3.default_error_condition().category()
|
||||
== boost::lib3::lib3_error_category );
|
||||
|
||||
// Library 4 tests:
|
||||
@@ -382,21 +384,21 @@ int test_main( int, char *[] )
|
||||
ec = lib4::boo_boo;
|
||||
std::cout << "ec.value() is " << ec.value() << '\n';
|
||||
|
||||
BOOST_CHECK( ec );
|
||||
BOOST_CHECK( ec == lib4::boo_boo );
|
||||
BOOST_CHECK( ec.value() == lib4::boo_boo.value() );
|
||||
BOOST_CHECK( ec.category() == lib4::lib4_error_category );
|
||||
BOOST_TEST( ec );
|
||||
BOOST_TEST( ec == lib4::boo_boo );
|
||||
BOOST_TEST( ec.value() == lib4::boo_boo.value() );
|
||||
BOOST_TEST( ec.category() == lib4::lib4_error_category );
|
||||
|
||||
BOOST_CHECK( ec == boost::system::posix::io_error );
|
||||
BOOST_TEST( ec == boost::system::errc::io_error );
|
||||
|
||||
boost::system::error_code ec4( lib4::boo_boo.value()+100,
|
||||
lib4::lib4_error_category );
|
||||
BOOST_CHECK( ec4.default_error_condition().category()
|
||||
BOOST_TEST( ec4.default_error_condition().category()
|
||||
== lib4::lib4_error_category );
|
||||
|
||||
// Test 3
|
||||
|
||||
//test3::run();
|
||||
|
||||
return 0;
|
||||
return ::boost::report_errors();
|
||||
}
|
||||
|
||||
@@ -13,12 +13,11 @@
|
||||
|
||||
#define BOOST_ERROR_CODE_HEADER_ONLY
|
||||
|
||||
#include <boost/test/minimal.hpp>
|
||||
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/system/error_code.hpp>
|
||||
|
||||
int test_main( int, char*[] )
|
||||
int main( int, char*[] )
|
||||
{
|
||||
boost::system::error_code ec( 0, boost::system::system_category );
|
||||
return 0;
|
||||
boost::system::error_code ec( 0, boost::system::system_category() );
|
||||
return ::boost::report_errors();
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
// This test verifiies that the error_category vtable does not suffer from
|
||||
// order-of-initialization problems.
|
||||
|
||||
#include <boost/test/minimal.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/system/error_code.hpp>
|
||||
|
||||
struct foo
|
||||
@@ -22,7 +22,7 @@ struct foo
|
||||
}
|
||||
} f;
|
||||
|
||||
int test_main( int, char ** )
|
||||
int main( int, char ** )
|
||||
{
|
||||
return 0;
|
||||
return ::boost::report_errors();
|
||||
}
|
||||
|
||||
+29
-26
@@ -9,9 +9,12 @@
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
|
||||
// test without deprecated features
|
||||
#define BOOST_SYSTEM_NO_DEPRECATED
|
||||
|
||||
#include <boost/config/warning_disable.hpp>
|
||||
|
||||
#include <boost/test/minimal.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/system/system_error.hpp>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
@@ -33,8 +36,8 @@ namespace
|
||||
int v, const char * str )
|
||||
{
|
||||
std::cout << "test " << desc << "\n what() returns \"" << ex.what() << "\"\n";
|
||||
BOOST_CHECK( ex.code().value() == v );
|
||||
BOOST_CHECK( ex.code().category() == system_category );
|
||||
BOOST_TEST( ex.code().value() == v );
|
||||
BOOST_TEST( ex.code().category() == system_category() );
|
||||
# ifdef BOOST_WINDOWS_API
|
||||
LANGID language_id;
|
||||
# if !defined(__MINGW32__) && !defined(__CYGWIN__)
|
||||
@@ -45,7 +48,7 @@ namespace
|
||||
// std::cout << "GetUserDefaultUILanguage() returns " << language_id << '\n';
|
||||
if ( language_id == 0x0409 ) // English (United States)
|
||||
{
|
||||
BOOST_CHECK( std::string( ex.what() ) == str );
|
||||
BOOST_TEST( std::string( ex.what() ) == str );
|
||||
if ( std::string( ex.what() ) != str )
|
||||
std::cout << "expected \"" << str << "\", but what() returned \""
|
||||
<< ex.what() << "\"\n";
|
||||
@@ -56,51 +59,51 @@ namespace
|
||||
const boost::uint_least32_t uvalue = 2u;
|
||||
}
|
||||
|
||||
int test_main( int, char *[] )
|
||||
int main( int, char *[] )
|
||||
{
|
||||
// all constructors, in the same order as they appear in the header:
|
||||
|
||||
system_error c1_0( error_code(0, system_category) );
|
||||
system_error c1_1( error_code(1, system_category) );
|
||||
system_error c1_2u( error_code(uvalue, system_category) );
|
||||
system_error c1_0( error_code(0, system_category()) );
|
||||
system_error c1_1( error_code(1, system_category()) );
|
||||
system_error c1_2u( error_code(uvalue, system_category()) );
|
||||
|
||||
system_error c2_0( error_code(0, system_category), string("c2_0") );
|
||||
system_error c2_1( error_code(1, system_category), string("c2_1") );
|
||||
system_error c2_0( error_code(0, system_category()), string("c2_0") );
|
||||
system_error c2_1( error_code(1, system_category()), string("c2_1") );
|
||||
|
||||
system_error c3_0( error_code(0, system_category), "c3_0" );
|
||||
system_error c3_1( error_code(1, system_category), "c3_1" );
|
||||
system_error c3_0( error_code(0, system_category()), "c3_0" );
|
||||
system_error c3_1( error_code(1, system_category()), "c3_1" );
|
||||
|
||||
system_error c4_0( 0, system_category );
|
||||
system_error c4_1( 1, system_category );
|
||||
system_error c4_2u( uvalue, system_category );
|
||||
system_error c4_0( 0, system_category() );
|
||||
system_error c4_1( 1, system_category() );
|
||||
system_error c4_2u( uvalue, system_category() );
|
||||
|
||||
system_error c5_0( 0, system_category, string("c5_0") );
|
||||
system_error c5_1( 1, system_category, string("c5_1") );
|
||||
system_error c5_0( 0, system_category(), string("c5_0") );
|
||||
system_error c5_1( 1, system_category(), string("c5_1") );
|
||||
|
||||
system_error c6_0( 0, system_category, "c6_0" );
|
||||
system_error c6_1( 1, system_category, "c6_1" );
|
||||
system_error c6_0( 0, system_category(), "c6_0" );
|
||||
system_error c6_1( 1, system_category(), "c6_1" );
|
||||
|
||||
TEST( c1_0, 0, "" );
|
||||
TEST( c1_0, 0, "The operation completed successfully" );
|
||||
TEST( c1_1, 1, "Incorrect function" );
|
||||
TEST( c1_2u, 2, "The system cannot find the file specified" );
|
||||
|
||||
TEST( c2_0, 0, "c2_0" );
|
||||
TEST( c2_0, 0, "c2_0: The operation completed successfully" );
|
||||
TEST( c2_1, 1, "c2_1: Incorrect function" );
|
||||
|
||||
TEST( c3_0, 0, "c3_0" );
|
||||
TEST( c3_0, 0, "c3_0: The operation completed successfully" );
|
||||
TEST( c3_1, 1, "c3_1: Incorrect function" );
|
||||
|
||||
TEST( c4_0, 0, "" );
|
||||
TEST( c4_0, 0, "The operation completed successfully" );
|
||||
TEST( c4_1, 1, "Incorrect function" );
|
||||
TEST( c4_2u, 2, "The system cannot find the file specified" );
|
||||
|
||||
TEST( c5_0, 0, "c5_0" );
|
||||
TEST( c5_0, 0, "c5_0: The operation completed successfully" );
|
||||
TEST( c5_1, 1, "c5_1: Incorrect function" );
|
||||
|
||||
TEST( c6_0, 0, "c6_0" );
|
||||
TEST( c6_0, 0, "c6_0: The operation completed successfully" );
|
||||
TEST( c6_1, 1, "c6_1: Incorrect function" );
|
||||
|
||||
return 0;
|
||||
return ::boost::report_errors();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -7,12 +7,13 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="../../../../.."
|
||||
PreprocessorDefinitions="BOOST_ALL_NO_LIB"
|
||||
PreprocessorDefinitions="BOOST_ALL_NO_LIB;BOOST_ALL_DYN_LINK"
|
||||
ExceptionHandling="2"
|
||||
WarningLevel="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
Description="Executing test $(TargetName).exe..."
|
||||
CommandLine=""$(TargetDir)\$(TargetName).exe" --result_code=no --report_level=no"
|
||||
Description=""
|
||||
CommandLine=""
|
||||
/>
|
||||
</VisualStudioPropertySheet>
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
WarningLevel="4"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
@@ -86,6 +86,8 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
Description="Executing test $(TargetName).exe..."
|
||||
CommandLine=""$(TargetDir)\$(TargetName).exe" --result_code=no --report_level=no"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
@@ -120,7 +122,7 @@
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
WarningLevel="4"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
@@ -161,6 +163,8 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
Description="Executing test $(TargetName).exe..."
|
||||
CommandLine=""$(TargetDir)\$(TargetName).exe" --result_code=no --report_level=no"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
@@ -172,10 +176,6 @@
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\..\src\error_code.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\error_code_test.cpp"
|
||||
>
|
||||
|
||||
@@ -2,6 +2,27 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 10.00
|
||||
# Visual C++ Express 2008
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "error_code_test", "error_code_test\error_code_test.vcproj", "{81960557-E9A9-4E81-AC96-9E11C33CB058}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{22892211-A1F3-435B-8B97-A12E8772599E} = {22892211-A1F3-435B-8B97-A12E8772599E}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "system_error_test", "system_error_test\system_error_test.vcproj", "{CBD12E59-99E5-4F35-9B66-0554D0FBDB76}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{22892211-A1F3-435B-8B97-A12E8772599E} = {22892211-A1F3-435B-8B97-A12E8772599E}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dynamic_link_test", "dynamic_link_test\dynamic_link_test.vcproj", "{AD186B11-9132-48A9-9F24-3522C2310B0D}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{F6D9B408-84A3-405A-93ED-DE5AA8CF84D7} = {F6D9B408-84A3-405A-93ED-DE5AA8CF84D7}
|
||||
{22892211-A1F3-435B-8B97-A12E8772599E} = {22892211-A1F3-435B-8B97-A12E8772599E}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "system_dll", "system_dll\system_dll.vcproj", "{22892211-A1F3-435B-8B97-A12E8772599E}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "throw_test_dll", "throw_test_dll\throw_test_dll.vcproj", "{F6D9B408-84A3-405A-93ED-DE5AA8CF84D7}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{22892211-A1F3-435B-8B97-A12E8772599E} = {22892211-A1F3-435B-8B97-A12E8772599E}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@@ -13,6 +34,22 @@ Global
|
||||
{81960557-E9A9-4E81-AC96-9E11C33CB058}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{81960557-E9A9-4E81-AC96-9E11C33CB058}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{81960557-E9A9-4E81-AC96-9E11C33CB058}.Release|Win32.Build.0 = Release|Win32
|
||||
{CBD12E59-99E5-4F35-9B66-0554D0FBDB76}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{CBD12E59-99E5-4F35-9B66-0554D0FBDB76}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{CBD12E59-99E5-4F35-9B66-0554D0FBDB76}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{CBD12E59-99E5-4F35-9B66-0554D0FBDB76}.Release|Win32.Build.0 = Release|Win32
|
||||
{AD186B11-9132-48A9-9F24-3522C2310B0D}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{AD186B11-9132-48A9-9F24-3522C2310B0D}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{AD186B11-9132-48A9-9F24-3522C2310B0D}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{AD186B11-9132-48A9-9F24-3522C2310B0D}.Release|Win32.Build.0 = Release|Win32
|
||||
{22892211-A1F3-435B-8B97-A12E8772599E}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{22892211-A1F3-435B-8B97-A12E8772599E}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{22892211-A1F3-435B-8B97-A12E8772599E}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{22892211-A1F3-435B-8B97-A12E8772599E}.Release|Win32.Build.0 = Release|Win32
|
||||
{F6D9B408-84A3-405A-93ED-DE5AA8CF84D7}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{F6D9B408-84A3-405A-93ED-DE5AA8CF84D7}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{F6D9B408-84A3-405A-93ED-DE5AA8CF84D7}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{F6D9B408-84A3-405A-93ED-DE5AA8CF84D7}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
// throw_test.cpp --------------------------------------------------------===========-//
|
||||
|
||||
// Copyright Beman Dawes 2010
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
// Library home page is www.boost.org/libs/system
|
||||
|
||||
//--------------------------------------------------------------------------------------//
|
||||
|
||||
// See dynamic_link_test.cpp comments for use case.
|
||||
|
||||
//--------------------------------------------------------------------------------------//
|
||||
|
||||
// define BOOST_SYSTEM_SOURCE so that <boost/system/config.hpp> knows
|
||||
// the library is being built (possibly exporting rather than importing code)
|
||||
#define BOOST_SYSTEM_SOURCE
|
||||
|
||||
#include <boost/system/system_error.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace system
|
||||
{
|
||||
BOOST_SYSTEM_DECL void throw_test()
|
||||
{
|
||||
throw system_error(9999, system_category(), "boo boo");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user