]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/beast/test/beast/core/error.cpp
2 // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com)
4 // Distributed under the Boost Software License, Version 1.0. (See accompanying
5 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 // Official repository: https://github.com/boostorg/beast
10 // Test that header file is self-contained.
11 #include <boost/beast/core/error.hpp>
13 #include <boost/beast/_experimental/unit_test/suite.hpp>
19 class error_test
: public unit_test::suite
25 auto const ec
= make_error_code(e
);
27 BEAST_EXPECT(! ec
.message().empty());
30 void check(condition c
, error e
)
33 auto const ec
= make_error_code(e
);
34 BEAST_EXPECT(ec
.category().name() != nullptr);
35 BEAST_EXPECT(! ec
.message().empty());
36 BEAST_EXPECT(ec
== c
);
39 auto ec
= make_error_condition(c
);
40 BEAST_EXPECT(ec
.category().name() != nullptr);
41 BEAST_EXPECT(! ec
.message().empty());
42 BEAST_EXPECT(ec
== c
);
48 check(condition::timeout
, error::timeout
);
52 BEAST_DEFINE_TESTSUITE(beast
,core
,error
);