From 8c9ceba775ab604cc05f1a0697c3a34a77ab8aed Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 9 Dec 2021 20:19:05 +0200 Subject: [PATCH] Add negative test for constructing result from errc_t (refs #74) --- test/Jamfile.v2 | 1 + test/result_errc_construct.cpp | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 test/result_errc_construct.cpp diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 0a6bc3e..48a7dec 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -154,3 +154,4 @@ run result_eq.cpp : : : $(CPP11) ; run result_range_for.cpp : : : $(CPP11) ; run result_value_construct2.cpp : : : $(CPP11) ; run result_error_construct2.cpp : : : $(CPP11) ; +run result_errc_construct.cpp : : : $(CPP11) ; diff --git a/test/result_errc_construct.cpp b/test/result_errc_construct.cpp new file mode 100644 index 0000000..6d45368 --- /dev/null +++ b/test/result_errc_construct.cpp @@ -0,0 +1,23 @@ +// Copyright 2021 Peter Dimov. +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include +#include +#include + +using namespace boost::system; + +int main() +{ + BOOST_TEST_TRAIT_FALSE((std::is_convertible>)); + BOOST_TEST_TRAIT_FALSE((std::is_constructible, errc::errc_t>)); + + BOOST_TEST_TRAIT_FALSE((std::is_convertible>)); + BOOST_TEST_TRAIT_FALSE((std::is_constructible, errc::errc_t>)); + + BOOST_TEST_TRAIT_FALSE((std::is_convertible>)); + BOOST_TEST_TRAIT_FALSE((std::is_constructible, errc::errc_t>)); + + return boost::report_errors(); +}