From 19fcec84d8d7d21e796c7624e521b60d28ee21ed Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 20:45:59 +0200 Subject: Adding upstream version 16.2.11+ds. Signed-off-by: Daniel Baumann --- src/spawn/test/test_async_result.cc | 48 +++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/spawn/test/test_async_result.cc (limited to 'src/spawn/test/test_async_result.cc') diff --git a/src/spawn/test/test_async_result.cc b/src/spawn/test/test_async_result.cc new file mode 100644 index 000000000..dac734d49 --- /dev/null +++ b/src/spawn/test/test_async_result.cc @@ -0,0 +1,48 @@ +// Copyright (c) 2020 Casey Bodley (cbodley at redhat dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include + +// make assertions about async_result::return_type with different signatures +// this is a compilation test only + +template +struct yield_result : boost::asio::async_result {}; + +template +struct yield_returns : std::is_same::return_type> {}; + +// no return value +static_assert(yield_returns::value, + "wrong return value for void()"); +static_assert(yield_returns::value, + "wrong return value for void(error_code)"); +// single-parameter return value +static_assert(yield_returns::value, + "wrong return value for void(int)"); +static_assert(yield_returns::value, + "wrong return value for void(error_code, int)"); +// multiple-parameter return value +static_assert(yield_returns, + void(int, std::string)>::value, + "wrong return value for void(int, string)"); +static_assert(yield_returns, + void(boost::system::error_code, int, std::string)>::value, + "wrong return value for void(error_code, int, string)"); +// single-tuple-parameter return value +static_assert(yield_returns, + void(std::tuple)>::value, + "wrong return value for void(std::tuple)"); +static_assert(yield_returns, + void(boost::system::error_code, std::tuple)>::value, + "wrong return value for void(error_code, std::tuple)"); +// single-pair-parameter return value +static_assert(yield_returns, + void(std::pair)>::value, + "wrong return value for void(std::tuple)"); +static_assert(yield_returns, + void(boost::system::error_code, std::pair)>::value, + "wrong return value for void(error_code, std::tuple)"); -- cgit v1.2.3