1 | // Copyright 2020 Peter Dimov |
2 | // Distributed under the Boost Software License, Version 1.0. |
3 | // https://www.boost.org/LICENSE_1_0.txt |
4 | |
5 | #include <boost/system/windows_error.hpp> |
6 | #include <boost/config/pragma_message.hpp> |
7 | |
8 | #if !defined(BOOST_WINDOWS_API) |
9 | |
10 | BOOST_PRAGMA_MESSAGE( "Skipping test, BOOST_WINDOWS_API is not defined" ) |
11 | int main() {} |
12 | |
13 | #else |
14 | |
15 | #include <boost/core/lightweight_test.hpp> |
16 | #include <windows.h> |
17 | |
18 | int main() |
19 | { |
20 | namespace sys = boost::system; |
21 | |
22 | sys::error_code ec = sys::windows_error::invalid_function; |
23 | |
24 | BOOST_TEST_EQ( ec, sys::windows_error::invalid_function ); |
25 | BOOST_TEST_EQ( ec, sys::error_code( ERROR_INVALID_FUNCTION, sys::system_category() ) ); |
26 | BOOST_TEST( ec == make_error_condition( sys::errc::function_not_supported ) ); |
27 | |
28 | return boost::report_errors(); |
29 | } |
30 | |
31 | #endif |
32 | |