Add coverage for CATCH_SYSTEM_ERROR.

This commit is contained in:
davidmatson 2022-10-26 16:56:27 -07:00
parent a560a9f827
commit 3b474ce3cf

View File

@ -20,6 +20,7 @@ TEST_CASE("Check that our error handling macros throw the right exceptions", "[!
REQUIRE_THROWS_AS(CATCH_INTERNAL_ERROR(""), std::logic_error); REQUIRE_THROWS_AS(CATCH_INTERNAL_ERROR(""), std::logic_error);
REQUIRE_THROWS_AS(CATCH_ERROR(""), std::domain_error); REQUIRE_THROWS_AS(CATCH_ERROR(""), std::domain_error);
REQUIRE_THROWS_AS(CATCH_RUNTIME_ERROR(""), std::runtime_error); REQUIRE_THROWS_AS(CATCH_RUNTIME_ERROR(""), std::runtime_error);
REQUIRE_THROWS_AS(CATCH_SYSTEM_ERROR(0, std::generic_category()), std::system_error);
REQUIRE_THROWS_AS([](){CATCH_ENFORCE(false, "");}(), std::domain_error); REQUIRE_THROWS_AS([](){CATCH_ENFORCE(false, "");}(), std::domain_error);
REQUIRE_NOTHROW([](){CATCH_ENFORCE(true, "");}()); REQUIRE_NOTHROW([](){CATCH_ENFORCE(true, "");}());
} }