🔨 cleanup
This commit is contained in:
parent
cf7786887c
commit
53b501a785
3 changed files with 74 additions and 73 deletions
|
@ -62,15 +62,16 @@ TEST_CASE("runtime checks")
|
|||
{
|
||||
SECTION("nothrow-copy-constructible exceptions")
|
||||
{
|
||||
// for ERR60-CPP (https://github.com/nlohmann/json/issues/531)
|
||||
if (std::is_nothrow_copy_constructible<std::runtime_error>::value)
|
||||
{
|
||||
CHECK(std::is_nothrow_copy_constructible<json::exception>::value);
|
||||
CHECK(std::is_nothrow_copy_constructible<json::parse_error>::value);
|
||||
CHECK(std::is_nothrow_copy_constructible<json::invalid_iterator>::value);
|
||||
CHECK(std::is_nothrow_copy_constructible<json::type_error>::value);
|
||||
CHECK(std::is_nothrow_copy_constructible<json::out_of_range>::value);
|
||||
CHECK(std::is_nothrow_copy_constructible<json::other_error>::value);
|
||||
}
|
||||
// for ERR60-CPP (https://github.com/nlohmann/json/issues/531):
|
||||
// Exceptions should be nothrow-copy-constructible. However, compilers
|
||||
// treat std::runtime_exception differently in this regard. Therefore,
|
||||
// we can only demand nothrow-copy-constructibility for our exceptions
|
||||
// if std::runtime_exception is.
|
||||
CHECK(std::is_nothrow_copy_constructible<json::exception>::value == std::is_nothrow_copy_constructible<std::runtime_error>::value);
|
||||
CHECK(std::is_nothrow_copy_constructible<json::parse_error>::value == std::is_nothrow_copy_constructible<std::runtime_error>::value);
|
||||
CHECK(std::is_nothrow_copy_constructible<json::invalid_iterator>::value == std::is_nothrow_copy_constructible<std::runtime_error>::value);
|
||||
CHECK(std::is_nothrow_copy_constructible<json::type_error>::value == std::is_nothrow_copy_constructible<std::runtime_error>::value);
|
||||
CHECK(std::is_nothrow_copy_constructible<json::out_of_range>::value == std::is_nothrow_copy_constructible<std::runtime_error>::value);
|
||||
CHECK(std::is_nothrow_copy_constructible<json::other_error>::value == std::is_nothrow_copy_constructible<std::runtime_error>::value);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue