forked from boostorg/beast
Refactor error headers:
The WebSocket error header file declarations are reorganized to make it easier to move function definitions into their own translation unit.
This commit is contained in:
@@ -20,11 +20,12 @@ namespace websocket {
|
||||
class error_test : public unit_test::suite
|
||||
{
|
||||
public:
|
||||
void check(char const* name, error ev)
|
||||
void check(error ev)
|
||||
{
|
||||
auto const ec = make_error_code(ev);
|
||||
BEAST_EXPECT(std::string{ec.category().name()} == name);
|
||||
ec.category().name();
|
||||
BEAST_EXPECT(! ec.message().empty());
|
||||
#if 0
|
||||
BEAST_EXPECT(std::addressof(ec.category()) ==
|
||||
std::addressof(detail::get_error_category()));
|
||||
BEAST_EXPECT(detail::get_error_category().equivalent(
|
||||
@@ -33,15 +34,16 @@ public:
|
||||
static_cast<std::underlying_type<error>::type>(ev))));
|
||||
BEAST_EXPECT(detail::get_error_category().equivalent(
|
||||
ec, static_cast<std::underlying_type<error>::type>(ev)));
|
||||
#endif
|
||||
}
|
||||
|
||||
void run() override
|
||||
{
|
||||
check("boost.beast.websocket", error::closed);
|
||||
check("boost.beast.websocket", error::failed);
|
||||
check("boost.beast.websocket", error::handshake_failed);
|
||||
check("boost.beast.websocket", error::buffer_overflow);
|
||||
check("boost.beast.websocket", error::partial_deflate_block);
|
||||
check(error::closed);
|
||||
check(error::failed);
|
||||
check(error::handshake_failed);
|
||||
check(error::buffer_overflow);
|
||||
check(error::partial_deflate_block);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user