]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/system/test/warnings_test.cpp
2 // Copyright 2017, 2019 Peter Dimov.
4 // Distributed under the Boost Software License, Version 1.0.
6 // See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt
9 // See library home page at http://www.boost.org/libs/system
11 #if defined(__GNUC__) && __GNUC__ >= 5 && __cplusplus >= 201103L
12 # pragma GCC diagnostic error "-Wsuggest-override"
15 #include <boost/config.hpp>
17 #if defined( BOOST_GCC ) && BOOST_GCC < 40600
18 #pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
21 #include <boost/system/system_error.hpp>
22 #include <boost/system/error_code.hpp>
23 #include <boost/core/lightweight_test.hpp>
28 boost::system::error_category
const & bt
= boost::system::generic_category();
32 boost::system::error_code
bc( ev
, bt
);
34 BOOST_TEST_EQ( bc
.value(), ev
);
35 BOOST_TEST_EQ( &bc
.category(), &bt
);
37 boost::system::error_condition bn
= bt
.default_error_condition( ev
);
39 BOOST_TEST_EQ( bn
.value(), ev
);
40 BOOST_TEST_EQ( &bn
.category(), &bt
);
42 BOOST_TEST( bt
.equivalent( ev
, bn
) );
44 BOOST_TEST( bc
== bn
);
46 boost::system::system_error
x( bc
, "prefix" );
48 BOOST_TEST_EQ( x
.code(), bc
);
49 BOOST_TEST_EQ( std::string( x
.what() ), "prefix: " + bc
.what() );
51 return boost::report_errors();