mirror of
https://github.com/boostorg/system.git
synced 2025-07-30 12:37:13 +02:00
Include and test system_error.hpp in warnings_test
This commit is contained in:
@ -47,7 +47,7 @@ namespace boost
|
|||||||
virtual ~system_error() BOOST_NOEXCEPT_OR_NOTHROW {}
|
virtual ~system_error() BOOST_NOEXCEPT_OR_NOTHROW {}
|
||||||
|
|
||||||
error_code code() const BOOST_NOEXCEPT { return m_error_code; }
|
error_code code() const BOOST_NOEXCEPT { return m_error_code; }
|
||||||
const char * what() const BOOST_NOEXCEPT_OR_NOTHROW;
|
const char * what() const BOOST_NOEXCEPT_OR_NOTHROW BOOST_OVERRIDE;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
error_code m_error_code;
|
error_code m_error_code;
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
#pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
|
#pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <boost/system/system_error.hpp>
|
||||||
#include <boost/system/error_code.hpp>
|
#include <boost/system/error_code.hpp>
|
||||||
#include <boost/core/lightweight_test.hpp>
|
#include <boost/core/lightweight_test.hpp>
|
||||||
#include <cerrno>
|
#include <cerrno>
|
||||||
@ -42,5 +43,10 @@ int main()
|
|||||||
|
|
||||||
BOOST_TEST( bc == bn );
|
BOOST_TEST( bc == bn );
|
||||||
|
|
||||||
|
boost::system::system_error x( bc, "what_arg" );
|
||||||
|
|
||||||
|
BOOST_TEST_EQ( x.code(), bc );
|
||||||
|
BOOST_TEST_CSTR_EQ( x.what(), "what_arg" );
|
||||||
|
|
||||||
return boost::report_errors();
|
return boost::report_errors();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user