mirror of
https://github.com/boostorg/system.git
synced 2025-10-04 11:40:57 +02:00
Mark platform-specific error headers as deprecated; split tests
This commit is contained in:
31
test/windows_error_test.cpp
Normal file
31
test/windows_error_test.cpp
Normal 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
|
Reference in New Issue
Block a user