mirror of
https://github.com/boostorg/system.git
synced 2025-10-05 20:20:56 +02:00
43 lines
992 B
C++
43 lines
992 B
C++
![]() |
// Copyright 2021 Peter Dimov.
|
||
|
// Distributed under the Boost Software License, Version 1.0.
|
||
|
// http://www.boost.org/LICENSE_1_0.txt
|
||
|
|
||
|
#include <boost/system/error_code.hpp>
|
||
|
#include <boost/core/lightweight_test.hpp>
|
||
|
#include <boost/config/pragma_message.hpp>
|
||
|
#include <boost/config.hpp>
|
||
|
#include <cerrno>
|
||
|
|
||
|
#if !defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
|
||
|
|
||
|
BOOST_PRAGMA_MESSAGE( "BOOST_SYSTEM_HAS_SYSTEM_ERROR not defined, test will be skipped" )
|
||
|
int main() {}
|
||
|
|
||
|
#else
|
||
|
|
||
|
#include <system_error>
|
||
|
|
||
|
int main()
|
||
|
{
|
||
|
{
|
||
|
boost::system::error_code ec = std::io_errc::stream;
|
||
|
|
||
|
BOOST_TEST( ec == std::io_errc::stream );
|
||
|
BOOST_TEST_NOT( ec != std::io_errc::stream );
|
||
|
|
||
|
ec.clear();
|
||
|
|
||
|
BOOST_TEST_NOT( ec == std::io_errc::stream );
|
||
|
BOOST_TEST( ec != std::io_errc::stream );
|
||
|
|
||
|
ec = std::io_errc::stream;
|
||
|
|
||
|
BOOST_TEST( ec == std::io_errc::stream );
|
||
|
BOOST_TEST_NOT( ec != std::io_errc::stream );
|
||
|
}
|
||
|
|
||
|
return boost::report_errors();
|
||
|
}
|
||
|
|
||
|
#endif
|