MCPcopy Create free account
hub / github.com/boostorg/beast / check

Method check

test/beast/http/error.cpp:23–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21{
22public:
23 void
24 check(char const* name, error ev)
25 {
26 auto const ec = make_error_code(ev);
27 auto const ec_http = make_error_code(
28 static_cast<http::error>(0));
29 auto const& cat = ec_http.category();
30 BEAST_EXPECT(std::string(ec.category().name()) == name);
31 BEAST_EXPECT(! ec.message().empty());
32 BEAST_EXPECT(
33 std::addressof(ec.category()) == std::addressof(cat));
34 BEAST_EXPECT(cat.equivalent(
35 static_cast<std::underlying_type<error>::type>(ev),
36 ec.category().default_error_condition(
37 static_cast<std::underlying_type<error>::type>(ev))));
38 BEAST_EXPECT(cat.equivalent(ec,
39 static_cast<std::underlying_type<error>::type>(ev)));
40
41 BEAST_EXPECT(ec.message() != "");
42 }
43
44 void
45 run() override

Callers

nothing calls this directly

Calls 5

messageMethod · 0.80
equivalentMethod · 0.80
nameMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected