26 [[noreturn]]
static void throw_lookup_error(std::string hostname)
32 TEST_CASE(
"DNSLookupError's can be thrown.",
"[DNSLookupError]")
34 SECTION(
"And can be caught.")
36 REQUIRE_THROWS(throw_lookup_error(
"example.com"));
38 SECTION(
"And can be caught as DNSLookupError.")
40 REQUIRE_THROWS_AS(throw_lookup_error(
"example.com"),
DNSLookupError);
42 SECTION(
"And can be caught as std::exception.")
44 REQUIRE_THROWS_AS(throw_lookup_error(
"example.com"), std::exception);
49 TEST_CASE(
"The 'what' method gives the unresolved hostname.",
53 throw_lookup_error(
"example.com"),
54 "DNSLookupError: Could not find an IP address for \"example.com\"");
59 TEST_CASE(
"Run dynamic destructors (DNSLookupError).",
"[DNSLookupError]")
63 REQUIRE_NOTHROW(
delete dns);
TEST_CASE("DNSLookupError's can be thrown.", "[DNSLookupError]")