forked from boostorg/exception
Merging in changes trunk updates: adding standard error_info typedefs, updating the documentation.
[SVN r55094]
This commit is contained in:
@ -35,6 +35,7 @@ run diagnostic_information_test.cpp ;
|
||||
run refcount_ptr_test.cpp ;
|
||||
run current_exception_cast_test.cpp ;
|
||||
run no_exceptions_test.cpp : : : <exception-handling>off ;
|
||||
run errinfos_test.cpp ;
|
||||
compile-fail exception_fail.cpp ;
|
||||
compile-fail throw_exception_fail.cpp ;
|
||||
|
||||
@ -49,4 +50,12 @@ compile info_hpp_test.cpp ;
|
||||
compile info_tuple_hpp_test.cpp ;
|
||||
compile to_string_hpp_test.cpp ;
|
||||
compile to_string_stub_hpp_test.cpp ;
|
||||
compile all_hpp_test.cpp ;
|
||||
compile current_exception_cast_hpp_test.cpp ;
|
||||
compile errinfo_api_function_hpp_test.cpp ;
|
||||
compile errinfo_at_line_hpp_test.cpp ;
|
||||
compile errinfo_errno_hpp_test.cpp ;
|
||||
compile errinfo_file_handle_hpp_test.cpp ;
|
||||
compile errinfo_file_name_hpp_test.cpp ;
|
||||
compile errinfo_file_open_mode_hpp_test.cpp ;
|
||||
compile errinfo_type_info_name_hpp_test.cpp ;
|
||||
|
7
test/all_hpp_test.cpp
Normal file
7
test/all_hpp_test.cpp
Normal file
@ -0,0 +1,7 @@
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <boost/exception/all.hpp>
|
||||
#include <boost/exception/all.hpp>
|
7
test/errinfo_api_function_hpp_test.cpp
Normal file
7
test/errinfo_api_function_hpp_test.cpp
Normal file
@ -0,0 +1,7 @@
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <boost/exception/errinfo_api_function.hpp>
|
||||
#include <boost/exception/errinfo_api_function.hpp>
|
7
test/errinfo_at_line_hpp_test.cpp
Normal file
7
test/errinfo_at_line_hpp_test.cpp
Normal file
@ -0,0 +1,7 @@
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <boost/exception/errinfo_at_line.hpp>
|
||||
#include <boost/exception/errinfo_at_line.hpp>
|
7
test/errinfo_errno_hpp_test.cpp
Normal file
7
test/errinfo_errno_hpp_test.cpp
Normal file
@ -0,0 +1,7 @@
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <boost/exception/errinfo_errno.hpp>
|
||||
#include <boost/exception/errinfo_errno.hpp>
|
7
test/errinfo_file_handle_hpp_test.cpp
Normal file
7
test/errinfo_file_handle_hpp_test.cpp
Normal file
@ -0,0 +1,7 @@
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <boost/exception/errinfo_file_handle.hpp>
|
||||
#include <boost/exception/errinfo_file_handle.hpp>
|
7
test/errinfo_file_name_hpp_test.cpp
Normal file
7
test/errinfo_file_name_hpp_test.cpp
Normal file
@ -0,0 +1,7 @@
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <boost/exception/errinfo_file_name.hpp>
|
||||
#include <boost/exception/errinfo_file_name.hpp>
|
7
test/errinfo_file_open_mode_hpp_test.cpp
Normal file
7
test/errinfo_file_open_mode_hpp_test.cpp
Normal file
@ -0,0 +1,7 @@
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <boost/exception/errinfo_file_open_mode.hpp>
|
||||
#include <boost/exception/errinfo_file_open_mode.hpp>
|
7
test/errinfo_type_info_name_hpp_test.cpp
Normal file
7
test/errinfo_type_info_name_hpp_test.cpp
Normal file
@ -0,0 +1,7 @@
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <boost/exception/errinfo_type_info_name.hpp>
|
||||
#include <boost/exception/errinfo_type_info_name.hpp>
|
61
test/errinfos_test.cpp
Normal file
61
test/errinfos_test.cpp
Normal file
@ -0,0 +1,61 @@
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <boost/exception/errinfo_api_function.hpp>
|
||||
#include <boost/exception/errinfo_at_line.hpp>
|
||||
#include <boost/exception/errinfo_errno.hpp>
|
||||
#include <boost/exception/errinfo_file_handle.hpp>
|
||||
#include <boost/exception/errinfo_file_name.hpp>
|
||||
#include <boost/exception/errinfo_file_open_mode.hpp>
|
||||
#include <boost/exception/errinfo_type_info_name.hpp>
|
||||
#include <boost/exception/info.hpp>
|
||||
#include <boost/exception/get_error_info.hpp>
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/weak_ptr.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <exception>
|
||||
|
||||
struct
|
||||
test_exception:
|
||||
virtual boost::exception,
|
||||
virtual std::exception
|
||||
{
|
||||
};
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
using namespace boost;
|
||||
try
|
||||
{
|
||||
BOOST_THROW_EXCEPTION(
|
||||
test_exception() <<
|
||||
errinfo_api_function("failed_api_function") <<
|
||||
errinfo_at_line(42) <<
|
||||
errinfo_errno(errno) <<
|
||||
errinfo_file_handle(weak_ptr<FILE>()) <<
|
||||
errinfo_file_name("filename.txt") <<
|
||||
errinfo_file_open_mode("rb") <<
|
||||
errinfo_type_info_name(typeid(int).name()) );
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
catch(
|
||||
boost::exception & e )
|
||||
{
|
||||
BOOST_TEST(get_error_info<errinfo_api_function>(e) && *get_error_info<errinfo_api_function>(e)==std::string("failed_api_function"));
|
||||
BOOST_TEST(get_error_info<errinfo_at_line>(e) && *get_error_info<errinfo_at_line>(e)==42);
|
||||
BOOST_TEST(get_error_info<errinfo_errno>(e) && *get_error_info<errinfo_errno>(e)==0);
|
||||
BOOST_TEST(get_error_info<errinfo_file_handle>(e) && get_error_info<errinfo_file_handle>(e)->expired());
|
||||
BOOST_TEST(get_error_info<errinfo_file_name>(e) && *get_error_info<errinfo_file_name>(e)=="filename.txt");
|
||||
BOOST_TEST(get_error_info<errinfo_file_open_mode>(e) && *get_error_info<errinfo_file_open_mode>(e)=="rb");
|
||||
BOOST_TEST(get_error_info<errinfo_type_info_name>(e) && *get_error_info<errinfo_type_info_name>(e)==typeid(int).name());
|
||||
}
|
||||
catch(
|
||||
... )
|
||||
{
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
return boost::report_errors();
|
||||
}
|
Reference in New Issue
Block a user