Mark platform-specific error headers as deprecated; split tests

This commit is contained in:
Peter Dimov
2020-10-06 03:19:48 +03:00
parent 99db03ee96
commit 8f32183b63
8 changed files with 115 additions and 26 deletions

View File

@@ -0,0 +1,31 @@
// Copyright 2020 Peter Dimov
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#include <boost/system/windows_error.hpp>
#include <boost/config/pragma_message.hpp>
#if !defined(BOOST_WINDOWS_API)
BOOST_PRAGMA_MESSAGE( "Skipping test, BOOST_WINDOWS_API is not defined" )
int main() {}
#else
#include <boost/core/lightweight_test.hpp>
#include <windows.h>
int main()
{
namespace sys = boost::system;
sys::error_code ec = sys::windows_error::invalid_function;
BOOST_TEST_EQ( ec, sys::windows_error::invalid_function );
BOOST_TEST_EQ( ec, sys::error_code( ERROR_INVALID_FUNCTION, sys::system_category() ) );
BOOST_TEST( ec == make_error_condition( sys::errc::function_not_supported ) );
return boost::report_errors();
}
#endif