mirror of
https://github.com/boostorg/system.git
synced 2025-10-13 16:05:26 +02:00
Move make_ functions for errc to errc.hpp
This commit is contained in:
25
test/error_condition_test2.cpp
Normal file
25
test/error_condition_test2.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
// Copyright 2020 Peter Dimov.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/system/error_condition.hpp>
|
||||
#include <boost/system/errc.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
namespace sys = boost::system;
|
||||
|
||||
int main()
|
||||
{
|
||||
sys::error_condition en( sys::errc::no_such_file_or_directory );
|
||||
|
||||
BOOST_TEST_EQ( en.value(), ENOENT );
|
||||
|
||||
BOOST_TEST( en );
|
||||
BOOST_TEST( !!en );
|
||||
|
||||
BOOST_TEST( en == make_error_condition( sys::errc::no_such_file_or_directory ) );
|
||||
|
||||
BOOST_TEST( en.category() == sys::error_condition().category() );
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
Reference in New Issue
Block a user