]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/exception/test/error_info_basic_test.cpp
1 //Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
3 //Distributed under the Boost Software License, Version 1.0. (See accompanying
4 //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 #include <boost/exception/error_info.hpp>
7 #include <boost/exception/exception.hpp>
8 #include <boost/exception/info.hpp>
9 #include <boost/exception/get_error_info.hpp>
10 #include <boost/detail/lightweight_test.hpp>
14 struct my_exception
: virtual boost::exception
{};
15 typedef boost::error_info
<struct error_info_string_
, std::string
> error_info_string
;
22 throw my_exception() << error_info_string("doh");
24 catch( my_exception
& e
)
26 BOOST_TEST(boost::get_error_info
<error_info_string
>(e
) && !strcmp(boost::get_error_info
<error_info_string
>(e
)->c_str(),"doh"));